Question

When I press "Send tracking information" in Magento admin panel for a shipment there is no email sent and Magento displays the tracking info in the browser. For old orders were shipments were created before I migrated to Magento 2.3.5, the emails are sent and I'm redirected to the shipment page itself.

Usually, tracking emails should be sent once the warehouse ships the packages and notifies Magento through an integration of the tracking number, but this doesn't happen either.

For old orders (created before upgrade, and where I'm resending the tracking email already sent) there is no error showing in the logs. For new orders, I get below error.

apache error_log
[Tue May 26 08:09:00.291522 2020] [ssl:error] [pid 4089:tid 140002679666432] [client x.x.x.x:35142] AH02031: Hostname magentodomain.com provided via SNI, but no hostname provided in HTTP request
[Tue May 26 08:09:00.379189 2020] [proxy_fcgi:error] [pid 4089:tid 140002721629952] [client y.y.y.y:16567] AH01071: 
Got error 'PHP message: PHP Fatal error:  Uncaught Error: Call to a member function getUrl() on null in /opt/bitnami/apps/magento/htdocs/vendor/magento/module-sales/view/frontend/templates/email/shipment/track.phtml:28\n
Stack trace:\n#0
/opt/bitnami/apps/magento/htdocs/vendor/magento/framework/View/TemplateEngine/Php.php(59): include()\n#1 
/opt/bitnami/apps/magento/htdocs/vendor/magento/framework/Interception/Interceptor.php(58): Magento\\Framework\\View\\TemplateEngine\\Php->render(Object(Magento\\Framework\\View\\Element\\Template), '/opt/bitnami/ap...', Array)\n#2
/opt/bitnami/apps/magento/htdocs/vendor/magento/framework/Interception/Interceptor.php(138): Magento\\Framework\\View\\TemplateEngine\\Php\\Interceptor->___callParent('render', Array)\n#3 
/opt/bitnami/apps/magento/htdocs/vendor/magento/framework/Interception/Interceptor.php(153): Magento\\Framework\\View\\TemplateEngine\\Php\\Interceptor->Magento\\Framework\\Interception\\{closure}(Object(Magento\\Framework\\View\\Element\\Template), '/opt/bitnami/ap...', Array)\n#4 
/opt/bitnami/apps...', referer: https://magentodomain.com/admin/admin/order_shipment/view/shipment_id/_someid_/key/___somekey___/
[Tue May 26 08:09:00.686832 2020] [ssl:error] [pid 20812:tid 140002830735104] [client z.z.z.z:41152] AH02031: Hostname magentodomain.com provided via SNI, but no hostname provided in HTTP request
  • Bitnami Magento stack
  • MagePlaza SMTP extension v 1.3.1.
  • Used MagePal GmailSmtpApp previously, but with the upgrade it is disabled and shows as a disbaled modules when using magento cli interface and command module:status.
  • Multiple store and websites : tried to send shipment emails for order from different websites without success
  • SMTP provider doesn't show any signs of the emails that are not being sent.
  • Cron logs shows no issues.
  • Order confirmation emails are sent.

All help to resolve this issue is highly appreciated.

Was it helpful?

Solution

This is due to using a previous email template which isn't fully supported.

Within the email template, this block isn't supported:

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

The unsupported block has to be replaced with:

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

There is a reference in Github on this issue.

OTHER TIPS

For me instead of {{ layout handle="sales_email_order_shipment_track" shipment=$shipment order=$order }} this worked {{layout handle="sales_email_order_shipment_track" shipment_id=$shipment_id order_id=$order_id}}

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top