Welcome email for new FEU users
Posted: Thu May 13, 2010 5:42 pm
Hello,
Ive been trying to make an UDT and fetch it to SelfRegistration OnUserRegistered event, so after the completion of registration , new users receive a welcome email.
Whats wrong with it?
P.S I use email as a username.
Ive been trying to make an UDT and fetch it to SelfRegistration OnUserRegistered event, so after the completion of registration , new users receive a welcome email.
Code: Select all
global $gCms;
$config = $gCms->GetConfig();
$site = $config['root_url'];
$feusers = $gCms->modules['FrontEndUsers']['object'];
$username = $feusers->GetEmail($uid);
$to = $username;
$from = 'webmaster@mysite.org';
$subject = 'Your account information';
$message = <<<EOT
You have been added as a new user at Mysite.Org.
This is your account information:
Your username is: $username
Log into the site here: $site
EOT;
echo "<p>E-mailing user account information…";
if(@mail($to, $subject, $message)) {
echo '[done]';
} else {
echo '<strong>[failed]</strong>';
}
echo "</p>";P.S I use email as a username.