Welcome Message Not Working


Home Forums Front End PM PRO Welcome Message Not Working

This topic is: Not Resolved
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #42876
    kitty.devine
    Participant

    I’m trying to add a welcome message to my site with the code listed in the documentation:

    add_action( 'user_register', 'fep_cus_user_register_send_messaage', 10, 1 );
    
    function fep_cus_user_register_send_messaage( $user_id ){
            if ( $user_id < 1 )
                    return;
            if ( ! function_exists( 'fep_send_message' ) )
                    return;
     
            // Prepare message data
            $message = array(
                 'message_title' => 'Welcome to Str8 Boy Whisperer' . fep_get_userdata( $user_id, 'display_name', 'id' ), //change with message title
                 'message_content' => 'Hey babe &#129392; Just wanted to say thanks for following me, I appreciate it &#128536;
     Where did you find out about me? x', //change with message content
                 'message_to_id' => $user_id
            );
    
            $override = array(
                 'mgs_author' => 1, //change with message sender id
            );
    
            // Send message
           fep_send_message( $message, $override );      
    }
    

    However, I get this error:

    “Your PHP code changes were rolled back due to an error on line 0 of file Unknown. Please fix and try saving again.

    Exception thrown without a stack frame”

    Do you know what’s happening here?

    #42883
    Shamim Hasan
    Keymaster

    Can you please add the default code in https://www.shamimsplugins.com/docs/front-end-pm/customization/send-welcome-message-user-register/ and see if it working? Then change to your code.

    #42902
    kitty.devine
    Participant

    Not sure what happened but it seems to have accepted the code! However the welcome message still isn’t sending. All the other modifications I’ve made to functions.php seem to be working so not sure why this one isn’t being picked up.

    #42904
    kitty.devine
    Participant

    To clarify, it seems like it’s being sent to some new users but not all…The code seems to have disappeared from function.php so I can’t even edit it now which is odd. Not sure where it might have gone!

    #42913
    kitty.devine
    Participant

    It seems to be working now. I think the code had been removed when the theme was updated. Thanks!

    #42918
    Shamim Hasan
    Keymaster

    It is always better to use a child theme for modification.

Viewing 6 posts - 1 through 6 (of 6 total)

You need to purchase ‘Front End PM PRO’ to create topic in this support forum.

If you already purchased ‘Front End PM PRO’ please LOGIN.