riconect/mailerbundle
Composer 安装命令:
composer require riconect/mailerbundle
包简介
Mailer helper for Swiftmailer - spooling to database.
README 文档
README
This bundle is a mail helper for Symfony framework.
At present, it only works with the Doctrine ODM (MongoDB).
Installation and configuration
1. Install via Composer
$ composer require "riconect/mailerbundle:^1.0"
2. Add the bundle to your application's kernel
// app/AppKernel.php public function registerBundles() { $bundles = [ // ... new Riconect\MailerBundle\RiconectMailerBundle(), // ... ]; }
3. Configure SwiftMailer to use the bundle
# app/config/config.yml swiftmailer: spool: type: service id: riconect_mailer.spool
That's it. Now your emails is saved to default database in messages collection.
4. Add cron job.
$ crontab -e
Add this line to execute command every minute:
* * * * * /usr/bin/php /PATH/TO/YOUR/PROJECT/bin/console swiftmailer:spool:send --message-limit=100 --env=dev > /dev/null
Don't forget to change options like --env=prod in production server.
If you wish to keep sent emails in database, configure the bundle:
# app/config/config.yml riconect_mailer: keep_sent_emails: true
Default Configuration:
riconect_mailer: database_type: mongodb keep_sent_emails: false message_class: Riconect\MailerBundle\Document\Message
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-08-29