Topic: How to send a welcome email when email verification is set to off?

Hello,

I am sure there should be a way to do this, but I am just not able to figure out where the setting could be. Thing is, I wish to turn off new email verification to bypass the hassle of the users having to register, get a temporary random password and then figure out how to change it. However, I wish to send them an email welcoming them to the community as well as the information about their username and password for future reference. How do I go about accomplishing this?

Thanks!

Re: How to send a welcome email when email verification is set to off?

Edit register.php? The code would be similar to the other code you're referring to, just without an if statement wink

Re: How to send a welcome email when email verification is set to off?

Thanks Smartys. I need a little more help since I am not exactly familiar with PHP.

I copied and pasted this code somewhere in the middle of the register.php page:

{
        // Load the "welcome" template
        $mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$pun_user['language'].'/mail_templates/welcome.tpl'));

        // The first row contains the subject
        $first_crlf = strpos($mail_tpl, "\n");
        $mail_subject = trim(substr($mail_tpl, 8, $first_crlf-8));
        $mail_message = trim(substr($mail_tpl, $first_crlf));

        $mail_subject = str_replace('<board_title>', $pun_config['o_board_title'], $mail_subject);
        $mail_message = str_replace('<base_url>', $pun_config['o_base_url'].'/', $mail_message);
        $mail_message = str_replace('<username>', $username, $mail_message);
        $mail_message = str_replace('<password>', $password1, $mail_message);
        $mail_message = str_replace('<login_url>', $pun_config['o_base_url'].'/login.php', $mail_message);
        $mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'].' '.$lang_common['Mailer'], $mail_message);

        pun_mail($email1, $mail_subject, $mail_message);

        message($lang_register['Reg e-mail'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.', true);
    }

I checked it and the mail is being sent perfectly. smile

However, I would like to modify the content of the mail a little. For example, I would like to remove the word "Mailer" from the 'From', remove the line asking them to login to activate and instead have a welcome sentence. Where do I edit the variables in?

Regards.

Re: How to send a welcome email when email verification is set to off?

You don't need the {}s surrounding it.
And if you want to change the text of the email, you should probably create a new template, edit that, and then change this line

$mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$pun_user['language'].'/mail_templates/welcome.tpl'));

to refer to the new file.

Re: How to send a welcome email when email verification is set to off?

After about an hour of tweaking, I managed to get it setup exactly the way I wanted it. Thanks a lot for your help! smile

Good day!