Welcome email not firing off for accounts created by social media login
-
I currently have the following in my bp-custom.php, which creates my welcome email.
add_action( 'bp_core_activated_user', 'bpdev_welcome_user_notification', 0, 3 ); function bpdev_welcome_user_notification( $user_id, $key = false, $user = false ) { if ( is_multisite() ) { return ;// we don't need it for multisite } //send the welcome mail to user //welcome message $welcome_email = __( 'Hi USER_DISPLAY_NAME, welcome to SITE_NAME. Thankyou for signing up and helping us grow our community. Your new account is all set up and ready to go, you can login with the following information: Username: USERNAME Please let us know if you have any issues using the site via the contact us page: http://mysite.com/contact-us/ The SITE_NAME Team' ); //get user details $user = get_userdata( $user_id ); //get site name $site_name = get_bloginfo( 'name' ); //update the details in the welcome email $welcome_email = str_replace( 'USER_DISPLAY_NAME', $user->first_name, $welcome_email ); $welcome_email = str_replace( 'SITE_NAME', $site_name, $welcome_email ); $welcome_email = str_replace( 'USERNAME', $user->user_login, $welcome_email ); $welcome_email = str_replace( 'LOGINLINK', wp_login_url(), $welcome_email ); //from email $admin_email = get_site_option( 'admin_email' ); if ( empty( $admin_email ) ) { $admin_email = 'support@' . $_SERVER['SERVER_NAME']; } $from_name = $site_name . "<$admin_email>" ;//from $message_headers = array( 'from' => $from_name, 'content-type' => 'text/plain; charset='. get_option('blog_charset') ); //EMAIL SUBJECT $subject = sprintf( __( 'Welcome to %1$s ' ), $site_name ) ; //SEND THE EMAIL wp_mail( $user->user_email, $subject, $welcome_email, $message_headers ); return true; }
As the action is set to bp_core_activated_user, any user that does not need to be activated will not receive an email.
What other functions are there that will allow me to send an email to all users, and not just those that have to activate their accounts? I know I’ve come across it before, but I can’t seem to find it now
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.