Home › Forums › Front End PM PRO › Welcome Message Not Working
- This topic has 5 replies, 2 voices, and was last updated 4 years, 8 months ago by Shamim Hasan.
- AuthorPosts
- April 7, 2021 at 6:02 pm #42876kitty.devineParticipant
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 🥰 Just wanted to say thanks for following me, I appreciate it 😘 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?
April 8, 2021 at 12:54 am #42883Shamim HasanKeymasterCan you please add the default code in https://sp-test1.arogga.co/docs/front-end-pm/customization/send-welcome-message-user-register/ and see if it working? Then change to your code.
April 12, 2021 at 7:44 pm #42902kitty.devineParticipantNot 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.
April 12, 2021 at 8:31 pm #42904kitty.devineParticipantTo 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!
April 13, 2021 at 7:45 pm #42913kitty.devineParticipantIt seems to be working now. I think the code had been removed when the theme was updated. Thanks!
April 14, 2021 at 1:46 am #42918Shamim HasanKeymasterIt is always better to use a child theme for modification.
- AuthorPosts
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.