How to get sent an email when somebody registers....
Permalink
How can I make C5 send me an email when somebody registers on my website? As I have it so I have to activate it, so really need an email to be sent every time somebody signs up so I can jump on and approve it. :)
Thanks guys you rock.
Thanks guys you rock.
no, I don't think c5 provides this ability by default, but if you need it, you can override the c5root/concrete/controllers/register.php file, by duplicating it at c5root/controllers/register.php, and just add the sendmail function to the do_register method. There's already an example in there of how to send out email with concrete's mail helper.
I have opened the file, and am not exactly sure where I should do the editing.
So I guess if the file is in concrete/controllers/ and the root/controllers/ then they both will activate? So I just change some code to send to a certain email address, and change the success message?
Cheers
Sehldon
So I guess if the file is in concrete/controllers/ and the root/controllers/ then they both will activate? So I just change some code to send to a certain email address, and change the success message?
Cheers
Sehldon
when you override anything in concrete, only the new version will execute. so in this case only the root/controllers/ one will run.
try putting the sendMail code right after this line:
try putting the sendMail code right after this line:
if (!$u->isError()) {
still getting confused. I can't see much to do with posting the email there, I can only find checking the email for validation and so forth.
Could you please let me know a little bit more on how to do this, :) Much appreciated - if it's trouble let me know if I need to fix you up for anything.
Cheers
Sheldon
Could you please let me know a little bit more on how to do this, :) Much appreciated - if it's trouble let me know if I need to fix you up for anything.
Cheers
Sheldon
I have had a look through the file but am
still getting confused. I can't see much to do with posting the email there, I can only find checking the email for validation and so forth.
Could you please let me know a little bit more on how to do this, :) Much appreciated - if it's trouble let me know if I need to fix you up for anything.
Cheers
Sheldon
still getting confused. I can't see much to do with posting the email there, I can only find checking the email for validation and so forth.
Could you please let me know a little bit more on how to do this, :) Much appreciated - if it's trouble let me know if I need to fix you up for anything.
Cheers
Sheldon
I attached a zip of our register.php. It will probably have a bunch of unreleased code in there from the beta that will probably cause problem for you, so you need to copy the mail code to the same spot in your /concrete/controllers/register.php file. search the file for SPARX and you'll find it.
I tried this but when I get to the mail template is crashes. I need more help in building the template. Here are the errors I get:
Warning: include(/home6/healthe1/public_html/concrete/config/../mail/block_registration_notification.php.php) [function.include]: failed to open stream: No such file or directory in /home6/healthe1/public_html/concrete/helpers/mail.php on line 89
Warning: include() [function.include]: Failed opening '/home6/healthe1/public_html/concrete/config/../mail/block_registration_notification.php.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php:/home6/healthe1/public_html/libraries/3rdparty:/home6/healthe1/public_html/concrete/config/../libraries/3rdparty') in /home6/healthe1/public_html/concrete/helpers/mail.php on line 89
Warning: Cannot modify header information - headers already sent by (output started at /home6/healthe1/public_html/concrete/helpers/mail.php:89) in /home6/healthe1/public_html/concrete/libraries/controller.php on line 333
Warning: include(/home6/healthe1/public_html/concrete/config/../mail/block_registration_notification.php.php) [function.include]: failed to open stream: No such file or directory in /home6/healthe1/public_html/concrete/helpers/mail.php on line 89
Warning: include() [function.include]: Failed opening '/home6/healthe1/public_html/concrete/config/../mail/block_registration_notification.php.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php:/home6/healthe1/public_html/libraries/3rdparty:/home6/healthe1/public_html/concrete/config/../libraries/3rdparty') in /home6/healthe1/public_html/concrete/helpers/mail.php on line 89
Warning: Cannot modify header information - headers already sent by (output started at /home6/healthe1/public_html/concrete/helpers/mail.php:89) in /home6/healthe1/public_html/concrete/libraries/controller.php on line 333
block_registration_notification.php.php
remove the extra.php it auto adds it for the template
remove the extra.php it auto adds it for the template
http://www.concrete5.org/index.php?cID=7589...
Cheers