Last active
June 9, 2022 10:22
-
-
Save webtoffee-git/764c655c78fb520bcdf0acd6f33a0cf0 to your computer and use it in GitHub Desktop.
Send custom email content for new WooCommerce Users-Users Import export
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('wt_user_registration_email', 'wt_user_registration_email'); | |
function wt_user_registration_email($mail_attrs) | |
{ | |
$user = get_user_by('id', $mail_attrs['user_id']); | |
$first_name = $user->first_name; | |
$blog_name = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES); | |
$user_login = $user->user_login; | |
$password = $mail_attrs['password']; | |
$subject = 'Your account has been created!';//please change mail subject | |
$mail_body = "Hi ".$first_name.", | |
Thanks for creating an account on ".$blog_name." . Your username is ".$user_login." . You can access your account area to view orders, change your password. | |
Your password has been generated: ".$password." | |
We look forward to seeing you soon. | |
".$blog_name;//please change mail body | |
$mail_attrs['subject'] = $subject; | |
$mail_attrs['body'] = nl2br($mail_body); | |
return $mail_attrs; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment