Is there a problem that needs an urgent fix?Urgent fix?Get emergency help →
Blog

Practical Magento 2 guides on upgrades, security, speed and migration, written by the MageBooster team.

Magento 2.4.9 store emails and a branded email template (Lesson 7)

Where Magento 2.4.9 switches each customer email on and sets its sender and template: order, invoice, shipment, credit memo, welcome and newsletter. Plus a branded New Order template to download, and an end-to-end test.
Magento 2.4.9 email templates: store emails and a branded template
Lesson 7MageBooster Lessons · Magento 2.4.9

Magento store emails and a branded email template

Every email Magento 2.4.9 sends to your customers has an on/off switch, a sender and a template. Here is where each one is set: order, invoice, shipment and credit memo, the welcome email and the newsletter emails. Then we copy Magento’s New Order template, give it our own header and footer, use it for customers and guests, and test every email end to end.

Updated October 2026Video about 7 minLevel Store owners and developers
Video: MageBooster Lessons · Lesson 7

Downloads

The branded New Order template from the video. Paste the content into Template Content and the subject into Template Subject. The store name, address, email and phone come from your own configuration, so nothing in the file needs editing; change the two colours (#160040 and #79018C) to your brand’s.

Which emails, where

EmailWhere it is set
Order, invoice, shipment, credit memo (and their comment updates)Stores › Configuration › Sales › Sales Emails
Welcome email, account confirmationStores › Configuration › Customers › Customer Configuration › Create New Account Options
Newsletter confirmation, success, unsubscribeStores › Configuration › Customers › Newsletter › Subscription Options
Your own designsMarketing › Communications › Email Templates

The sender identities (General Contact, Sales Representative, Customer Support…) are set in Store Email Addresses, see Lesson 4. The emails go out through SMTP, see Lesson 6.

Sales emails

Stores › Configuration › Sales › Sales Emails. Each group (Order, Order Comments, Invoice, Invoice Comments, Shipment, Shipment Comments, Credit Memo, Credit Memo Comments) has the same fields:

FieldWhat it doesIn the video
General Settings › Asynchronous sendingSends the emails in the background with cron, so the checkout does not wait for the mail server. Needs a working Magento cron.Disable (default)
EnabledSwitches this email on or off.Yes
New Order Confirmation Email SenderThe sender identity.Sales Representative
New Order Confirmation TemplateThe template for registered customers.MageBooster New Order (after the change)
New Order Confirmation Template for GuestThe template for guest checkouts.MageBooster New Order (after the change)
Send Order Email Copy ToOne or more of your own addresses, comma separated.empty
Send Order Email Copy MethodBcc: the customer does not see the copy addresses. Separate Email: a separate email to each address.Bcc
The Comments groups send an update to the customer when you add a comment to an order, invoice, shipment or credit memo and tick Notify Customer by Email.

Welcome and newsletter emails

SettingWhereIn the video
Default Welcome EmailCustomer Configuration › Create New Account OptionsNew Account (Default)
Email SenderCustomer Configuration › Create New Account OptionsCustomer Support
Require Emails ConfirmationCustomer Configuration › Create New Account OptionsNo: Yes sends a confirmation link first, and the welcome email after the click
Need to ConfirmNewsletter › Subscription OptionsNo: the subscriber gets the success email at once
Confirmation / Success / Unsubscription Email Sender and TemplateNewsletter › Subscription OptionsGeneral Contact, default templates

A branded template

  1. Marketing › Email Templates › Add New Template.
  2. Under Load Default Template, pick New Order (Magento_Sales) and click Load Template. Magento copies its own subject and content into the form, so you start from an email that already works.
  3. Replace Template Content with the downloaded mb-new-order.html (or edit Magento’s version yourself).
  4. Template Name: MageBooster New Order (any name; it shows in the template dropdowns). Save Template.

What the branded version changes, compared with Magento’s default: the line {{template config_path="design/email/header_template"}} is replaced by our own dark purple header with the store name, and {{template config_path="design/email/footer_template"}} by a footer with the store’s name, address, email and phone. The first line, {{inlinecss file="css/email-inline.css"}}, keeps the theme’s email styles for the order details and the items table. Everything in between is Magento’s own content.

mb-new-order.htmlDownload

{{inlinecss file="css/email-inline.css"}}
<div style="max-width:640px;margin:0 auto;font-family:Arial,Helvetica,sans-serif;color:#333">
<table width="100%" cellpadding="0" cellspacing="0" style="background:#160040;border-radius:12px 12px 0 0">
    <tr>
        <td style="padding:26px 30px;font-family:Arial,sans-serif">
            <span style="display:inline-block;background:#79018C;color:#fff;font-weight:bold;font-size:13px;letter-spacing:1px;padding:4px 10px;border-radius:6px">ORDER CONFIRMATION</span>
            <div style="color:#fff;font-size:26px;font-weight:bold;margin-top:12px">{{var store.frontend_name}}</div>
        </td>
    </tr>
</table>
<div style="height:4px;background:#79018C"></div>
<div style="background:#fff;padding:8px 30px 0">

<table>
    <tr class="email-intro">
        <td>
            <p class="greeting">{{trans "%customer_name," customer_name=$order_data.customer_name}}</p>
            <p>
                {{trans "Thank you for your order from %store_name." store_name=$store.frontend_name}}
                {{trans "Once your package ships we will send you a tracking number."}}
                {{trans 'You can check the status of your order by <a href="%account_url">logging into your account</a>.' account_url=$this.getUrl($store,'customer/account/',[_nosid:1]) |raw}}
            </p>
            <p>
                {{trans 'If you have questions about your order, you can email us at <a href="mailto:%store_email">%store_email</a>' store_email=$store_email |raw}}{{depend store_phone}} {{trans 'or call us at <a href="tel:%store_phone">%store_phone</a>' store_phone=$store_phone |raw}}{{/depend}}.
                {{depend store_hours}}
                    {{trans 'Our hours are <span class="no-link">%store_hours</span>.' store_hours=$store_hours |raw}}
                {{/depend}}
            </p>
        </td>
    </tr>
    <tr class="email-summary">
        <td>
            <h1 style="color:#160040">{{trans 'Your Order <span class="no-link">#%increment_id</span>' increment_id=$order.increment_id |raw}}</h1>
            <p>{{trans 'Placed on <span class="no-link">%created_at</span>' created_at=$created_at_formatted |raw}}</p>
        </td>
    </tr>
    <tr class="email-information">
        <td>
            {{depend order_data.email_customer_note}}
            <table class="message-info">
                <tr>
                    <td>
                        {{var order_data.email_customer_note|escape|nl2br}}
                    </td>
                </tr>
            </table>
            {{/depend}}
            <table class="order-details">
                <tr>
                    <td class="address-details">
                        <h3>{{trans "Billing Info"}}</h3>
                        <p>{{var formattedBillingAddress|raw}}</p>
                    </td>
                    {{depend order_data.is_not_virtual}}
                    <td class="address-details">
                        <h3>{{trans "Shipping Info"}}</h3>
                        <p>{{var formattedShippingAddress|raw}}</p>
                    </td>
                    {{/depend}}
                </tr>
                <tr>
                    <td class="method-info">
                        <h3>{{trans "Payment Method"}}</h3>
                        {{var payment_html|raw}}
                    </td>
                    {{depend order_data.is_not_virtual}}
                    <td class="method-info">
                        <h3>{{trans "Shipping Method"}}</h3>
                        <p>{{var order.shipping_description}}</p>
                        {{if shipping_msg}}
                        <p>{{var shipping_msg}}</p>
                        {{/if}}
                    </td>
                    {{/depend}}
                </tr>
            </table>
            {{layout handle="sales_email_order_items" order_id=$order_id area="frontend"}}<br>
        </td>
    </tr>
</table>

</div>
<table width="100%" cellpadding="0" cellspacing="0" style="background:#f4eff9;border-radius:0 0 12px 12px">
    <tr>
        <td style="padding:22px 30px;font-family:Arial,sans-serif;font-size:13px;color:#4a4060;line-height:1.6">
            <strong style="color:#160040">{{config path="general/store_information/name"}}</strong><br>
            {{config path="general/store_information/street_line1"}}, {{config path="general/store_information/city"}} {{config path="general/store_information/postcode"}}<br>
            {{var store_email}}{{depend store_phone}} · {{var store_phone}}{{/depend}}<br>
            <span style="color:#79018C">Thank you for shopping with us.</span>
        </td>
    </tr>
</table>
</div>

Template variables

Variables sit in double curly braces. Insert Variable in the template form lists every variable this email can use. A few from the New Order template:

VariableShows
{{var order.increment_id}} / $order.increment_idThe order number
{{var order_data.customer_name}}The customer name
{{var formattedBillingAddress|raw}}The billing address
{{var payment_html|raw}}The payment method
{{var store.frontend_name}}The store name
{{config path="general/store_information/phone"}}Any configuration value, here the store phone
{{depend store_phone}}…{{/depend}}Shows the part only when the value is set
{{layout handle="sales_email_order_items" …}}The items table and totals

Using the template

Stores › Configuration › Sales › Sales Emails › Order: untick Use system value next to New Order Confirmation Template and pick MageBooster New Order. Do the same for New Order Confirmation Template for Guest. Save Config.

Sales Emails stores the template’s ID. Set it per website or store view (the scope switcher at the top) if each store needs its own design.

See what is set:

cd /var/www/magento
# which email settings differ from Magento's defaults
sudo -u magento bin/magento config:show | grep -E '^(sales_email|customer/create_account|newsletter/subscription)/'
# your own templates and their IDs (the value Sales Emails stores)
sudo mariadb magento -e "select template_id, template_code, orig_template_code from email_template"

Testing every email

On a test server (in the video, Mailpit catches every email):

  1. On the storefront, create a customer account with Sign Up for Newsletter ticked: the welcome email (from Customer Support) and the newsletter success email (from General Contact).
  2. Place an order: the order confirmation (from Sales Representative) with the branded template.
  3. In Sales › Orders, open the order, click Invoice, keep Email Copy of Invoice ticked and Submit Invoice: the invoice email.
  4. Click Credit Memo, keep Email Copy of Credit Memo ticked and click Refund Offline (a bank transfer order is refunded offline; you send the money back yourself): the credit memo email.

The invoice and credit memo still use Magento’s default design. Make branded copies of New Invoice and New Credit Memo (and their Guest versions) the same way, so every email looks the same.

Troubleshooting

SymptomCause and fix
No email at allCheck Enabled in the group, then the SMTP settings from Lesson 6. With Asynchronous sending on, the email waits for the Magento cron.
The new template does not show in the dropdownThe dropdown only lists templates that are based on that email: load the right default (New Order for the order email) before saving.
Variables show as text, or are emptyUse the variable names from Insert Variable for this email; some templates use $order.increment_id, not order.increment_id.
The email looks unstyled (serif font)Keep {{inlinecss file="css/email-inline.css"}} at the top when you replace the header template.
Copy To addresses get nothingCheck the comma separated list, and the Copy Method (Bcc or Separate Email).

Next lesson

Lesson 8: the Magento REST API: how to set up an integration, and which bearer token to use.

Want every store email in your brand?We design and test Magento and Mage-OS email templates for every store view and language.

▶ Watch every MageBooster lesson on YouTube: all lessons in order · subscribe to the channel

Installation guides: Magento 2.4.9 on Ubuntu Mage-OS Hyvä
Spotted a mistake on this page? Tell us and we will fix it right away.

Free Site Audit

Send your store details. We check speed, security and extensions, then reply with three quick wins within 3 working days.

Let's talk

Get a quote

Tell us about your store and we’ll reply within one working day. Prefer to chat? Say hello from WhatsApp

MageBooster Book a UnoPim demo See UnoPim live with products like yours. A new PIM or a move from Akeneo: we reply with a plan, a timeline and a quote.
✓ Official UnoPim partner✓ AI agent set up for your team✓ Connected to Magento
MageBooster Start your Hyvä project From scratch or from your current store. We reply with a project plan, a timeline and a quote.
✓ Design and structure by us✓ Hyvä-optimised server✓ Bonus modules included

MageBooster

Let us get in touch with you

Leave your details and your store address. We look at your store first and contact you within one business day, by phone, WhatsApp or email, whichever you prefer.

Partner with us