2017 © Pedro Peláez
 

symfony-bundle swiftmailer-send-grid-bundle

Swiftmailer Transport and Symfony bundle for Sendgrid

image

expertcoder/swiftmailer-send-grid-bundle

Swiftmailer Transport and Symfony bundle for Sendgrid

  • Friday, July 27, 2018
  • by expertcoder
  • Repository
  • 2 Watchers
  • 6 Stars
  • 1,220 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 7 Forks
  • 1 Open issues
  • 8 Versions
  • 84 % Grown

The README.md

Freelance Banner, (*1)

SwiftmailerSendGridBundle

Latest Version Software License Build Status, (*2)

Symfony bundle for SendGrid. Utilizes the SendGrid PHP Library https://github.com/sendgrid/sendgrid-php to make it compatiable with SwiftMailer., (*3)

Older version (1.x) can be found here: https://github.com/expertcoder/SwiftmailerSendGridBundle/tree/1.x, (*4)

Installation

composer require expertcoder/swiftmailer-send-grid-bundle, (*5)

or manually, (*6)

composer.json, (*7)

"require": {
    ...
    "expertcoder/swiftmailer-send-grid-bundle": "~2.0"
}

config/packages/swiftmailer.yaml, (*8)

swiftmailer:
    transport: expertcoder_swift_mailer.send_grid

Don't forget to set your Sendgrid API Key in your .env file, and that you can set your mail's categories from config/packages/expert_coder_swiftmailer_send_grid.yaml, (*9)

Applications that don't use Symfony Flex

AppKernel.php, (*10)

$bundles = [
    // ...
    new ExpertCoder\Swiftmailer\SendGridBundle\ExpertCoderSwiftmailerSendGridBundle(),
];

parameters.yml.dist, (*11)

parameters:
    sendgrid_api_key: PleaseEnterSendGridApiKey

config.yml, (*12)

swiftmailer:
    transport: expertcoder_swift_mailer.send_grid

expert_coder_swiftmailer_send_grid:
    api_key: %sendgrid_api_key%
    categories: [my_category] # optional, will be added to all mails sent (can be seen on sendgrid dashboard)

Symfony 3

Since Symfony 3.2, you must name the custom transport service swiftmailer.mailer.transport.< name > so you can use one of the solutions below:, (*13)

services.yml, (*14)

services:
    swiftmailer.mailer.transport.expertcoder_swift_mailer.send_grid.transport:
      alias: expertcoder_swift_mailer.send_grid.transport

OR, (*15)

config.yml, (*16)

swiftmailer:
    transport: 'swiftmailer.mailer.transport.expertcoder_swift_mailer.send_grid'

Tests

This bundle provide a little helper to launch tests locally and here is a quick explanation:, (*17)

  • The config_test.yml file contains configuration associated with the bundle.
  • The manual-test.sh helps you test against a specific symfony version and is the main helper to execute tests. You just have to do sh tests/manual-test.sh versionNumber where versionNumber is the main Symfony version you want to test (ex: 4)
  • The last file contains PhpUnit tests with help of nyholm/symfony-bundle-test. Note that we set a timeout of 1sec when sending mail to sendgrid as we do not test the actual sendgrid API with a real key.

Important !

Following RFC 1341, section 7.2, if either text/html or text/plain are to be sent in your email: text/plain needs to be first, followed by text/html, followed by any other content., (*18)

For more informations, please see SwiftMailer and RFC 1341, (*19)

The Versions

06/06 2018

2.0.0

2.0.0.0 https://github.com/expertcoder/SwiftmailerSendGridBundle

Swiftmailer Transport and Symfony bundle for Sendgrid

  Sources   Download

MIT

The Requires

 

The Development Requires

by Samual Anthony

24/04 2018

1.x-dev

1.9999999.9999999.9999999-dev https://github.com/expertcoder/SwiftmailerSendGridBundle

Swiftmailer Transport and Symfony bundle for Sendgrid

  Sources   Download

MIT

The Requires

 

The Development Requires

by Samual Anthony

18/02 2018

dev-travis-ci

dev-travis-ci https://github.com/expertcoder/SwiftmailerSendGridBundle

Swiftmailer Transport and Symfony bundle for Sendgrid

  Sources   Download

MIT

The Requires

 

The Development Requires

by Samual Anthony

18/02 2018

1.1.0

1.1.0.0 https://github.com/expertcoder/SwiftmailerSendGridBundle

Swiftmailer Transport and Symfony bundle for Sendgrid

  Sources   Download

MIT

The Requires

 

The Development Requires

by Samual Anthony

13/02 2018

1.0.0

1.0.0.0 https://github.com/expertcoder/SwiftmailerSendGridBundle

Swiftmailer Transport and Symfony bundle for Sendgrid

  Sources   Download

The Requires

 

by Samual Anthony