Page 1 of 1
Disable registration success email
Posted: Wed Apr 25, 2012 5:32 pm
by dave310
Hi,
my client does not want registration email to be sent to users
how can it be stopped?
OC 1.5.2.1
Re: Disable registration success email
Posted: Wed Apr 25, 2012 5:40 pm
by Avvici
Open up catalog/model/account/customer.php
In the function addCustomer which is the function at the very top, find this chunk of code:
Find this line:
Code: Select all
$subject = sprintf($this->language->get('text_subject'), $this->config->get('config_name'));
$message = sprintf($this->language->get('text_welcome'), $this->config->get('config_name')) . "\n\n";
if (!$this->config->get('config_customer_approval')) {
$message .= $this->language->get('text_login') . "\n";
} else {
$message .= $this->language->get('text_approval') . "\n";
}
$message .= $this->url->link('account/login', '', 'SSL') . "\n\n";
$message .= $this->language->get('text_services') . "\n\n";
$message .= $this->language->get('text_thanks') . "\n";
$message .= $this->config->get('config_name');
$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($data['email']);
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($this->config->get('config_name'));
$mail->setSubject(html_entity_decode($subject, ENT_QUOTES, 'UTF-8'));
$mail->setText(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));
$mail->send();
You can choose to comment out the entire block, or just the line that reads $mail->send(); I would comment out the entire block.
Code: Select all
/*$subject = sprintf($this->language->get('text_subject'), $this->config->get('config_name'));
$message = sprintf($this->language->get('text_welcome'), $this->config->get('config_name')) . "\n\n";
if (!$this->config->get('config_customer_approval')) {
$message .= $this->language->get('text_login') . "\n";
} else {
$message .= $this->language->get('text_approval') . "\n";
}
$message .= $this->url->link('account/login', '', 'SSL') . "\n\n";
$message .= $this->language->get('text_services') . "\n\n";
$message .= $this->language->get('text_thanks') . "\n";
$message .= $this->config->get('config_name');
$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($data['email']);
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($this->config->get('config_name'));
$mail->setSubject(html_entity_decode($subject, ENT_QUOTES, 'UTF-8'));
$mail->setText(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));
$mail->send(); */
Re: Disable registration success email
Posted: Thu Apr 26, 2012 2:08 am
by dave310
THANKS!
Re: Disable registration success email
Posted: Mon Jan 19, 2015 2:49 am
by andriuspp
can anyone help how to do this on opencart 2.0 version? I comment that part of code, but user still receive email.
Re: Disable registration success email
Posted: Tue Mar 29, 2016 1:01 pm
by williamhazel
can anyone help how to do this on opencart 2.0 version?
Confirmed this worked in Opencart 2.2.0.0
Use /* and */ at the beginning of lines 26 and 56.
Re: Disable registration success email
Posted: Fri Jun 10, 2016 3:46 am
by beebee
williamhazel wrote:can anyone help how to do this on opencart 2.0 version?
Confirmed this worked in Opencart 2.2.0.0
Use /* and */ at the beginning of lines 26 and 56.
Hello Williamhazel,
I couldn't get it to work by commenting on the entire code and I'm trying to see if I did it right.
When you say line 26, are you referring to :
Code: Select all
$subject = sprintf($this->language->get('text_subject'), html_entity_decode($this->config->get('config_name'), ENT_QUOTES, 'UTF-8'));
and line 56:
??
Your help is much appreciated. I'm trying to disabling the default registration confirmation email as I'm using an Email Verification extension.
Thanks,
B