2017 © Pedro Peláez
 

symfony-bundle mandrill-bundle

Symfony HipMandrillBundle Fork

image

astonishdesign/mandrill-bundle

Symfony HipMandrillBundle Fork

  • Saturday, January 24, 2015
  • by jmoughon
  • Repository
  • 3 Watchers
  • 0 Stars
  • 13 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 45 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

HipMandrillBundle Fork

Send transactional mail through mandrill.com. This bundle provides an easy api for Symfony2 Projects., (*1)

All settings inside message class represent attributes of Mandrill's API. Please refer to their API documentation for Details:, (*2)

https://mandrillapp.com/api/docs/messages.html, (*3)

Prerequisites

Before you're able to use this bundle you must sign up with Mandrill., (*4)

http://mandrill.com, (*5)

Mandrill is a great way to send your transactional emails and provides detailed advances reports., (*6)

Mandrill is free for limited number of email per day, please read through pricing section on the website for more information:, (*7)

http://mandrill.com/pricing/, (*8)

Installation

Add the bundle to your composer.json, (*9)

# composer.json
{
 "require": {
     "hipaway-travel/mandrill-bundle": "dev-master",
 }
}

Run composer install, (*10)

php ./composer.phar install

Enable the bundle in the kernel, (*11)

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Hip\MandrillBundle\HipMandrillBundle(),
    );
}

Configuration

Add configuration to config.yml., (*12)

Log in to Mandrill and go to "Settings" -> "SMTP and API Credentials". Create an API Key and use it in your Symfony2 Configuration., (*13)

# config.yml

hip_mandrill:
    api_key: xxxxx
    disable_delivery: true # useful for dev/test environment. Default value is 'false'
    default:
        sender: info@example.com
        sender_name: John Doe
        subaccount: Project # Optionally define a subaccount to use

To override the FOSUserBundle Mailer:, (*14)

# config.yml
fos_user:
    # ...
    service:
        mailer: hip_mandrill.fosuser.mailer

Now you're all set, send your first transactional mails:, (*15)

Use

Simple controller Example:, (*16)


<?php // src/Hip/ExampleBundle/Controller/ExampleController.php namespace Hip\ExampleBundle\Controller; use Symfony\Component\HttpFoundation\Response; use Hip\MandrillBundle\Message; use Hip\MandrillBundle\Dispatcher; class ExampleController { public function indexAction() { $dispatcher = $this->get('hip_mandrill.dispatcher'); $message = new Message(); $message ->setFromEmail('mail@example.com') ->setFromName('Customer Care') ->addTo('max.customer@email.com') ->setSubject('Some Subject') ->setHtml('<html><body><h1>Some Content</h1></body></html>') ->setSubaccount('Project'); $result = $dispatcher->send($message); return new Response('<pre>' . print_r($result, true) . '</pre>'); } }

The Versions

24/01 2015

dev-master

9999999-dev https://github.com/Hipaway-Travel/HipMandrillBundle

Symfony HipMandrillBundle Fork

  Sources   Download

MIT

The Requires

 

email messages mandrill transaction mail transactional

09/01 2015
01/08 2014
23/07 2014
03/05 2013
23/01 2013

0.1.x-dev

0.1.9999999.9999999-dev https://github.com/Hipaway-Travel/HipMandrillBundle

Symfony HipMandrillBundle

  Sources   Download

MIT

The Requires

 

email messages mandrill transaction mail transactional