定制 whiteoctober/swiftmailerdbbundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

whiteoctober/swiftmailerdbbundle

最新稳定版本:1.1.1

Composer 安装命令:

composer require whiteoctober/swiftmailerdbbundle

包简介

Database spooling for SwiftMailer

README 文档

README

This project is looking for maintainers - details here.

SwiftMailerDBBundle

This project was originally at https://github.com/whiteoctober/WhiteOctoberSwiftMailerDBBundle

Latest Stable Version Total Downloads Monthly Downloads License

SwiftMailer

This bundle faciliates using a database to spool messages to with SwiftMailer and Symfony2.

At present, it only works with the Doctrine EntityManager and entities managed with this.

Installation and configuration

1. Install via Composer

$ composer require "whiteoctober/swiftmailerdbbundle:^1.0"

2. Add the bundle to your application's kernel

// app/AppKernel.php
public function registerBundles()
{
    return array(
        // ...
        new WhiteOctober\SwiftMailerDBBundle\WhiteOctoberSwiftMailerDBBundle(),
        // ...
    );
}

3. Configure the white_october_swift_mailer_db in config.yml

white_october_swift_mailer_db:
    entity_class: AppBundle\Entity\Email

Read below about how to construct this entity.

4. Tell SwiftMailer to use the database spooler

swiftmailer:
    spool:
        type: db

That's it for bundle installation and configuration.

Mail entity

You will need to create an entity that can be persisted and that extends from the EmailInterface interface in the bundle. At the moment, the bundle expects a property to be available on your entity called 'status', since this field is queried.

Once you have your entity all set up, use the full namespaced path in your config.yml configuration as detailed above.

Optional: keeping sent messages in the database

By default, messages which were succesfully sent will be deleted from the database. It is possible to configure the bundle to keep those messages in your config.yml:

white_october_swift_mailer_db:
    keep_sent_messages: true

Optional: using separate entity manager for emails

When a message is sent with configured database spool $em->flush is called on default entity manager. This may cause side effects, so in order to flush only Email entity, put it in a separate bundle and configure separate entity manager for that bundle. For example:

white_october_swift_mailer_db:
    entity_class: MailBundle\Entity\Email

doctrine:
    orm:
        entity_managers:
            default:
                connection: default
                auto_mapping: true
            mail:
                connection: default
                mappings:
                    MailBundle: ~

Contributing

We welcome contributions to this project, including pull requests and issues (and discussions on existing issues).

If you'd like to contribute code but aren't sure what, the issues list is a good place to start. If you're a first-time code contributor, you may find Github's guide to forking projects helpful.

All contributors (whether contributing code, involved in issue discussions, or involved in any other way) must abide by our code of conduct.

whiteoctober/swiftmailerdbbundle 适用场景与选型建议

whiteoctober/swiftmailerdbbundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 131.83k 次下载、GitHub Stars 达 30, 最近一次更新时间为 2012 年 08 月 09 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「doctrine」 「swiftmailer」 「spool」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 whiteoctober/swiftmailerdbbundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 whiteoctober/swiftmailerdbbundle 我们能提供哪些服务?
定制开发 / 二次开发

基于 whiteoctober/swiftmailerdbbundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 131.83k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 30
  • 点击次数: 14
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 30
  • Watchers: 21
  • Forks: 18
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2012-08-09