0

HTML tag is not working in the custom email template.

HTML file

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

{{trans "Csr Name: %name" name=$data.csrname}}
{{trans "Email: %email" email=$data.csremail}}
{{trans "Product Name: %pname" pname=$data.productname}}
{{trans "Sku: %sku" sku=$data.productsku}}
{{trans "Product Price: %pprice" pprice=$data.productprice}}
{{trans "Authorized Price: %authorizedprice" authorizedprice=$data.authorizedprice}}
{{trans "Approve Price: %approveprice" approveprice=$data.approveprice}}
{{trans 'Please <a href="%approveurl">Click here</a> for approve price.' approveurl=$data.approvelink|raw}}

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

Genrated email template

enter image description here

4
  • Add the href tag outside the trans brackets <a href="{{trans Nov 7, 2018 at 10:36
  • I have tried. It is not working @YlgenGuxholli Nov 7, 2018 at 12:21
  • The issue is resolved. I have changed type text to html in email_templates.xml. Nov 8, 2018 at 9:47
  • Glad you fixed it :) Nov 8, 2018 at 10:03

1 Answer 1

1

You can take a look on this file:

vendor/magento/module-sales/view/frontend/email/shipment_update.html

<p>{{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>


   {{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}}

Probably is something related to transport :

vendor/magento/module-sales/Model/Order/Shipment/Sender/EmailSender.php

1
  • 1
    The issue is resolved. I have changed type text to html in email_templates.xml Nov 8, 2018 at 9:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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