cgonser/swiftmailer-database-s3-spool-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

cgonser/swiftmailer-database-s3-spool-bundle

Composer 安装命令:

composer require cgonser/swiftmailer-database-s3-spool-bundle

包简介

A symfony bundle that enables Swift Mailer to spool messages from a database and store message files on Amazon S3

README 文档

README

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.

统计信息

  • 总下载量: 26.08k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-12-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固