如何使用yii2 nickcv 插件将包含内容插入到mandrill模板中。在此代码中, test.org 是我的模板名称,我想插入到contains中。任何人对此都有想法。 这是代码。
\Yii::$app->mailer
->compose('test.org')
->setTo('test@mail.com')
->setSubject($setSubject)
->send();
我只想添加这样的身体
$body = "Hi ,Testing here";
答案 0 :(得分:0)
您必须像这样使用setHtmlBody
函数
$mailSent = Yii::$app->mailer
->compose($template_name)
->setFrom('test@mail.org')
->setTo($to_email)
->setSubject($setSubject)
->setHtmlBody($setTextBody['html'])
->send();
return $mailSent;