Post by ozmartell » Wed Apr 08, 2015 4:14 pm

Hi,

When a customer registers a new account, and if the System->Settings->Options->New Account Alert Email is on, then I consistently get a failed screen as the response, instead of the success screen.

The failed screen reads:

Notice: Error: E-Mail to required! in xxxx/system/library/mail.php on line 61

(I have replaced the actual www var path in my case with xxxx)

This error occurs in OC 2.0.2.0.
It does NOT occur in 2.0.0.0. so I suspect some regression.

I have traced the issue to xxxx/catalog/model/account/customer.php and it is missing the code to set the TO:, FROM: and SENDER: fields in the section where it sends an alert/system admin email on new accounts added.

(disclaimer...I'm no php/OC pro...I'm setting up a store, living on the bleeding edge and this was a lot of work to trace this! So if I've posted this in the wrong place, sorry. And I DID look through the errors here and check the GIT code looking to see if it was an issue (and googled!), and couldn't find any other reference)

So it suggests to me that nobody is using this feature? I did confirm that despite the error, customer accounts are still created. In my case because I require all my new wholesale accounts to be approved, I rely on the emails so I don't need to be watching the dashboard for pending customers each day.

So it could be that many shops are having this error, but the customer don't mention it.

I hope this helps... ;)

Newbie

Posts

Joined
Wed Apr 08, 2015 3:52 pm

Post by thbr02 » Thu Apr 09, 2015 3:17 am

I get exactly the same error using Opencart 2.0.2.2. Hope someone can help me solve this error.

Active Member

Posts

Joined
Wed Jun 22, 2011 10:30 pm
Location - Sweden

Post by thbr02 » Thu Apr 09, 2015 3:40 am

I found a bugfix at Github which solved the error.
https://github.com/opencart/opencart/co ... 94234c2837

Active Member

Posts

Joined
Wed Jun 22, 2011 10:30 pm
Location - Sweden

Post by itzikd1 » Thu Apr 09, 2015 4:03 am

doesnt work.

hope for a solution soon as well thanks!

New member

Posts

Joined
Sat Nov 08, 2014 2:12 am

Post by thbr02 » Thu Apr 09, 2015 4:30 am

itzikd1 wrote:doesnt work.

hope for a solution soon as well thanks!
Try to delete the lines marked whith red and add the line marked with green at your catalog/model/account/customer.php.

Active Member

Posts

Joined
Wed Jun 22, 2011 10:30 pm
Location - Sweden

Post by mihaiachim » Thu Apr 09, 2015 10:10 pm

Is working on my case thanks a lot again
I have Opencart 2.0.2.0

Newbie

Posts

Joined
Thu Apr 09, 2015 7:56 pm

Post by MasterRipper » Thu Apr 30, 2015 12:01 am

I'm having the same problem, and used to link to the error log.

I changed customer.php and it looks like this

$mail = new Mail();
$mail->protocol = $this->config->get('config_mail_protocol');
$mail->parameter = $this->config->get('config_mail_parameter');
$mail->smtp_hostname = $this->config->get('config_mail_smtp_host');
$mail->smtp_username = $this->config->get('config_mail_smtp_username');
$mail->smtp_password = html_entity_decode($this->config->get('config_mail_smtp_password'), ENT_QUOTES, 'UTF-8');
$mail->smtp_port = $this->config->get('config_mail_smtp_port');
$mail->smtp_timeout = $this->config->get('config_mail_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($subject);
$mail->setText($message);
$mail->send();

Is it right or wrong as there is now another error :(

Notice: Error: E-Mail to required! in /public_html/system/library/mail.php on line 61

Newbie

Posts

Joined
Tue Apr 14, 2015 1:53 pm

Post by MasterRipper » Thu Apr 30, 2015 12:26 am

I managed to solve the problem :)

In the section
if ($this->config->get('config_account_mail')) {

I had to add SetFrom and SetSender sections as below

$mail->setTo($this->config->get('config_email'));
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($this->config->get('config_name'));
$mail->setSubject($this->language->get('text_new_customer'));
$mail->setText($message);
$mail->send();

Newbie

Posts

Joined
Tue Apr 14, 2015 1:53 pm
Who is online

Users browsing this forum: No registered users and 11 guests