New user activation notification
Permalink
I've read about this in a couple other threads. When a user registers, our site is setup so that the admin receives an email to approve the account. Once approved, we'd like an email to go to the new user's email saying that they've been approved.
Can anyone assist me in this?
Thanks for your help!
-Dan
Can anyone assist me in this?
Thanks for your help!
-Dan
This solution is a little outdated. I can't seem to find the right way to do it within that thread. The email is being sent when someone registers but not when they've been activated.
Thanks for the response.
-Dan
Thanks for the response.
-Dan
It's right there in the thread:
To send an email to users upon activation, copy concrete/models/userinfo.php to /models/userinfo.php. After the function activate() code (around line 540), add this code:
Then create a mail template called "user_activation.php" in the mail folder.
Now your users will receive an email each time you activate them.
To send an email to users upon activation, copy concrete/models/userinfo.php to /models/userinfo.php. After the function activate() code (around line 540), add this code:
//send user email on activation $userEmailAddress = $this->uEmail; $mh = Loader::helper('mail'); $mh->addParameter('userName', $this->uName); $mh->to($userEmailAddress); $mh->load('user_activation'); $mh->sendMail();
Then create a mail template called "user_activation.php" in the mail folder.
Now your users will receive an email each time you activate them.
Yes, I read that. But that code is outdated because the userinfo.php no longer has the same things in it.
Then make the adjustments, is what I would suggest. Other than that, I dunno. Sorry...
This is what I use in 5.6.0.2:
I created an override of 'root/concrete/models/userinfo.php' by making a copy of the file to 'root/models/userinfo.php' and edited the activate() function (line 572) to read:
I also created the email template 'user_activation.php' in 'root/mail' which holds:
Of course you can tweak the mail template to your liking, but all my users now gets an email whenever they are activated.
EDIT: Dang... never use the toilet, then your post will be old before you hit Reply. ;)
I created an override of 'root/concrete/models/userinfo.php' by making a copy of the file to 'root/models/userinfo.php' and edited the activate() function (line 572) to read:
function activate() { $db = Loader::db(); $q = "update Users set uIsActive = 1 where uID = '{$this->uID}'"; $r = $db->query($q); //Send user email on activation $mh = Loader::helper('mail'); $mh->addParameter('uName', $this->uName); $mh->addParameter('uEmail', $this->uEmail); $mh->to($this->uEmail); $mh->load('user_activation'); //load mail template $mh->sendMail(); Events::fire('on_user_activate', $this); }
I also created the email template 'user_activation.php' in 'root/mail' which holds:
Of course you can tweak the mail template to your liking, but all my users now gets an email whenever they are activated.
EDIT: Dang... never use the toilet, then your post will be old before you hit Reply. ;)
Here's my full function within userinfo.php:
and here's my entire user_activation.php:
the email still doesn't seem to be going to the newly activated user.
Thanks so much for everyone's assistance.
function activate() { $db = Loader::db(); $q = "update Users set uIsActive = 1 where uID = '{$this->uID}'"; $r = $db->query($q); //Send user email on activation $mh = Loader::helper('mail'); $mh->addParameter('uName', $this->uName); $mh->addParameter('uEmail', $this->uEmail); $mh->to($this->uEmail); $mh->load('user_activation'); //load mail template $mh->sendMail(); Events::fire('on_user_activate', $this); }
and here's my entire user_activation.php:
the email still doesn't seem to be going to the newly activated user.
Thanks so much for everyone's assistance.
Have you checked your logfile? Do you get any emails from your site (test
with forgot password or something)?
Den 23 jan 2013 16:48 skrev "concrete5 Community" <
discussions@concretecms.com>:
with forgot password or something)?
Den 23 jan 2013 16:48 skrev "concrete5 Community" <
discussions@concretecms.com>:
I have checked the logs file in the database. The emails are coming through to the admin but none are going out to the newly activated users.
The c5 log in the dashboard can be a bit misleading. When viewing the log after an activation, the first entry you see is the email sent and the second entry from top is the error (if any).
Also, have you checked spam filters and junk boxes?
Also, have you checked spam filters and junk boxes?
Thanks. I've checked the logs in the C5 backend and in the database. Doesn't seem like any emails are going out to the newly registered users.
Is my code wrong?
Is my code wrong?
http://www.concrete5.org/community/forums/customizing_c5/new-user-n...