php - 如何在其他 Controller 中假脱机发送电子邮件(在任务中)并发送普通电子邮件?

标签 php symfony swiftmailer

在我的应用中我们会在瞬间发送通知邮件,例如,当您注册时,或者需要通过邮件确认一些信息的时候。

但我们还需要为数百个用户发送个性化电子邮件(仅在一个文本上有所不同),但我不知道如何组合Symfony2 spool email在同一项目中没有假脱机电子邮件。

发送邮件时有参数之类的东西表示吗?

类似于 $email->send('no-spool');

最佳答案

我找到了解决方案并张贴在这里:How to define an additional mailer service to use the spool and send instant emails in Symfony2

简而言之:

instant_mailer:
    class: %swiftmailer.class%
    arguments: ["@?swiftmailer.transport.real"]

关于php - 如何在其他 Controller 中假脱机发送电子邮件(在任务中)并发送普通电子邮件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10741452/

相关文章:

javascript - 如何对我的表单联系人使用 reCAPTCHA?

php - 尽管 --prefer-dist 标志, Composer 依赖项的更新缓慢

Symfony2 部署到 ubuntu 服务器

php - 在 php 中,如何获取 XMLHttpRequest 的 send() 方法的文本/纯文本值

php - 如何使用 createCommand 在 yii2 中获取最后插入的 id?

php - 长时间运行的 Golang 程序和资源(文件句柄、tcp 连接等)

php symfony2安装缓存权限

php - Swift Mailer 邮件发送问题

php - Symfony SwiftMailer : not sending if the controller does not return a $this->render() response

email - 无法使用 gmail 对 SMTP 服务器错误进行身份验证