Hi
I'm setting up a site that has a small members' section using FrontEndUsers and CustomContent. People cannot self-register; their accounts are setup manually by an admin after they have purchased a product through a seperate process.
What I would like to happen is for the user to automatically receive an email after the admin has set up their account. I don't think there is an option in FEU to do that, and I can't see a plugin that might help.
I can probably program it in PHP like I have for simple contact forms I've created before, but I would rather not hack a CMSMS module - looks a bit complicated!
Does anyone know of a plugin, or a way to do this?
Thanks,
Mark.
FrontEndUsers: Automatic email to user upon registration by admin?
FrontEndUsers: Automatic email to user upon registration by admin?
Last edited by neuroboy on Mon Jan 25, 2010 4:17 pm, edited 1 time in total.
Re: FrontEndUsers: Automatic email to user upon registration
I made a UDT to let my feusers know whenever their profile gets updated and added it to the FEU OnUpdateUser event in the Events Manager. You could use the same concept to let them know when their profile has been created by adding your UDT to the OnCreateUser event.
I haven't tested this out, but it should work:
I haven't tested this out, but it should work:
Code: Select all
global $gCms;
$feusers =& cms_utils::get_module('FrontEndUsers');
if( $feusers ) {
$uid =& $params['id'];
$properties = $feusers->GetUserProperties($uid);
foreach($properties as $key=>$value) {
if ($value['title'] == 'email') {
$email = $value['data'];
}
if ($value['title'] == 'firstname') {
$firstname = $value['data'];
}
}
$bodytext = 'Hi '.$firstname.'! And other email body text here';
$cmsmailer =& cms_utils::get_module('CMSMailer');
$cmsmailer->AddAddress($email);
$cmsmailer->AddBCC('You can put your email or your default site email here');
$cmsmailer->SetBody($bodytext);
$cmsmailer->IsHTML(true);
$cmsmailer->SetSubject('Your user account has been created');
$cmsmailer->Send();
$cmsmailer->reset();
}