Page 1 of 3
[MOD] Send Alert Email when a new user has registered?
Posted: Thu Sep 03, 2009 9:30 am
by bandergrove
Is it possible to have OpenCart send the store owner an alert email when a new user has registered?
I have activated the option "Approve New Customers" (Don't allow new customer to login until their account has been approved), but it would be nice for the store owner to receive an email so that they know when they must login to activate a new account.
Otherwise, the store owner must waste time logging in and checking the Customers tab to see if there have been new registrations.
Thanks!
Re: Send Alert Email when a new user has registered?
Posted: Fri Sep 18, 2009 4:53 pm
by gavin m
I'd be interested in this too.
Re: Send Alert Email when a new user has registered?
Posted: Fri Feb 12, 2010 7:21 pm
by Cristina
mee too!!! Got someone the answer???
thanks,
Cristina
Re: Send Alert Email when a new user has registered?
Posted: Fri Feb 12, 2010 8:32 pm
by djcraig49
I posted this a little while ago and got no reply so programmed it in myself by copying the structure of the mail to the customer and implementing it to the store owner.
Re: Send Alert Email when a new user has registered?
Posted: Fri Feb 12, 2010 8:43 pm
by Qphoria
1. EDIT: catalog/controller/account/create.php
2. FIND:
3. AFTER, ADD:
Code: Select all
//Q: Send additional email to store owner.
$mail->setTo($this->config->get('config_email'));
$mail->send();
Re: [MOD] Send Alert Email when a new user has registered?
Posted: Sat Feb 13, 2010 12:13 am
by Cristina
Hi Qphorbia!!!
thank you so much for your answer!!
I was searching and searching but i didn't saw your post.
Again thank you so much,
Cristina
Re: [MOD] Send Alert Email when a new user has registered?
Posted: Mon Jun 21, 2010 7:49 pm
by vijayanand444
Thanks for the help. Whether the new user confirmation email will be sent to the admin id alone are to the additional alert emails also which i have added in the admin section?
Re: Send Alert Email when a new user has registered?
Posted: Sat Jul 17, 2010 9:11 pm
by Chrissy Poo
Qphoria wrote:1. EDIT: catalog/controller/account/create.php
2. FIND:
3. AFTER, ADD:
Code: Select all
//Q: Send additional email to store owner.
$mail->setTo($this->config->get('config_email'));
$mail->send();
Thank You, Just tested with 1.4.8b and works perfect

Re: [MOD] Send Alert Email when a new user has registered?
Posted: Sun Jul 18, 2010 8:58 am
by Joxe
Works alright but it's a pity not to get some costumer information like the name, at least. Instead we get the exact same email that the costumer get. But, hey...better than nothing

Re: [MOD] Send Alert Email when a new user has registered?
Posted: Sun Jul 18, 2010 9:05 am
by Chrissy Poo
Yeah I see your point, maybe someone could take this a little further?
Re: [MOD] Send Alert Email when a new user has registered?
Posted: Sun Jul 18, 2010 8:58 pm
by i2Paq
Joxe wrote:Works alright but it's a pity not to get some costumer information like the name, at least. Instead we get the exact same email that the costumer get. But, hey...better than nothing

I agree.
There should be a different layout on the e-mail the store-owner gets:
Hello, a new customer just registered at *store-name*.
Below you find all the details.
Client ID: 1574
Name: Norman in 't Veldt
E-Mail:
me@store-name.nl
Newsletter: Yes
Telefoon: 0123456
Fax: 01234567
Address: Street 1
Area: Suburb-1
Postcode: 1234 AB
City: MyTown
State: Noord-Holland
Country: Netherlands
Re: [MOD] Send Alert Email when a new user has registered?
Posted: Tue Jul 20, 2010 1:13 am
by Joxe
i2Paq wrote:
Hello, a new customer just registered at *store-name*.
Below you find all the details.
Client ID: 1574
Name: Norman in 't Veldt
E-Mail:
me@store-name.nl
Newsletter: Yes
Telefoon: 0123456
Fax: 01234567
Address: Street 1
Area: Suburb-1
Postcode: 1234 AB
City: MyTown
State: Noord-Holland
Country: Netherlands
yeah! Something like that would be great !

Re: [MOD] Send Alert Email when a new user has registered?
Posted: Tue Jul 20, 2010 1:48 am
by Qphoria
Eh? You get all the information there is. What more do you need?
Re: [MOD] Send Alert Email when a new user has registered?
Posted: Fri Jul 23, 2010 12:24 am
by sonofrodrigo
Qphoria wrote:1. EDIT: catalog/controller/account/create.php
2. FIND:
3. AFTER, ADD:
Code: Select all
//Q: Send additional email to store owner.
$mail->setTo($this->config->get('config_email'));
$mail->send();
To get the name of the new customer, add the following (substituted for step #3 above):
Code: Select all
//Q: Send additional email to store owner.
$new_subject = 'New Customer Registration: ' . $this->request->post['firstname'] . ' ' . $this->request->post['lastname'];
$mail->setSubject($new_subject);
$mail->setTo($this->config->get('config_email'));
$mail->send();
You'll receive the same email the customer does, but the subject line will instead read "New Customer Registration:
Firstname Lastname".
I've tested it and it works. Good nuff for me...
If you wanted to create a whole new email for the admin, it looks like you could create a new PHP email template in /catalog/language/english/mail/ (say account_create_admin.php), load it, and send a completely different email.
You'd just use this to start and continue from there:
Code: Select all
this->language->load('mail/account_create_admin);
Re: [MOD] Send Alert Email when a new user has registered?
Posted: Fri Jul 23, 2010 1:41 am
by Joxe
Great! Thank you!

Re: [MOD] Send Alert Email when a new user has registered?
Posted: Tue Sep 21, 2010 2:33 pm
by d7a7z7e7d
Here is the code to add more details to the e-mail.
After:
Add:
Code: Select all
//Q: Send additional email to store owner.
$this->load->model('localisation/country');
$this->load->model('localisation/zone');
$country = $this->model_localisation_country->getCountry($this->request->post['country_id']);
$zone = $this->model_localisation_zone->getZone($this->request->post['zone_id']);
$subject = 'New Customer Registration: ' . $this->request->post['firstname'] . ' ' . $this->request->post['lastname'];
$message = 'A new customer just registered at ' . $this->config->get('config_name') . '.' . "\n\n";
$message .= 'First Name: ' . $this->request->post['firstname'] . "\n";
$message .= 'Last Name: ' . $this->request->post['lastname'] . "\n";
$message .= 'E-Mail: ' . $this->request->post['email'] . "\n";
$message .= 'Phone: ' . $this->request->post['telephone'] . "\n";
$message .= 'Fax: ' . $this->request->post['fax'] . "\n";
$message .= 'Company: ' . $this->request->post['company'] . "\n";
$message .= 'Address 1: ' . $this->request->post['address_1'] . "\n";
$message .= 'Address 2: ' . $this->request->post['address_2'] . "\n";
$message .= 'City: ' . $this->request->post['city'] . "\n";
$message .= 'Region/State: ' . $zone['name'] . "\n";
$message .= 'Post Code: ' . $this->request->post['postcode'] . "\n";
$message .= 'Country: ' . $country['name'] . "\n";
$message .= ($this->request->post['newsletter']) ? 'Newsletter: Yes' : 'Newsletter: No';
$mail->setSubject($subject);
$mail->setText(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));
$mail->setTo($this->config->get('config_email'));
$mail->send();
Re: [MOD] Send Alert Email when a new user has registered?
Posted: Wed Sep 22, 2010 1:17 am
by Joxe
That would be nice but in the order email

Anyway, good work!
Re: [MOD] Send Alert Email when a new user has registered?
Posted: Wed Sep 22, 2010 1:58 am
by i2Paq
Nice job, thanks!
It would be even better if it was multilingual

Re: [MOD] Send Alert Email when a new user has registered?
Posted: Mon Nov 08, 2010 2:35 pm
by joash
Hi all,
I was tried to used "d7a7z7e7d" method, but it only works twice. And after all, I can't get any notification/alert on my email again. It's very odd, because I never change the script anymore, and when I check on the server, it still the same.
Anybody have the same problem with me? or any suggestion? please help me..

Thank you
Re: [MOD] Send Alert Email when a new user has registered?
Posted: Mon Nov 08, 2010 3:19 pm
by joash
for additional information:
when customer order, I can get order's notification.
But when customer using "contact us" form, it's not working "(
anybody can help me?
thank you so much..