Post by andying123 » Thu Jan 16, 2020 6:24 pm

Hi Support.

My Opencart version is 3.0.3.2. I need your help about the Order confirmation email editing

1. I would like to add a "disclaimer text" on the bottom of the order confirmation email template.
However I try edit the "order_add.twig" file ( location: /catalog/view/theme/default/template/mail/) and put the <p> text</p> tag there but the system got no response of my changes and still showing the original confirmation email.

2. The order alert email too simpler to the shop owner, I want to have the same copy of the "order confirmation" as the customer received.
I edited the file "order_alert.twig" ( location: /catalog/view/theme/default/template/mail/), copy and page the same code as the "order_add.twig".
Unfortunately, the alert email content became the raw html code.

I would appreciate if you can help to solve those issues for me at your early convenience.

Many Thanks,

Andy

Newbie

Posts

Joined
Sun Nov 04, 2012 11:19 pm

Post by letxobnav » Thu Jan 16, 2020 7:43 pm

1) you may need to clear your theme cache.
2) order alert mails are send as text mail, not html mail so if you put html in there, it will show the markup.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by andying123 » Fri Jan 17, 2020 7:43 am

Hi Support
1. I just followed your advise and cleared the "theme cache" - it works now! Thanks
2. If the "order_alert" only support the plain text, any solution I can get a copy of the "order confirmation" mail which same as customer received?

Best Regards,
Andy

Newbie

Posts

Joined
Sun Nov 04, 2012 11:19 pm

Post by sw!tch » Fri Jan 17, 2020 8:48 am

andying123 wrote:
Fri Jan 17, 2020 7:43 am
2. If the "order_alert" only support the plain text, any solution I can get a copy of the "order confirmation" mail which same as customer received?
The easiest way without creating a new event or implementing all the logic is to just copy the order email to you.

You can try the below if you want.

catalog/controller/mail/order.php
Find these lines in the public function add method. (around line 278)

Code: Select all

$mail->setHtml($this->load->view('mail/order_add', $data));
$mail->send();
Add AFTER

Code: Select all

// Also send this email to the Store Owner
$mail->setTo($this->config->get('config_email'));
$mail->send();
So your final result should look like this.

Code: Select all

$mail->setHtml($this->load->view('mail/order_add', $data));
$mail->send();

// Also send this email to the Store Owner
$mail->setTo($this->config->get('config_email'));
$mail->send();
This should also send it to the store owner email. Keep in mind some service providers throttle the amount of mail you can send at once, so if it throws an error, that's possibly the reason.

Untested - Backup and try at your own risk.

Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by andying123 » Fri Jan 17, 2020 7:11 pm

It works! Thanks for the help O0

Newbie

Posts

Joined
Sun Nov 04, 2012 11:19 pm

Post by iplocker » Sun Aug 30, 2020 6:10 pm

Hello.
How about have the option to order_alert.twig send html code like order_add.twig ???
So copy paste the content of the order_add to order_alert should work .

PS. Useful extension: https://www.opencart.com/index.php?rout ... n_id=35844
Thanks

Active Member

Posts

Joined
Sun May 26, 2013 6:39 pm


Post by Gordo111 » Mon Sep 21, 2020 5:50 am

sw!tch wrote:
Fri Jan 17, 2020 8:48 am
andying123 wrote:
Fri Jan 17, 2020 7:43 am
2. If the "order_alert" only support the plain text, any solution I can get a copy of the "order confirmation" mail which same as customer received?
The easiest way without creating a new event or implementing all the logic is to just copy the order email to you.

You can try the below if you want.

catalog/controller/mail/order.php
Find these lines in the public function add method. (around line 278)

Code: Select all

$mail->setHtml($this->load->view('mail/order_add', $data));
$mail->send();
Add AFTER

Code: Select all

// Also send this email to the Store Owner
$mail->setTo($this->config->get('config_email'));
$mail->send();
So your final result should look like this.

Code: Select all

$mail->setHtml($this->load->view('mail/order_add', $data));
$mail->send();

// Also send this email to the Store Owner
$mail->setTo($this->config->get('config_email'));
$mail->send();
This should also send it to the store owner email. Keep in mind some service providers throttle the amount of mail you can send at once, so if it throws an error, that's possibly the reason.

Untested - Backup and try at your own risk.
This works perfectly!!!
It's wonderfully simple and does the job. For anyone still following this thread, if you want to stop getting 2 emails whenever an order is placed then simply go into your opencart admin, "System->Settings->Mail
Scroll to "Mail Alerts"
Untick the "Orders" in the "Alert Email" area.

No need to load an extension or trawl through loads of code. This has been a massive help.
Thank you!!!

oh and I'm using OC 3.0.3.3 in case that makes any difference.

New member

Posts

Joined
Wed May 06, 2020 11:59 pm

Post by ronnieb » Sun Dec 20, 2020 6:21 am

Following on from this

How do I get the comments to show.
The duplicate Admin email misses them out ? version 3.0.3.6

New member

Posts

Joined
Tue May 24, 2011 3:44 pm

Post by by mona » Sun Dec 20, 2020 8:35 am


DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by sw!tch » Sun Dec 20, 2020 8:43 am

ronnieb wrote:
Sun Dec 20, 2020 6:21 am
Following on from this

How do I get the comments to show.
The duplicate Admin email misses them out ? version 3.0.3.6
Comments to customers expect notify to be set from addOrderHistory.

If you require additional functionality try the linked extensions or just write a separate event to handle it. There are ways around it, but then this simple solution becomes sloppy.

Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by alejandroalcala » Sat Feb 13, 2021 6:07 am

This topic was very useful for me.
In Open Cart 3.0.3.6 works fine.
A little mod in PHP file that change everyting (Admin Side).
Easy to find, insert the code, save, upload and voilá.

THANKS.


Posts

Joined
Tue Jun 23, 2020 2:27 pm

Post by kirkhall » Sun Feb 14, 2021 2:45 am

Word for word, exact same question asked at viewtopic.php?f=202&t=222498

mikeinterserv attached an OCMOD to do same FYI.

Active Member

Posts

Joined
Thu May 22, 2014 11:31 am
Who is online

Users browsing this forum: Majestic-12 [Bot], nonnedelectari and 67 guests