• Hey

    Is there a snippet of code I can place in this plugin to send the new registration welcome email to users?

    I saw a previous post where the author said this plugin doesn’t send the email because the email isn’t relevant to users – all it sends is the email and password (which they don’t need because they login via their social account).

    HOWEVER, you can customize the email with the SB Welcome Email Editor plugin. That way, you can send a welcome email to newly registered users just thanking them for joining the site, etc.

    Can someone please help?

    Thanks in advance,
    Alex

    https://www.ads-software.com/extend/plugins/wordpress-social-login/

Viewing 7 replies - 1 through 7 (of 7 total)
  • You can try this I can’t get that plugin to work for some reason

    //notifiication email
    function wsl_user_email_init($user_id){
    wp_new_user_notification($user_id, $userdata['pass']);
    }
    add_action('wsl_hook_process_login_before_redirect' , 'wsl_user_email_init');

    added to functions.php

    Thread Starter alexklinghoffer

    (@alexklinghoffer)

    He Mel,

    Which functions.php file? Or should I try installing that code as a separate plugin?

    Best,
    Alex

    Thread Starter alexklinghoffer

    (@alexklinghoffer)

    Hey also, I found the file that sends the admin email in: wordpress-social-login/includes/services/wsl.mail.notification.php.

    The code is:

    <?php
    /*!
    * WordPress Social Login
    *
    * https://hybridauth.sourceforge.net/wsl/index.html | https://github.com/hybridauth/WordPress-Social-Login
    *    (c) 2011-2013 Mohamed Mrassi and contributors | https://www.ads-software.com/extend/plugins/wordpress-social-login/
    */
    
    /**
    * Email notifications to send. so far only the admin one is implemented
    */
    
    // Exit if accessed directly
    if ( !defined( 'ABSPATH' ) ) exit;
    
    // --------------------------------------------------------------------
    
    /**
    * send a notification to blog administrator when a new user register using WSL
    * again borrowed from https://www.ads-software.com/extend/plugins/oa-social-login/
    */
    function wsl_admin_notification( $user_id, $provider )
    {
        //Get the user details
    	$user = new WP_User($user_id);
    	$user_login = stripslashes($user->user_login);
    
    	// The blogname option is escaped with esc_html on the way into the database
    	// in sanitize_option we want to reverse this for the plain text arena of emails.
    	$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
    
    	$message  = sprintf(__('New user registration on your site: %s', 'wordpress-social-login'), $blogname        ) . "\r\n\r\n";
    	$message .= sprintf(__('Username: %s'                          , 'wordpress-social-login'), $user_login      ) . "\r\n";
    	$message .= sprintf(__('Provider: %s'                          , 'wordpress-social-login'), $provider        ) . "\r\n";
    	$message .= sprintf(__('Profile: %s'                           , 'wordpress-social-login'), $user->user_url  ) . "\r\n";
    	$message .= sprintf(__('Email: %s'                             , 'wordpress-social-login'), $user->user_email) . "\r\n";
    	$message .= "\r\n--\r\n";
    	$message .= "WordPress Social Login\r\n";
    	$message .= "https://www.ads-software.com/extend/plugins/wordpress-social-login/\r\n";
    
    	@wp_mail(get_option('admin_email'), '[WordPress Social Login] '.sprintf(__('[%s] New User Registration', 'wordpress-social-login'), $blogname), $message);
    }


    [Please use the code buttons when posting code here]


    Can I add a function to this file to send the email?

    Thread Starter alexklinghoffer

    (@alexklinghoffer)

    I got this to work, but it was very complicated. If anyone wants to know how, just email me

    I also was able to do a temp workaround using that function, what is you email btw

    Thread Starter alexklinghoffer

    (@alexklinghoffer)

    alexklinghoffer at yahoo dot com

    hi Alex,

    Good day!

    I have emailed you with the function. I hope you can respond. Thank you so much.

    Best regards,
    Mariz

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Send Welcome Email’ is closed to new replies.