How to Customize Email Templates in Shopware 5?

Email Templates in Shopware 5

In shopware 5, you can customize the pre-defined email templates layout that has already included content likes texts and images. To customize the email templates in shopware 5 follow the below steps.

Step 1: Log in to the admin and go to the Configuration > E-mail management > Email templates

Note: All of the templates are listed on the left side. You can edit your status emails and system emails or create your own personalized templates.

Step 2: We are going to customize the order confirmation email template which is denoted by sORDER on the System-E-Mails section.

  • Plain text: This is what it looks like in the default plain text. You can add or remove the additional text.
{include file="string:{config name=emailheaderplain}"}

Dear {$billingaddress.salutation|salutation} {$billingaddress.lastname},

Thank you for your order at {config name=shopName} (Number: {$sOrderNumber}) on {$sOrderDay} at {$sOrderTime}.
Information on your order:

Pos.  Art.No.               Description                                      Quantities       Price       Total
{foreach item=details key=position from=$sOrderDetails}
{{$position+1}|fill:4}  {$details.ordernumber|fill:20}  {$details.articlename|fill:49}  {$details.quantity|fill:6}  {$details.price|padding:8|currency|unescape:"htmlall"}      {$details.amount|padding:8|currency|unescape:"htmlall"}
{/foreach}

Shipping costs: {$sShippingCosts|currency|unescape:"htmlall"}
Net total: {$sAmountNet|currency|unescape:"htmlall"}
{if !$sNet}
{foreach $sTaxRates as $rate => $value}
plus {$rate|number_format:0}% VAT {$value|currency|unescape:"htmlall"}
{/foreach}
Total gross: {$sAmount|currency|unescape:"htmlall"}
{/if}

Selected payment type: {$additional.payment.description}
{$additional.payment.additionaldescription}
{if $additional.payment.name == "debit"}
Your bank connection:
Account number: {$sPaymentTable.account}
BIN:{$sPaymentTable.bankcode}
Bank name: {$sPaymentTable.bankname}
Bank holder: {$sPaymentTable.bankholder}

We will withdraw the money from your bank account within the next days.
{/if}
{if $additional.payment.name == "prepayment"}

Our bank connection:
Account: ###
BIN: ###
{/if}


Selected shipping type: {$sDispatch.name}
{$sDispatch.description}

{if $sComment}
Your comment:
{$sComment}
{/if}

Billing address:
{$billingaddress.company}
{$billingaddress.firstname} {$billingaddress.lastname}
{$billingaddress.street} {$billingaddress.streetnumber}
{if {config name=showZipBeforeCity}}{$billingaddress.zipcode} {$billingaddress.city}{else}{$billingaddress.city} {$billingaddress.zipcode}{/if}
{$additional.country.countryname}

Shipping address:
{$shippingaddress.company}
{$shippingaddress.firstname} {$shippingaddress.lastname}
{$shippingaddress.street} {$shippingaddress.streetnumber}
{if {config name=showZipBeforeCity}}{$shippingaddress.zipcode} {$shippingaddress.city}{else}{$shippingaddress.city} {$shippingaddress.zipcode}{/if}

{$additional.countryShipping.countryname}

{if $billingaddress.ustid}
Your VAT-ID: {$billingaddress.ustid}
In case of a successful order and if you are based in one of the EU countries, you will receive your goods exempt from turnover tax.{/if}

If you have any questions, do not hesitate to contact us.

{include file="string:{config name=emailfooterplain}"}
  • HTML: You can add or remove the default content in the HTML form. This is what it looks like.
<div style="font-family:arial; font-size:12px;">
    {include file="string:{config name=emailheaderhtml}"}
    <br/><br/>
    <p>Dear {$billingaddress.salutation|salutation} {$billingaddress.lastname},<br/>
        <br/>
        Thank you for your order at {config name=shopName} (Number: {$sOrderNumber}) on {$sOrderDay} at {$sOrderTime}.<br/>
        <br/>
        <strong>Information on your order:</strong></p><br/>
    <table width="80%" border="0" style="font-family:Arial, Helvetica, sans-serif; font-size:12px;">
        <tr>
            <td bgcolor="#F7F7F2" style="border-bottom:1px solid #cccccc;"><strong>Pos.</strong></td>
            <td bgcolor="#F7F7F2" style="border-bottom:1px solid #cccccc;"><strong>Article</strong></td>
            <td bgcolor="#F7F7F2" style="border-bottom:1px solid #cccccc;"><strong>Description</strong></td>
            <td bgcolor="#F7F7F2" style="border-bottom:1px solid #cccccc;"><strong>Quantities</strong></td>
            <td bgcolor="#F7F7F2" style="border-bottom:1px solid #cccccc;"><strong>Price</strong></td>
            <td bgcolor="#F7F7F2" style="border-bottom:1px solid #cccccc;"><strong>Total</strong></td>
        </tr>

        {foreach item=details key=position from=$sOrderDetails}
        <tr>
            <td style="border-bottom:1px solid #cccccc;">{$position+1|fill:4} </td>
            <td style="border-bottom:1px solid #cccccc;">{if $details.image.src.0 && $details.modus == 0}<img style="height: 57px;" height="57" src="{$details.image.src.0}" alt="{$details.articlename}" />{else} {/if}</td>
            <td style="border-bottom:1px solid #cccccc;">
                {$details.articlename|wordwrap:80|indent:4}<br>
                Article-No: {$details.ordernumber|fill:20}
            </td>
            <td style="border-bottom:1px solid #cccccc;">{$details.quantity|fill:6}</td>
            <td style="border-bottom:1px solid #cccccc;">{$details.price|padding:8|currency}</td>
            <td style="border-bottom:1px solid #cccccc;">{$details.amount|padding:8|currency}</td>
        </tr>
        {/foreach}

    </table>

    <p>
        <br/>
        <br/>
        Shipping costs: {$sShippingCosts|currency}<br/>
        Net total: {$sAmountNet|currency}<br/>
        {if !$sNet}
        {foreach $sTaxRates as $rate => $value}
        plus {$rate|number_format:0}% VAT {$value|currency}<br/>
        {/foreach}
        <strong>Total gross: {$sAmount|currency}</strong><br/>
        {/if}
        <br/>
        <br/>
        <strong>Selected payment type:</strong> {$additional.payment.description}<br/>
        {$additional.payment.additionaldescription}
        {if $additional.payment.name == "debit"}
        Your bank connection:<br/>
        Account number: {$sPaymentTable.account}<br/>
        BIN: {$sPaymentTable.bankcode}<br/>
        Bank name: {$sPaymentTable.bankname}<br/>
        Bank holder: {$sPaymentTable.bankholder}<br/>
        <br/>
        We will withdraw the money from your bank account within the next days.<br/>
        {/if}
        <br/>
        <br/>
        {if $additional.payment.name == "prepayment"}
        Our bank connection:<br/>
        Account: ###<br/>
        BIN: ###<br/>
        {/if}
        <br/>
        <br/>
        <strong>Selected shipping type:</strong> {$sDispatch.name}<br/>
        {$sDispatch.description}
    </p>
    <br/>
    <p>
        {if $sComment}
        <strong>Your comment:</strong><br/>
        {$sComment}<br/>
        {/if}
        <br/>
        <br/>
        <strong>Billing address:</strong><br/>
        {$billingaddress.company}<br/>
        {$billingaddress.firstname} {$billingaddress.lastname}<br/>
        {$billingaddress.street} {$billingaddress.streetnumber}<br/>
        {if {config name=showZipBeforeCity}}{$billingaddress.zipcode} {$billingaddress.city}{else}{$billingaddress.city} {$billingaddress.zipcode}{/if}<br/>
        {$additional.country.countryname}<br/>
        <br/>
        <br/>
        <strong>Shipping address:</strong><br/>
        {$shippingaddress.company}<br/>
        {$shippingaddress.firstname} {$shippingaddress.lastname}<br/>
        {$shippingaddress.street} {$shippingaddress.streetnumber}<br/>
        {if {config name=showZipBeforeCity}}{$shippingaddress.zipcode} {$shippingaddress.city}{else}{$shippingaddress.city} {$shippingaddress.zipcode}{/if}<br/>
        {$additional.countryShipping.countryname}<br/>
        <br/>
        {if $billingaddress.ustid}
        Your VAT-ID: {$billingaddress.ustid}<br/>
        In case of a successful order and if you are based in one of the EU countries, you will receive your goods exempt from turnover tax.<br/>
        {/if}
        <br/>
        <br/>
        If you have any questions, do not hesitate to contact us.<br/>
        {include file="string:{config name=emailfooterhtml}"}
    </p>
</div>
  • Attachment: You can even add the attach the documents in the email template.

You can preview the Email template, and click on the “Display preview” button.

Result

Please contact us at manish@bay20.com or call us at +91-8800519180 for any support related to shopware 5. You can also visit the Shopware 5 development page to check the services we offer.