Question

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?

No correct solution

OTHER TIPS

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.

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()) ?>
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top