Emails for product returns are not working as expected - When attempting to communicate the status of sales returns to the customer I track it through the "return history". However when I check the "notify customer" box, the Email fails to send.
Is there a workaround for this? I would very much like to use this OC feature.
TIA
Is your email form properly set-up in your OC admin - > systems - > settings - > add / edit setitngs - > Mail tab?
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
All events are enabled on the events page and my email is set-up correctly in OC admin (it works perfectly when I check the similar "notify customer" for order-status). I think this is a known glitch... just wondering if anyone knew of a workaround for V3.0.3.2?
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Unfortunately, I would have to agree on that one - at least based on the core's perspective - especially due to the COVID-19 situation. Many customers may want to find a way to return their products from the store which, sadly, there are still some bugs needed to be fixed. I do, however, encourage to keep an opened door to your contact us page in case major incidents are reported to you regarding the returned products until the issue being resolved.smith_ka wrote: ↑Sun Apr 19, 2020 5:31 amOK thanks, I'll keep my eyes peeled in case anything pops up and also see if I can use any of the older version fixes. At least I can tweak the "order history" email notifications to use for returns in the interim. It just seems a shame to have such a useful functionality and not be able to use it
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
should be admin/model/sale/return/addReturnHistory/after
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.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Vague. More info.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Hi,
I am using Opencart 3.0.3.6 and all my events(47) on extensions page are in enabled format. But still there is no email is being triggered during return activity. How can I make it active so I and customer may receive email every time there is a return activity?
Here is the link for all events that are enabled in my system: https://ibb.co/YkpXB8x
Best Regards,
Caglayan
So in phpmyadmin go to oc_event and find the event code called admin_mail_return then change the trigger from
Code: Select all
admin/model/sale/return/addReturn/after
Code: Select all
admin/model/sale/return/addReturnHistory/after
https://github.com/opencart/opencart/issues/6074
Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!
Hi,sw!tch wrote: ↑Tue Feb 16, 2021 8:44 amYou have to fix the event.
So in phpmyadmin go to oc_event and find the event code called admin_mail_return then change the trigger from
toCode: Select all
admin/model/sale/return/addReturn/after
https://github.com/condor2/opencart/com ... d80309b232Code: Select all
admin/model/sale/return/addReturnHistory/after
https://github.com/opencart/opencart/issues/6074
So far I have done this and did a test. I have returned a product from dummy customer and also added history to that return request in admin consol by notifying customer as well. No email has been sent so far. Do you know why it is not being triggered any email at all?
SS:https://ibb.co/brMnBC8
Best Regards,
Caglayan
Check your error logs (PHP error log and Opencart error log).caglayanadiguzel wrote: ↑Tue Feb 16, 2021 10:42 amDo you know why it is not being triggered any email at all?
Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!
I have checked both and there is nothing regarding with that I assume. What I expect is that when there is a return request, as an admin I should receive an email. Does this meant to happen? Below is the ss from both php error log as well as open cart error log.sw!tch wrote: ↑Tue Feb 16, 2021 11:00 amCheck your error logs (PHP error log and Opencart error log).caglayanadiguzel wrote: ↑Tue Feb 16, 2021 10:42 amDo you know why it is not being triggered any email at all?
SS: https://ibb.co/PNqSrjM
The return history notification only goes to the customer by default. You can however modify the event a bit if you wanted to send a copy to the admin as well.caglayanadiguzel wrote: ↑Tue Feb 16, 2021 11:18 amWhat I expect is that when there is a return request, as an admin I should receive an email. Does this meant to happen?
Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!
Code: Select all
<?php
class ControllerMailReturn extends Controller {
public function index($route, $args, $output) {
if (isset($args[0])) {
$return_id = $args[0];
} else {
$return_id = '';
}
if (isset($args[1])) {
$return_status_id = $args[1];
} else {
$return_status_id = '';
}
if (isset($args[2])) {
$comment = $args[2];
} else {
$comment = '';
}
if (isset($args[3])) {
$notify = $args[3];
} else {
$notify = '';
}
if ($notify) {
$this->load->model('sale/return');
$return_info = $this->model_sale_return->getReturn($return_id);
if ($return_info) {
$this->load->language('mail/return');
$data['return_id'] = $return_id;
$data['date_added'] = date($this->language->get('date_format_short'), strtotime($return_info['date_modified']));
$data['return_status'] = $return_info['return_status'];
$data['comment'] = strip_tags(html_entity_decode($comment, ENT_QUOTES, 'UTF-8'));
$mail = new Mail($this->config->get('config_mail_engine'));
$mail->parameter = $this->config->get('config_mail_parameter');
$mail->smtp_hostname = $this->config->get('config_mail_smtp_hostname');
$mail->smtp_username = $this->config->get('config_mail_smtp_username');
$mail->smtp_password = html_entity_decode($this->config->get('config_mail_smtp_password'), ENT_QUOTES, 'UTF-8');
$mail->smtp_port = $this->config->get('config_mail_smtp_port');
$mail->smtp_timeout = $this->config->get('config_mail_smtp_timeout');
$mail->setTo($return_info['email']);
$mail->setFrom($this->config->get('config_email'));
$mail->setSender(html_entity_decode($this->config->get('config_name'), ENT_QUOTES, 'UTF-8'));
$mail->setSubject(sprintf($this->language->get('text_subject'), html_entity_decode($this->config->get('config_name'), ENT_QUOTES, 'UTF-8'), $return_id));
$mail->setText($this->load->view('mail/return', $data));
$mail->send();
}
}
}
}
admin/controller/mail/return.phpcaglayanadiguzel wrote: ↑Tue Feb 16, 2021 11:54 amAny help on how to modify it to get it also sent for admin would be appreciated
After
Code: Select all
$mail->send();
Code: Select all
$mail->setTo($this->config->get('config_email'));
$mail->send();
https://github.com/opencart/opencart/wi ... ion-System
-
Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!
Return controller from admin is only to send email to customers when site admin edit a Return and update a status. As per message is the customer message
Code: Select all
// Text
$_['text_subject'] = '%s - Return Update %s';
$_['text_return_id'] = 'Return ID:';
$_['text_date_added'] = 'Return Date:';
$_['text_return_status'] = 'Your return has been updated to the following status:';
$_['text_comment'] = 'The comments for your return are:';
$_['text_footer'] = 'Please reply to this email if you have any questions.';
And based on @sw!tch modification you will never receive email as admin...when a customer make a return.
Because of notify function you will receive email as admin, only when check notify option...but is too late, because return is registered in database already. So you need to keep an eye on Returns from admin.
A catalog controller should be created....for admin notification.
Attachments
return.png (23.28 KiB) Viewed 3241 times
Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer
Right, There is no mail sent from the frontend when a customer initiates a return by default.xxvirusxx wrote: ↑Tue Feb 16, 2021 3:04 pmAnd based on @sw!tch modification you will never receive email as admin...when a customer make a return.
Because of notify function you will receive email as admin, only when check notify option...but is too late, because return is registered in database already.
The above is only for the backend return history. If you want a party to be notified you need to have notify checked.
If you want a simple "admin return alert notice" sent from the frontend when a custom fills out a return, then an event can be made to handle that in few lines of code.
Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!
Users browsing this forum: No registered users and 97 guests