Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Swiftmailer Database S3 Spool Bundle Laravel Package

cgonser/swiftmailer-database-s3-spool-bundle

View on GitHub
Deep Wiki
Context7

Swift Mailer Database S3 Spool

A Symfony bundle that enables Swift Mailer to spool messages from a database and store message files on an Amazon S3 bucket.

It requires the AWS PHP SDK and relies on Doctrine for data persistency.

Installation

This bundle can be installed via Composer by requiring cgonser/swiftmailer-database-s3-spool-bundle package in your project's composer.json:

{
    "require": {
        "cgonser/swiftmailer-database-s3-spool-bundle": "dev-master"
    }
}

Then, enable the bundle by adding it to the list of registered bundles in the app/AppKernel.php file of your project:

<?php
// app/AppKernel.php

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = [
            // ...

            new Cgonser\SwiftMailerDatabaseS3SpoolBundle\CgonserSwiftMailerDatabaseS3SpoolBundle(),
        ];
    }
}

Configuration

Please remember to first configure the AWS SDK accordingly. Once it's properly configured, you can place this bundle configuration in app/config/config.yml file.

cgonser_swift_mailer_database_s3_spool:
    s3:
        bucket: "<TARGET BUCKET>"
        region: "<S3 REGION>"
        folder: "<TARGET FOLDER>" (optional)

You can optionally include specific credentials configurations for the s3 client, as follows:

cgonser_swift_mailer_database_s3_spool:
    s3:
        credentials:
            key: "<AWS_ACCESS_KEY_ID>"
            secret: "<AWS_SECRET_ACCESS_KEY>"

Still in app/config/config.yml, enable the services and change the swift mailer spool configuration:

imports:
    // ...
    - { resource: "@CgonserSwiftMailerDatabaseS3SpoolBundle/Resources/config/services.yml" }
swiftmailer:
    // ...
    spool: { type: db_s3 }

You can also provide specific AWS credentials for this bucket, if you want to:

cgonser_swift_mailer_database_s3_spool:
    s3:
        bucket: "<TARGET BUCKET>"
        region: "<BUCKET REGION>"
        key: "<YOUR AWS KEY>"
        secret: "<YOUR AWS SECRET>"

After finishing the configuration, you will need to update your database schema to create the entity necessary to store the spooler queue.

php bin/console doctrine:schema:update

Mail Queue Entity

By default, the mail queue will be stored in a table named cgonser_mail_queue, but you can override the default entity. To do so, you will need to create a new entity with the same structure of the default one (which you can find inside the package at Entity/MailQueue.php) and change its name and/or definition.

After that, you will need to inform the bundle about the new entity, using the following configuration in app/config/config.yml:

cgonser_swift_mailer_database_s3_spool:
    entity_class: "<YOUR NEW ENTITY>" (e.g.: \AppBundle\Entity\MailQueue)

Keep in mind that this bundle relies on the default entity structure and modifying that may break it.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
comsave/common
alecsammon/php-raml-parser
chrome-php/wrench
lendable/composer-license-checker
typhoon/reflection
mesilov/moneyphp-percentage
mike42/gfx-php
bookdown/themes
aura/view
aura/html
aura/cli
povils/phpmnd
nayjest/manipulator
omnipay/tests
psr-mock/http-message-implementation
psr-mock/http-factory-implementation
psr-mock/http-client-implementation
voku/email-check
voku/urlify
rtheunissen/guzzle-log-middleware