0

I'm running into an issue where Magento 2.3.4 is not sending the shipment confirmation email after I enter the shipment for an order.

I have tried to send the shipping details (by checking the box to send customer notification) and it does not send.

If I go into the Admin page, go to Sales > Orders, pull up the shipment, and then click "Send Tracking Information", the email is also does not send.

When I press "Send Tracking Information" it asks me for confirmation "Do you really want to send the customer an e-mail of the order" and then the screen remains blank with a text "Sent by Shipment Number".

Debug.log & cron.log

main.INFO: Cron Job sales_send_order_shipment_emails is run [] []
main.INFO: Cron Job sales_send_order_shipment_emails is successfully finished

When I place an order, the order confirmation email is sent correctly.

When I invoice the order, the invoice email is sent correctly.

Why are the shipment emails not being sent when a shipment is entered?

  • which theme are you using? – paj Aug 1 at 12:01
  • Check Magneto log files, is there anything mension there? – Dhiren Vasoya Aug 1 at 12:12
  • My theme is Codazon Fastest in its latest version themeforest.net/item/… – Juanjo Aug 2 at 10:11
  • No, In the cron.log and debug.log files it only indicates "Cron Job sales_send_order_shipment_emails is successfully finished." and in the system.log file it does not make any call to send email or shipment – Juanjo Aug 2 at 10:11
  • 1
    check if your theme is overriding the shipment email template. If so try removing the template or compare it with the core templates for changes. – paj Aug 3 at 16:48
1

See https://github.com/magento/magento2/issues/25221

Problem caused by customized e-mail templates based on previous versions.

If you have customized e-mail templates inserting track.phtml this way:

{{block class='Magento\\Framework\\View\\Element\\Template' area='frontend' template='MyParcelNL_Magento::email/shipment/track.phtml' shipment=$shipment order=$order}}

Try changing that to this so it uses the layout XML:

{{layout handle="sales_email_order_shipment_track" shipment=$shipment order=$order}}

Otherwise track.phtml doesn't receive the (new) argument containing the TrackingUrl object argument defined in the layout xml.

| improve this answer | |
0

Thanks @paj

I had already tried that solution and it didn't work properly.

I found the solution that works perfectly.

  1. Create an email Shipment template with the standard format.
  2. Review it to include {{layout handle="sales_email_order_shipment_track" shipment=$shipment order=$order}}
  3. Once the template Shipment is saved, access the DDBB and in the table email_template modify is_legacy to 1
  4. Assign the created template to shipments in Stores > Settings > Sales > Sales Email.

So if you get the full email with the tracking number

But there's something I don't like at all.

In the email it indicates the url of the follow up that I have put in magento enter image description here

but the link, does not lead to that url, it leads to a url of my site that comes out blank whit text "TRACKING INFORMATION"

I worked around this problem by just replacing \vendor\magento\module-sales\view\frontend\templates\email\shipment\track.phtml

This code:

<a href="<?= $block->escapeUrl($block->getTrackingUrl()->getUrl($_item)) ?>" target="_blank"> <?= $block->escapeHtml($_item->getNumber()) ?> </a>

by:

<?= $block->escapeHtml($_item->getNumber()) ?>
| improve this answer | |

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.