Skip to content

Instantly share code, notes, and snippets.

@creativeartbd
Created July 13, 2021 11:12
Show Gist options
  • Save creativeartbd/ab1895cf4c4c60a97b5ea3740a92d0b5 to your computer and use it in GitHub Desktop.
Save creativeartbd/ab1895cf4c4c60a97b5ea3740a92d0b5 to your computer and use it in GitHub Desktop.
Tutor LMS - Send welcome email to register user.
function send_email_after_signup( $user_id ) {
$student_id = tutils()->get_user_id($user_id);
$student = get_userdata($student_id);
$site_url = get_bloginfo( 'url' );
$site_name = get_bloginfo( 'name' );
$display_name = $student->display_name;
$user_email = $student->user_email;
$user_email = $student->user_email;
$to = $user_email;
$subject = 'Your Subject line will goes to here';
$body = "
Hello {$display_name} <br/>
Thank you for joining to our website. <br/>
Regards.
";
$headers = array('Content-Type: text/html; charset=UTF-8');
wp_mail( $to, $subject, $body, $headers );
}
add_action( 'tutor_after_student_signup', 'send_email_after_signup');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment