2017 © Pedro Peláez
 

symfony-bundle swiftmailerdbbundle

Database spooling for SwiftMailer

image

whiteoctober/swiftmailerdbbundle

Database spooling for SwiftMailer

  • Wednesday, November 8, 2017
  • by richsage
  • Repository
  • 20 Watchers
  • 31 Stars
  • 71,924 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 13 Forks
  • 6 Open issues
  • 9 Versions
  • 6 % Grown

The README.md

This project is looking for maintainers - details here., (*1)

SwiftMailerDBBundle

This project was originally at https://github.com/whiteoctober/WhiteOctoberSwiftMailerDBBundle, (*2)

Latest Stable Version Total Downloads Monthly Downloads License, (*3)

SwiftMailer, (*4)

This bundle faciliates using a database to spool messages to with SwiftMailer and Symfony2., (*5)

At present, it only works with the Doctrine EntityManager and entities managed with this., (*6)

Installation and configuration

1. Install via Composer

``` sh $ composer require "whiteoctober/swiftmailerdbbundle:^1.0", (*7)


### 2. Add the bundle to your application's kernel ``` php // app/AppKernel.php public function registerBundles() { return array( // ... new WhiteOctober\SwiftMailerDBBundle\WhiteOctoberSwiftMailerDBBundle(), // ... ); }

3. Configure the white_october_swift_mailer_db in config.yml

``` yaml white_october_swift_mailer_db: entity_class: AppBundle\Entity\Email, (*8)


Read below about how to construct this entity. ### 4. Tell SwiftMailer to use the database spooler ``` yaml swiftmailer: spool: type: db

That's it for bundle installation and configuration., (*9)

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., (*10)

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

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:, (*12)

``` yaml white_october_swift_mailer_db: keep_sent_messages: true, (*13)


## 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, (*14)

doctrine: orm: entity_managers: default: connection: default auto_mapping: true mail: connection: default mappings: MailBundle: ~ ```, (*15)

Contributing

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

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., (*17)

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

The Versions

08/11 2017

dev-swiftmailerbundle-v3

dev-swiftmailerbundle-v3

Database spooling for SwiftMailer

  Sources   Download

MIT

The Requires

 

swiftmailer doctrine spool

18/07 2017

dev-master

9999999-dev

Database spooling for SwiftMailer

  Sources   Download

MIT

The Requires

 

swiftmailer doctrine spool

25/05 2017

1.1.0

1.1.0.0

Database spooling for SwiftMailer

  Sources   Download

MIT

The Requires

 

swiftmailer doctrine spool

22/08 2016

dev-option-delay-flush

dev-option-delay-flush

Database spooling for SwiftMailer

  Sources   Download

MIT

The Requires

 

swiftmailer doctrine spool

15/12 2014

1.0.4

1.0.4.0

Database spooling for SwiftMailer

  Sources   Download

MIT

The Requires

 

swiftmailer doctrine spool

27/10 2014

1.0.3

1.0.3.0

Database spooling for SwiftMailer

  Sources   Download

MIT

The Requires

 

swiftmailer doctrine spool

05/06 2014

1.0.2

1.0.2.0

Database spooling for SwiftMailer

  Sources   Download

MIT

The Requires

 

swiftmailer doctrine spool

29/08 2013

1.0.1

1.0.1.0

Database spooling for SwiftMailer

  Sources   Download

MIT

The Requires

 

swiftmailer doctrine spool

29/07 2013

1.0.0

1.0.0.0

Database spooling for SwiftMailer

  Sources   Download

MIT

The Requires

 

swiftmailer doctrine spool