Hello Magento Friends 👋,

Hope you are all well and good. Today’s technical solution is Magento 2: How to Get System Configurations Value in Email Templates. If by any chance you skipped our last blog, How to Restrict Customer to Access CMS Page and Redirect to Login Page in Magento 2.

Email templates may be a header, footer, or any other custom email template. By default, Magento 2 provides some default functionalities to add some fixed text as well as variables to display dynamic data in Magento 2 email templates.

But what if you want to use system configurations value in your email templates? 

One way to use system configuration value in the template is to get that value before sending the email and that value will be passed as a variable. But Magento 2 also provides a direct way to use system configuration value in templates.

So, let us do 🚀

Magento 2: How to Get System Configurations Value in Email Templates

Note: Here we have used the contact email template and demonstrated how we can get system configuration value on that template.

 Step 1: Update your submitted_form.html file inside vendor/magento/module-contact/view/frontend/email folder and update your code by below code reference (you can use file path as per your  need)

Step 2: Finally run the below command

That’s it.

Conclusion:

In this manner, you can get system configurations value in email templates. You may also like to know How to Customize Email Templates in Magento 2. In case of any mishap while implementing the above steps, mention in the comment. Share the article with your fellow Magento friends. Stay tuned for more such solutions.

Happy Coding 😊

Click to rate this post!
[Total: 7 Average: 4.4]