Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter helenagwyn

    (@helenagwyn)

    I did some searching and added some code to the plugin that works for me. It’s not ideal, but I need this functionality for my client.

    At the end of create_new_user() (line 133 in class-wp-temporary-login-without-password-common) I used wp_mail() to send a custom mail to the newly created user containing the necessary information.

    Using wp_send_new_notifications() or wp_new_user_notification() didn’t send after the meta was updated with the generated link.

    Any change you could share this code?

    Thanks in advance!

    Thread Starter helenagwyn

    (@helenagwyn)

    I edited the file includes/class-wp-temporary-login-without-password-common.php.

    On line 133 I added:
    $message = sprintf( __( “Welcome to %s! Here’s how to log in:” ), get_option(‘blogname’) ) . “<br/>”;
    $message .= “https://www.domain.com/wp-admin/?wtlwp_token=&#8221; . get_user_meta($user_id,’_wtlwp_token’,true) . “<br/>”;
    $message .= sprintf( __(‘If you have any problems, please contact me at %s.’), get_option(‘admin_email’) ) . “<br/><br/>”;
    wp_mail($email,sprintf( ‘[%s] Your temporary login link for ‘, get_option(‘blogname’) ),$message,array(‘Content-Type: text/html; charset=UTF-8’),null);

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Automatic Mail’ is closed to new replies.