Post by dave310 » Wed Apr 25, 2012 5:32 pm

Hi,

my client does not want registration email to be sent to users

how can it be stopped?

OC 1.5.2.1

New member

Posts

Joined
Fri Mar 23, 2012 5:47 pm

Post by Avvici » Wed Apr 25, 2012 5:40 pm

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(); */

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC

Post by dave310 » Thu Apr 26, 2012 2:08 am

THANKS!

New member

Posts

Joined
Fri Mar 23, 2012 5:47 pm

Post by andriuspp » Mon Jan 19, 2015 2:49 am

can anyone help how to do this on opencart 2.0 version? I comment that part of code, but user still receive email.

Newbie

Posts

Joined
Thu Nov 27, 2014 9:41 pm

Post by williamhazel » Tue Mar 29, 2016 1:01 pm

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.

Newbie

Posts

Joined
Tue Mar 29, 2016 12:57 pm

Post by beebee » Fri Jun 10, 2016 3:46 am

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:

Code: Select all

$mail->setTo($data['email']);
??
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

BeeBee
When the going gets weird, the weird turn Pro!!


User avatar
New member

Posts

Joined
Thu May 12, 2016 5:13 pm
Who is online

Users browsing this forum: No registered users and 61 guests