0

Since upgrading to 2.4.3-p2 (was 2.4.3) the email templates when sending to a customer are not showing the shipping address or the products ordered.

Issue of email template not showing correct details

It's picked up the correct name, but the shipping address that used to be on the right no longer appears, the products and price breakdown at the bottom have gone and the comma at the top used to have the customers name so they could see it was directed to them personally...

Without rolling back an update - how do I get this template to correctly appear?

1
  • I have just noticed similar issue on my second store. Works on one store but not the other, seems that getData does not know the orderId when debugging which is odd. Did you get anywhere with this?
    – harri
    Commented Dec 6, 2022 at 17:22

3 Answers 3

0

You have a custom email template?

Go to Marketing > Email templates and check your New Order email template and check if have a these lines

  1. Customer Name

    <p class="greeting">{{trans "%customer_name," customer_name=$order_data.customer_name}}</p>
    
  2. Email items

    {{layout handle="sales_email_order_items" order_id=$order_id area="frontend"}}
    

If you do not have a custom template, create a new one with custom magento templates.

Marketing > Email templates > Add new template > Find "New order and Load template > Save

Assign it to the new order action and try it.

1
  • It should have been a default email template assigned by the theme itself. The two lines don't quite match, I am seeing; <p class="greeting">{{trans "%customer_name,"customer_name=$order.getCustomerName()}}</p> and {{layout handle="sales_email_order_items" order=$order area="frontend"}} Previewing the template always leaves me with empty areas, identical to the issue the customers see. Is the preview supposed to populate with dummy data like $firstname $surname (so that I can see what data is being placed)
    – Lexifir
    Commented Jul 16, 2022 at 21:26
0

I had same issue on Magento 2.4.5-p1

Create new email template from Marketing > Email Templates and load the default order template.

This worked for me.


{{template config_path="design/email/header_template"}}


    
        
            {{trans "%name," name=$order_data.customer_name}}

{{trans "Thank you for your order from %store_name." store_name=$store.frontend_name}} {{trans "Once your package ships we will send an email with a link to track your order."}} {{trans 'If you have questions about your order, you can email us at %store_email' store_email=$store_email |raw}}{{depend store_phone}} {{trans 'or call us at %store_phone' store_phone=$store_phone |raw}}{{/depend}}. {{depend store_hours}} {{trans 'Our hours are %store_hours.' store_hours=$store_hours |raw}} {{/depend}}

{{trans 'Your Order #%increment_id' increment_id=$order.increment_id |raw}}

{{trans 'Placed on %created_at' created_at=$created_at_formatted |raw}}

{{depend order_data.email_customer_note}} {{var order_data.email_customer_note|escape|nl2br}} {{/depend}}

{{trans "Billing Info"}}

{{var formattedBillingAddress|raw}}

{{depend order_data.is_not_virtual}}

{{trans "Shipping Info"}}

{{var formattedShippingAddress|raw}}

{{/depend}}

{{trans "Payment Method"}}

{{var payment_html|raw}} {{depend order_data.is_not_virtual}}

{{trans "Shipping Method"}}

{{var order.shipping_description}}

{{if shipping_msg}}

{{var shipping_msg}}

{{/if}} {{/depend}} {{layout handle="sales_email_order_items" order_id=$order_id }} {{template config_path="design/email/footer_template"}}
0

For products not showing up in the new order email:

Change this in your order email template:

Find:

{{layout handle="sales_email_order_items" order=$order area="frontend"}}

Replace with:

{{layout handle="sales_email_order_items" order_id=$order_id area="frontend"}}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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