• Resolved Harsh Goyal

    (@harshgoyaa)


    i wanted to add multiple email recipient for the Emails. talking specifically i want to send a mail when ever the user updates his/her profile to the user as well as the admin, so that admin knows about the update. can someone please help me out with this.
    Thank you.
    Stay safe.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @harshgoyaa

    I made a tutorial on how to add custom Email notification in the link:
    https://www.champ.ninja/2020/05/custom-email-notifications/

    Regards,

    Thread Starter Harsh Goyal

    (@harshgoyaa)

    @champsupertramp Wow thank you so much, but as i see it the code, it is, if someone logs in how to edit it, if a user updates his/her profile or in short if he/she submits the update profile button. please help me out with that also.
    Thank You.
    stay safe.

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @harshgoyaa

    You can use this action hook to trigger email notification( below is just an incomplete example ):

    
    add_action("um_after_user_updated","um_custom_after_user_updated", 10, 1);
    function um_custom_after_user_updated( $user_id ){
    
            um_fetch_user( $user_id ); 
            $recipient = "[email protected]";
    	$profile_name = um_user("display_name");
    	$profile_url = um_user_profile_url( $user_id );
    
    	UM()->mail()->send( $recipient, 'ninja_new_user_logged_in', array(
    				'plain_text'	 => 1,
    				'tags'				 => array(
    					'{profile_name}',
    					'{profile_url}',
    				),
    				'tags_replace' => array(
    					$profile_name,
    					$profile_url,
    				)
    	) );
    }
    

    Regards,

    Thread Starter Harsh Goyal

    (@harshgoyaa)

    @champsupertramp wow thank you soo much it worked beautifully. thank you soooo much
    stay safe ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘how to set Multiple Email Recipient’ is closed to new replies.