I have mail template on different languages, and inside this templates some php variables are using. I have to store templates in DB and before sending a mail, receive template for current language and replace all php vars. While I was doing this with the help of views – there was no probles, but now I don’t know how to replace php vars in template?
Or maybe there is the better way to solve this problem? I just need to have the ability to edit templates from admin side.
I have mail template on different languages, and inside this templates some php variables
Share
Why don’t you store the variables in the email template as something non-PHP e.g..
This makes it easy for admin editing.
Then in your code before you send you have an array of all variables to replace…
Edit
In response to your comment below I would setup the languages in an array and then use PHP in the view to output the correct language, then do the replacement…
email_template.html