Post by fairmount » Sat May 26, 2012 1:08 pm

Hi,

How can we send email to customer as soon as they file a returns request. I just want to send a standard courtesy email saying that we will be in touch with you shortly. I know that an email will be sent once we update the status, but I want to send an email straight away, automatically.

I have found a thread where an email is being sent to admin when a request is raised, but nothing to send to the customer here. http://forum.opencart.com/viewtopic.php ... 88#p181143.

Thanks.
FM.
Last edited by fairmount on Sat May 26, 2012 2:23 pm, edited 1 time in total.

Newbie

Posts

Joined
Fri Apr 20, 2012 11:42 am

Post by Avvici » Sat May 26, 2012 1:31 pm

I made amendments for you. Just add this exactly where it said to add it on that other thread.:

Code: Select all

//Start admin email
			$message ="<strong>You have a product return waiting.</strong><br><br>"
               .'<a href="http://YOURWEBSITE.COM/ADMIN">Login to review</a>';
         
               $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("YOUREMAIL@mail.com");
               $mail->setSender("SENDER NAME HERE");
               $mail->setSubject("A Return Has Been Requested");
               $mail->setHtml($message);
               $mail->send();
			
			//End admin email
			
			//Start customer email
			   $message_customer ="Your return has been submitted and is awaiting approval. Thanks!";
               $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->request->post['email']);
               $mail->setFrom("YOUREMAIL@mail.com");
               $mail->setSender("SENDER NAME HERE");
               $mail->setSubject("A Return Has Been Requested");
               $mail->setHtml($message_customer);
               $mail->send();
			
			
			//End Customer email

User avatar
Expert Member

Posts

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

Post by fairmount » Sat May 26, 2012 2:17 pm

Thanks for the quick response Avvici. That works like a charm. You are a star

Regards,
FM

Newbie

Posts

Joined
Fri Apr 20, 2012 11:42 am

Post by Rio1987 » Mon May 28, 2012 7:09 pm

Hi,

How to change the code?

And where should I change the code?

Thank you

Newbie

Posts

Joined
Mon May 28, 2012 12:14 pm

Post by Avvici » Mon May 28, 2012 8:24 pm


User avatar
Expert Member

Posts

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

Post by storm-cloud » Fri Jun 08, 2012 3:54 pm

avvici wrote:I made amendments for you. Just add this exactly where it said to add it on that other thread.:
Hello Avvici,

Does this work with OC v1.5.1.3?

I have tried to install this through vQmod but I am receiving this error:

Notice: Undefined index: email in /home/xxx/public_html/vqmod/vqcache/vq2-catalog_controller_account_return.php on line 355Notice: Error: E-Mail to required! in /home/xxx/public_html/system/library/mail.php on line 58

I believe I modified the code correctly. I have inserted our e-mail address in both instances of the setFrom field and also our store name in both instances of the setSender field. Is this correct?

Active Member

Posts

Joined
Wed Feb 22, 2012 8:07 am

Post by Avvici » Fri Jun 08, 2012 9:06 pm

Should work fine. It's the same variable(s)

User avatar
Expert Member

Posts

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

Users browsing this forum: Bing [Bot] and 73 guests