Page 1 of 2

Order Return Email Notification Not Working

Posted: Wed Jul 11, 2018 7:39 pm
by vaidyamanishjoshi
I am using version 3.0.2.0
All email notifications working perfectly... BUT

1. When customer book Order Return, No email is triggered to customer and admin
2. When return order status history is updated with Notify Customer, No email is sent...

What can be solution for this ?

Re: Order Return Email Notification Not Working

Posted: Wed Jul 11, 2018 7:47 pm
by straightlight
What can be solution for this ?
In admin - > extensions - > events, do you see at least 33 events?

In admin - > systems - > settings - > edit settings - > mail tab, at the bottom, are the checkbox options selected? On the top of that tab, are your email settings properly configured?

Re: Order Return Email Notification Not Working

Posted: Wed Jul 11, 2018 7:55 pm
by vaidyamanishjoshi
straightlight wrote:
Wed Jul 11, 2018 7:47 pm
What can be solution for this ?
In admin - > extensions - > events, do you see at least 33 events?

In admin - > systems - > settings - > edit settings - > mail tab, at the bottom, are the checkbox options selected? On the top of that tab, are your email settings properly configured?
Yes,
1. There are 33 events are seen...and all are enabled.

2. Checkboxes are selected, email setting is also configured properly.. (other emails lie Order Status update etc are working...)

Re: Order Return Email Notification Not Working

Posted: Wed Jul 11, 2018 8:15 pm
by straightlight
Ensure your file logs option is enabled in your admin - > systems - > settings - > edit settings - > server tab. Then, in admin/controller/mail/return.php file,

find:

Code: Select all

if (isset($args[3])) {
			$notify = $args[3];
		} else {
			$notify = '';
		}		
add below:

Code: Select all

$this->log->write('Return Mail Log Notification: ' . htmlspecialchars_decode($notify));
Then, find:

Code: Select all

$mail->send();
add below:

Code: Select all

$this->log->write('Return Mail Log Event: ' . var_dump($mail));
Retry the return again in your admin. Then, check your OC error logs for a line beginning with: Return Mail Notification and: Return Mail Log Event . Do you see them?

Re: Order Return Email Notification Not Working

Posted: Wed Jul 11, 2018 9:00 pm
by vaidyamanishjoshi
Retry the return again in your admin. Then, check your OC error logs for a line beginning with: Return Mail Notification and: Return Mail Log Event . Do you see them?
I have made changes as per your suggestion and tried... But nothing is shown in error log file....

Re: Order Return Email Notification Not Working

Posted: Wed Jul 11, 2018 9:13 pm
by straightlight
Are your logs enabled from the admin settings?

Re: Order Return Email Notification Not Working

Posted: Wed Jul 11, 2018 9:21 pm
by vaidyamanishjoshi
straightlight wrote:
Wed Jul 11, 2018 9:13 pm
Are your logs enabled from the admin settings?
Yes, It is enabled....

Re: Order Return Email Notification Not Working

Posted: Wed Jul 11, 2018 10:14 pm
by straightlight
Let's run a cache test. From admin/controller/common/dashboard.php file,

find:

Code: Select all

$data['footer'] = $this->load->controller('common/footer');
add below:

Code: Select all

echo 'test123';
Then, save the file. Go to your admin dashboard. On the top-left of the page, do you see the test123 word? Also in the admin OC error log table, are you able to see other log entries or it's completely empty?

Re: Order Return Email Notification Not Working

Posted: Wed Jul 11, 2018 10:33 pm
by vaidyamanishjoshi
straightlight wrote:
Wed Jul 11, 2018 10:14 pm
Let's run a cache test. From admin/controller/common/dashboard.php file,


Yes Test123 is echoed properly
Log file is not totally empty...some errors with last 8 day's date are seen...And that errors are now sorted out by me..

Re: Order Return Email Notification Not Working

Posted: Wed Jul 11, 2018 10:49 pm
by straightlight
Clear your error logs by using the clear button on the top right of the error logs page and try the return action again. Then, see if the new messages appears in the error logs afterwards.

Re: Order Return Email Notification Not Working

Posted: Wed Jul 11, 2018 10:56 pm
by vaidyamanishjoshi
straightlight wrote:
Wed Jul 11, 2018 10:49 pm
Clear your error logs by using the clear button on the top right of the error logs page and try the return action again. Then, see if the new messages appears in the error logs afterwards.
Hmm...Tried... But till same issue....
No EMail Triggered,
Error log is empty

Re: Order Return Email Notification Not Working

Posted: Wed Jul 11, 2018 11:50 pm
by straightlight
Back in the same dashboard.php file, below:

Code: Select all

$data['footer'] = $this->load->controller('common/footer');
add:

Code: Select all

$this->log->write('Test123');
Go back to the Dashboard page afterwards. Then, go to the OC error logs page. Do you see the: Test123 message?

Re: Order Return Email Notification Not Working

Posted: Wed Jul 11, 2018 11:56 pm
by straightlight
Issue already reported and resolved on GitHub: https://github.com/opencart/opencart/co ... 12275c286b . Try this solution (admin/controller/mail/return.php file only). Not to forget to do these steps afterwards before retrying the return action: viewtopic.php?f=176&p=728050#p718325

Re: Order Return Email Notification Not Working

Posted: Thu Jul 12, 2018 12:13 am
by vaidyamanishjoshi
straightlight wrote:
Wed Jul 11, 2018 11:56 pm
Issue already reported and resolved on GitHub: https://github.com/opencart/opencart/co ... 12275c286b . Try this solution (admin/controller/mail/return.php file only). Not to forget to do these steps afterwards before retrying the return action: viewtopic.php?f=176&p=728050#p718325
Ohh... Okk

Thank you for kind support

Re: Order Return Email Notification Not Working

Posted: Fri Dec 07, 2018 4:47 am
by opencart-templates
Check the event trigger for admin_mail_return just fixed an issue similar where the trigger was: admin/model/sale/return/addReturn/after

Run this SQL query to fix:

Code: Select all

UPDATE `oc_event` SET `trigger` = 'admin/model/sale/return/addReturnHistory/after' WHERE `code` = 'admin_mail_return'

Re: Order Return Email Notification Not Working

Posted: Tue Jun 18, 2019 6:35 pm
by julian70400
Hello,

I just tryed this SQL request, now I have admin_mail_return with :
Déclenchement
admin/model/sale/return/addReturnHistory/after
Action
mail/return

But still no mail received. Am I missing something ? I am currently running OC 3.0.2.0 as the original author.

Mail server part is correctly set, because I receive other mails, but still not alert when a return is open.

Thanks for your help !

Re: Order Return Email Notification Not Working

Posted: Tue Jun 18, 2019 8:14 pm
by straightlight
Check your admin - > extensions - > events to see if this event you've updated is listed and active. Also check your admin - > systems - > settings - > edit settings - > mail tab (bottom).

Re: Order Return Email Notification Not Working

Posted: Thu Jun 20, 2019 2:59 am
by fegdeed

Re: Order Return Email Notification Not Working

Posted: Wed Jul 01, 2020 10:52 pm
by Zanato
opencart-templates wrote:
Fri Dec 07, 2018 4:47 am
Check the event trigger for admin_mail_return just fixed an issue similar where the trigger was: admin/model/sale/return/addReturn/after

Run this SQL query to fix:

Code: Select all

UPDATE `oc_event` SET `trigger` = 'admin/model/sale/return/addReturnHistory/after' WHERE `code` = 'admin_mail_return'
Unbelievably Rather typically, three years later and 5 versions on, this bug is still in 3.0.3.3.

I wish Opencart was better :-\

Re: Order Return Email Notification Not Working

Posted: Sat Jul 11, 2020 7:11 pm
by answersun
fegdeed wrote:
Thu Jun 20, 2019 2:59 am
Try the extension in this link https://www.opencart.com/index.php?rout ... load_id=55.
I have tried both above mentioned fixes and the extension, none of them worked. Has any of you got the issue resolved? @vaidyamanishjoshi, @julian70400

Opencart 3.0.2.0