-
Author
-
December 23, 2013 at 13:54 #8716gideon1210Participant
Is there a way of setting up a email which is auto sent to a user once theyve signed up and after they’ve activated there account
December 23, 2013 at 15:50 #8734AbeKeymasteradd this code to sweetdate-child/functions.php and modify it for your needs:
COPY CODE//send a welcome email when a user account is activated add_action('bp_core_activated_user','kleo_welcome_user_notification',10,3); function kleo_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 = __( 'Dear USER_DISPLAY_NAME, Your new account is set up. You can log in with the following information: Username: USERNAME LOGINLINK Thanks! SITE_NAME' ); //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;//from $message_headers = "From: \"{$from_name}\" \n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n"; //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; }
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.April 11, 2014 at 19:47 #14843HarvinderParticipantHi,
Could you please break down the different section in this code, and tell me what the sections are used for?
Also would i need to edit this in anyway?
Thanks
HarvinderApril 15, 2014 at 00:52 #15114AbeKeymasterThat is just an example and you need to edit it to match you needs. Try searching for a plugin that changes WordPress default emails. That code replaces the default activation email with the text you see there, “‘Dear USER_DISPLAY_NAME …”
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer. -
AuthorPosts
The forum ‘Sweetdate – WordPress’ is closed to new topics and replies.