php - yii2 mandrill 邮件已发送但未插入包含
问题描述
如何使用 yii2 nickcv插件将包含插入到 mandrill 模板中。在这段代码中test.org是我的模板名称,我想插入到包含中。任何人都知道它。这是代码。
\Yii::$app->mailer
->compose('test.org')
->setTo('test@mail.com')
->setSubject($setSubject)
->send();
我只想像这样添加身体
$body = "Hi ,Testing here";
解决方案
你必须setHtmlBody
像那样使用函数
$mailSent = Yii::$app->mailer
->compose($template_name)
->setFrom('test@mail.org')
->setTo($to_email)
->setSubject($setSubject)
->setHtmlBody($setTextBody['html'])
->send();
return $mailSent;
推荐阅读
- sql - 关联没有重复结果的三列查询
- python - 排除日期字段的df行:时间/秒在特定时期之间
- c# - 使用 Polly.Net 的嵌套重试和断路器策略的意外行为
- android - 如何使用 AccessibilityService 收听软键盘点击?
- maven - 显式定义可被 intellij 和 maven 接受的项目源以进行项目设置
- ios - react-navigation 安装导致构建失败
- python - 如何在时间范围内识别虚拟变量的变化?
- vue.js - 从数组中的任何位置删除复选框项
- android-studio - 使用 openGL ES 绘制多个 AR 对象
- c++ - 电费项目