Инструменты пользователя

Инструменты сайта


yii:yii2:swiftmailer

Различия

Здесь показаны различия между двумя версиями данной страницы.

Ссылка на это сравнение

Предыдущая версия справа и слева Предыдущая версия
Следующая версия
Предыдущая версия
yii:yii2:swiftmailer [2021/07/28 16:34]
werwolf
yii:yii2:swiftmailer [2023/01/12 12:18] (текущий)
Строка 788: Строка 788:
 // Or use the constant to be more explicit // Or use the constant to be more explicit
 $message->​setPriority(Swift_Mime_SimpleMessage::​PRIORITY_HIGH);​ $message->​setPriority(Swift_Mime_SimpleMessage::​PRIORITY_HIGH);​
 +</​code>​
 +
 +====передать переменную в шаблон====
 +
 +<code php>
 +Yii::​$app->​mail
 +    ->​compose(['​html'​ => '​layouts/​html2'​],​ ['​content'​ => $content])
 +    ->​setFrom(['​noreply@mailer.com'​ => '​Mailer'​])
 +</​code>​
 +
 +<code html>
 +<​body>​
 +    <?php $this->​beginBody() ?>
 +    <?= $content ?>
 +    <?php $this->​endBody() ?>
 +</​body>​
 </​code>​ </​code>​
yii/yii2/swiftmailer.1627479260.txt.gz · Последние изменения: 2023/01/12 12:16 (внешнее изменение)