0

I have this very strange problem regarding the sending of the shipping confirmation email.

The cron task sales_send_order_shipment_emails kept failing, so I looked at the logs and I have this:

[2020-03-20 07:07:05] main.ERROR: Cron Job sales_send_order_shipment_emails has an error: Call to undefined method ArrayIterator::setType(). Statistics: {"sum":0,"count":1,"realmem":0,"emalloc":0,"realmem_start":190214144,"emalloc_start":172675232} [] []
[2020-03-20 07:07:05] main.CRITICAL: Error when running a cron job {"exception":"[object] (RuntimeException(code: 0): Error when running a cron job at /var/www/html/public_html/vendor/magento/module-cron/Observer/ProcessCronQueueObserver.php:327, Error(code: 0): Call to undefined method ArrayIterator::setType() at /var/www/html/public_html/vendor/zendframework/zend-mail/src/Message.php:406)"} []

I looked at and got this:

$header->setType('multipart/mixed');
$header->addParameter('boundary', $mime->boundary());

So I commented this 2 lines out and the blocked emails arrived, all of them fused together in a single email, this line was separating them:

 This is a message in Mime Format. If you see this, your mail reader does not support this format. --=_5a8c092ef2afea588e3cdba2658f0f49 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

So I thought that there must be something with the email template, but this wasn't touched since may last year.

Then I switched off the asynchronous sending mode, as there aren't too many orders now, but this is not a long term solution.

Any ideas where to start debug this?

We are on Magento 2.3.1.

2
  • have u got any solution on this?? Mar 25 '20 at 16:21
  • No, still nothing.
    – Andras
    Mar 29 '20 at 16:17
0

There should be at least one email that cannot be send out. You can identifiy these in this table:

SELECT * FROM `sales_shipment` WHERE `email_sent` IS NULL AND `send_email` = 1 ORDER BY `entity_id` DESC

Make a backup of your database and then set one by one to email_sent = 1 until you have a culprit shipment. Then you can debug deeper into the issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.