2

I want to add new template variable and use it in transactional email template from backend. Same as "Confirmation URL". Please refer to screen shot:

enter image description here

Thanks!!!

1

3 Answers 3

3

Template variables are comes from email template comments, To add new template variable we need to add it to email template comment section(at top of email template html) as like below:

<!--@subject Welcome, {{var customer.name}}! @-->
<!--@vars
{"store url=\"\"":"Store Url",
"var logo_url":"Email Logo Image Url",
"htmlescape var=$customer.name":"Customer Name",
"store url=\"customer/account/\"":"Customer Account Url",
"var customer.email":"Customer Email",
"reset password url=\"customer/account/resetpassword/\" _query_id=$customer.id _query_token=$customer.rp_token":"Reset Password URL",
"htmlescape var=$customer.password":"Customer Password"}
@-->

It automatically load the template variables in transactional email template variables.

1
  • How to add website id and apply if-else condition on that? Thanks @Ranjit Shinde
    – zus
    Mar 18, 2020 at 5:15
2

You add custom variables by accessing System > Custom Variables menu.

enter image description here

1
  • thanks for answer but i want add link something like this :` {{store url="customer/account/confirm/" _query_id=$customer.id _query_key=$customer.confirmation _query_back_url=$back_url}} ` and custom variables are not accepting $customer Jul 5, 2016 at 13:16
0

To add new custom variable:

  • Go to System >> Custom Variables.
  • Click on Add New Variable button.
  • Fill in values for Variable Code, Variable Name, Variable HTML Value, Variable Plain Value and click on Save button.

Now you can use this new variable in transactional emails, cms pages, cms blocks and other places where you are able to place default variables.

2
  • thanks for answer but i want add link something like this :` {{store url="customer/account/confirm/" _query_id=$customer.id _query_key=$customer.confirmation _query_back_url=$back_url}} ` and custom variables are not accepting $customer Jul 5, 2016 at 13:16
  • How to add website id and apply if-else condition on that? Thanks @Mohit Kumar Arora
    – zus
    Mar 18, 2020 at 5:16

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.