D
D
Dmitriy G2019-03-09 19:54:47
Yii
Dmitriy G, 2019-03-09 19:54:47

How to insert image in Swiftmailer Yii2 mail view?

I can't insert an image into the view.
I do as in the documentation,
but the image is attached as a file.

$message =Yii::$app->mailer->compose('views/test', [
          'names' => $names,
          'logo' => Yii::getAlias('@app/web/images/mail/images/logo.png')
])
          ->setFrom([])
          ->setTo(@gmail.com')
          ->setSubject('');
   $message ->send();

in the form of How to insert an image into the view itself, but also preferably into the template (layout)?
<img src="<?= $logo ?>" alt="">

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
padlyuck, 2019-03-09
@padlyuck

https://www.yiiframework.ru/forum/viewtopic.php?t=20231
https://yiiframework.com.ua/ru/doc/guide/2/tutoria...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question