function custom_oa_social_login_action_after_user_insert($user_data, $identity) { if( ! empty ($user_data->user_email) && strpos($user_data->user_email, 'example') === false) { //The blogname option is escaped with esc_html on the way into the database $blogname = wp_specialchars_decode (get_option ('blogname'), ENT_QUOTES); //Setup Mail $recipient = $user_data->user_email; $subject = 'Welcome to '.$blogname; $body = "Welcome to our blog\r\n\r\n"; $body .= "Your username: ".$user_data->user_login; //Send Mail @wp_mail ($recipient, $subject, $body); } } add_action('oa_social_login_action_after_user_insert', 'custom_oa_social_login_action_after_user_insert', 10, 2);
Please sign in to your OneAll account to ask a new question or to contribute to the discussions.
Please click on the link below to connect to the forum with your OneAll account.
Comments
which CMS (WordPress, Drupal, Joomla ... ) are you using?
you can use something like this:
function custom_oa_social_login_action_after_user_insert($user_data, $identity) { if( ! empty ($user_data->user_email) && strpos($user_data->user_email, 'example') === false) { //The blogname option is escaped with esc_html on the way into the database $blogname = wp_specialchars_decode (get_option ('blogname'), ENT_QUOTES); //Setup Mail $recipient = $user_data->user_email; $subject = 'Welcome to '.$blogname; $body = "Welcome to our blog\r\n\r\n"; $body .= "Your username: ".$user_data->user_login; //Send Mail @wp_mail ($recipient, $subject, $body); } } add_action('oa_social_login_action_after_user_insert', 'custom_oa_social_login_action_after_user_insert', 10, 2);
I haven't tested the code, so please make sure that it works correctly after having added it.