K
K
kazin82015-09-18 14:42:29
Yii
kazin8, 2015-09-18 14:42:29

yii2 mail templates from admin. panels, any ideas?

Good afternoon.
On any more or less serious project, you have to generate a lot of email messages.
I really like the yii2 approach to mail templates, but the question arises - how to make a mail template module in the admin panel with this approach? (as in any cms, for example). Roughly speaking, set a list of template variables (#var1#) and then replace them when forming. Maybe someone has already implemented it, or is there some kind of component ready on github? Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
matperez, 2015-09-18
@matperez

I didn’t have to do this, but if I had to, I would probably store them in the database in the form of some kind of Twig template, and I would give the already rendered text to the letter when linking. Then it would be possible to use variables and visibility would be preserved.
This is how you can render templates directly from a text string https://gist.github.com/matperez/ea2eaf16abe9329d5147

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question