H
H
hanyll2016-08-19 14:33:42
Yii
hanyll, 2016-08-19 14:33:42

Yii2 Swiftmailer - how to pass a parameter to email layout?

It is necessary to send letters with different text, but in one common layout. In the layout, at the very beginning, you need to write a greeting to the user, like "Hello <?= $user_name ?>", so that this greeting would be displayed in each letter. How in yii2, in swiftmailer, when sending a letter, it is possible to pass parameters in the layout?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
at0m1x, 2016-08-20
@at0m1x

In order to pass a parameter to the layout, you need to do the following:
You can read more about other nuances of working with Swiftmailer here .

D
Dmitry, 2016-08-19
@slo_nik

For example like this
This is a piece of code from an email template

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question