jarjobs/swiftmailerdatabasebundle

Database spooling for SwiftMailer

Installs: 2 748

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 5

Type:symfony-bundle

1.0.5 2019-12-27 23:45 UTC

This package is auto-updated.

Last update: 2021-03-28 03:10:41 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License

This bundle facilitates using a database to spool messages to with SwiftMailer and Symfony 4.

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

Installation and configuration

1. Install via Composer

composer require "jarjobs/swiftmailerdatabasebundle:^1.0"

2. Configure the swiftmailer_database in framework.yml

swiftmailer_database:
    entity_class: App\Entity\Email

Below some about implementation of Email entity.

3. Tell SwiftMailer to use the database spooler

swiftmailer:
    spool:
        type: db

Email entity

You will need to implement EmailInterface from this bundle in entity that be persisted.

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

Optional: keeping sent messages in the database

By default, messages which were successfully sent will be deleted from the db. It's possible to configure the bundle to keep those messages in your framework.yml.

swiftmailer_database:
    keep_sent_messages: true