2017 © Pedro Peláez
 

symfony-bundle mailjet-bundle

Symfony MailjetBundle

image

uneak/mailjet-bundle

Symfony MailjetBundle

  • Thursday, January 8, 2015
  • by uneak
  • Repository
  • 1 Watchers
  • 1 Stars
  • 279 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 4 % Grown

The README.md

Uneak Mailjet Bundle

The Uneak Mailjet Bundle is a bundle used to help us to exploit the Mailjet API:, (*1)

It includes an refactored version of Mailjet API client (found on https://www.mailjet.com/plugin/php-mailjet.class.php) with:, (*2)

  • PSR-0 standards
  • A bundle configuration

Prerequisites

This version of the bundle requires Symfony 2.1+., (*3)

Installation

Download UneakMailjetBundle using composer

Add UneakMailjetBundle in your composer.json:, (*4)

{
    "require": {
        "uneak/mailjet-bundle": "dev-master"
    }
}

Now tell composer to download the bundle by running the command:, (*5)

``` bash $ php composer.phar update uneak/mailjet-bundle, (*6)


Composer will install the bundle to your project's `vendor/uneak` directory. ### Enable the Bundle Enable the bundle in the kernel: ``` php <?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new Uneak\MailjetBundle\MailjetBundle(), ); }

Configure Mailjet

In your config.yml:, (*7)

``` yml mailjet: api_key: %mailjet_api_key% api_secret: %mailjet_api_secret%, (*8)



### Usage The API is available with the "mailjet.email" service. In your controller (or elsewhere): ``` php $email = $this->get("mailjet.email"); $email ->setSender(new EmailUser("some@email.com", "Some Name")) ->addReceiver(new EmailUser("some@email.com", "Some Name")) ->addReceiver(new EmailUser("some@email.com", "Some Name")) ->addCCReceiver(new EmailUser("some@email.com", "Some Name")) ->setSubject("{{ hello }} {{ user.name }} at {{ user.email }}") ->setBody("SomeBundle:Mail:test.html.twig") //->setBody("Hi {{ user.name }} at {{ user.email }}") ->addParameter('hello', 'Salut') ->setHtml(true) ->sendOneByOne() ;

or php $email = $this->get("mailjet.email"); $email ->setSender(new EmailUser("some@email.com", "Some Name")) ->addReceiver(new EmailUser("some@email.com", "Some Name")) ->addReceiver(new EmailUser("some@email.com", "Some Name")) ->addCCReceiver(new EmailUser("some@email.com", "Some Name")) ->setSubject("{{ hello }} everybody") ->setBody("SomeBundle:Mail:test.html.twig") //->setBody("Hello everybody") ->addParameter('hello', 'Hi') ->setHtml(true) ->send() ;, (*9)

The Versions

08/01 2015

dev-master

9999999-dev https://github.com/uneak/MailjetBundle

Symfony MailjetBundle

  Sources   Download

MIT

The Requires

 

The Development Requires

api mail email message mailjet

22/09 2014

dev-develop

dev-develop https://github.com/uneak/MailjetBundle

Symfony MailjetBundle

  Sources   Download

MIT

The Requires

 

The Development Requires

api mail email message mailjet