Wairds Posted March 9, 2018 Share Posted March 9, 2018 When an order is placed three emails are generated. The customer receives a 'Thank you for your order' and an Order Confirmation and the shop owner receives a New Order notification. It is an intermittent problem but with increasing frequency these emails are sitting in the email log with an 'x' against them. When I press the Resend they are sent without a problem. I have contacted my hosting company and they cant find any trace. Can somebody advise where I could look to diagnose the problem? Many thanks. Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 10, 2018 Share Posted March 10, 2018 We can add some code to your installation of CubeCart that will log the "failure reason" if the email fails to send. Would you be interested? Quote Link to comment Share on other sites More sharing options...
Wairds Posted March 10, 2018 Author Share Posted March 10, 2018 Bsmither, Thanks for getting back to me. I would most certainly be interested. Thank you. Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 10, 2018 Share Posted March 10, 2018 Please experiment with these edits (line numbers refer to CC6113): In the admin skin template statistics.emaillog.php Find near line 30: <td align="center">{if $log.result==1}<i class="fa fa-check" title="{$LANG.common.yes}"></i>{else}<i class="fa fa-times" title="{$LANG.common.no}"></i>{/if}</td> Change to: <td align="center">{if $log.result==1}<i class="fa fa-check" title="{$LANG.common.yes}"></i>{else}<i class="fa fa-times" title="{$log.fail_reason}"></i>{/if}</td> Using an external database utility such as phpMyAdmin, make the following change to CubeCart's database: ALTER TABLE `CubeCart_email_log` ADD COLUMN `fail_reason` TEXT; (If your database uses a table prefix, be sure to include it in the name of the table.) In /classes/mailer.class.php, find near line 215: $email_data = array( 'subject' => $this->Subject, 'content_html' => $this->_html, 'content_text' => $this->_text, 'to' => $email, 'from' => $this->Sender, 'result' => $result, 'email_content_id' => $this->_email_content_id ); On a new blank line after that, add: if ($result === false) $email_data['fail_reason'] = htmlentities($this->ErrorInfo, ENT_QUOTES); This will log the reason the Mailer has determined to be the cause of a failed send. In admin, Email Log, by hovering the mouse cursor over the 'X' in the Sent column, your browser should show (as a 'tooltip') the reason reported. (I do not know if there is a limit to the amount of information that can be shown in a tooltip.) Quote Link to comment Share on other sites More sharing options...
Wairds Posted March 11, 2018 Author Share Posted March 11, 2018 Bsmither, Many thanks for your efforts on my behalf. I am now confident I will be able to identify the issue. Regards. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.