wordpress snippets last updated   : April 22, 2014
we now have 631 snippets

Send email notification when profile updates

wordpress snippet

I got a few emails asking about sending an email when a user simply updates the profile. Well here it is, adding this snippet to the functions.php of your wordpress theme will send an email notification to the user when the user profile updates.

snippet :  PHPcopy
function user_profile_update( $user_id ) {
	$site_url = get_bloginfo('wpurl');
        $user_info = get_userdata( $user_id );
        $to = $user_info->user_email;
        $subject = "Profile Updated: ".$site_url."";
        $message = "Hello " .$user_info->display_name . "\nYour profile has been updated!\n\nThank you for visiting\n ".$site_url."";
        wp_mail( $to, $subject, $message);
}
add_action( 'profile_update', 'user_profile_update', 10, 2);

  • rohit

    its workin perfectly. but mail is showing to spam folder
    :(

    • http://wpsnipp.com Kevin Chard

      Not much can be down about that, I would think it has to do with spam settings.

jqsnipp.com | we just launched jquery snippets website