Page 1 of 1

[SOLVED] Mail alert on customer's "Address book" management

Posted: Fri Feb 03, 2012 8:08 pm
by angelo
Hi there,
How could I manage to get an email alert when a customer instert/edit/or delete entries from his addresses?

---
I'm trying to add this code

Code: Select all

                $mail = new Mail(); 
                $mail->protocol = $this->config->get('config_mail_protocol');
                $mail->parameter = $this->config->get('config_mail_parameter');
                $mail->hostname = $this->config->get('config_smtp_host');
                $mail->username = $this->config->get('config_smtp_username');
                $mail->password = $this->config->get('config_smtp_password');
                $mail->port = $this->config->get('config_smtp_port');
                $mail->timeout = $this->config->get('config_smtp_timeout');
                $mail->setTo($this->config->get('config_email'));
                $mail->setFrom($this->config->get('config_email'));
                $mail->setSender($this->config->get('config_name'));
                $mail->setSubject("One of the customers has just added a new address");
                $mail->setText($text);
                $mail->send();
to catalog/model/account/addess (in the insert method) but I get an error on the $mail->send(); (the page executes if i comment that line).

Any clue?
Thanks

Re: Mail alert on customer's "Address book" management

Posted: Fri Feb 03, 2012 8:52 pm
by angelo
Taking a look at this:
http://forum.opencart.com/viewtopic.php?f=20&t=37588
it seems that adding the Mail code is enough to do the trick... now, why my $mail->send(); generate an error???

P.S. All other notifications work!!!

Re: Mail alert on customer's "Address book" management

Posted: Fri Feb 03, 2012 10:14 pm
by angelo
Don't mind... there where few errors and I always forget the error log feature!!!

Thanks anyway