2017 © Pedro Peláez
 

symfony-bundle mailer-bundle

Happyr MailerBundle lets you send nice HTML emails. Use a twig template to design your emails. You may even use attachments.

image

happyr/mailer-bundle

Happyr MailerBundle lets you send nice HTML emails. Use a twig template to design your emails. You may even use attachments.

  • Friday, July 6, 2018
  • by Nyholm
  • Repository
  • 2 Watchers
  • 7 Stars
  • 2,206 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 25 Versions
  • 11 % Grown

The README.md

Happyr Mailer Bundle

Happyr Mailer Bundle makes it easier to send HTML emails with your Symfony2 application. This bundle supports template rendering and sending attachments., (*1)

Installation

Step 1: Using Composer

Install it with Composer!, (*2)

composer require happyr/mailer-bundle

Step 2: Register the bundle

To register the bundles with your kernel:, (*3)

<?php

// in AppKernel::registerBundles()
$bundles = array(
    // ...
    new Happyr\MailerBundle\HappyrMailerBundle(),
    // ...
);

Step 3: Configure the bundle

``` yaml, (*4)

app/config/config.yml

happyr_mailer: // ... from: email: you@company.com name: Your name, (*5)


You find a the full configuration reference [here][3]. ## Usage ``` php <?php // AnyController.php public function anyAction(){ $mailer=$this->get('happyr.mailer'); $mailer->send('me@domain.com','AnyBundle:Email:test.html.twig'); }

Attachments: If you want to send attachments you need to add them the the parameters array. ``` php $this->send($mail, $template, array('user'=>$user, 'attachments'=> array( //two attachments. You must specify either 'data' or 'path' array( 'data'=>$bindaryPdf, 'contentType'=>'application/pdf', 'filename'=>'Invoice.pdf', ), array( 'path'=>$pathToPdf, 'contentType'=>'application/pdf', 'filename'=>'Welcome.pdf', ), )));, (*6)


**Message headers:** You can add extra headers on the message if you like ``` php $this->send($mail, $template, array('user'=>$user, 'message_headers'=> array( 'X-Mailgun-Variables' => json_encode(['foobar'=>'baz']) )));

Send emails from Symfony command

If you want to send emails from a Symfony2 command you are often getting errors like: You cannot create a service ("request") of an inactive scope ("request"). or You cannot create a service ("templating.helper.assets") of an inactive scope ("request")., (*7)

The error occur because you don't have access to a Request object. This bundle help you to fake a Request object. You need to change some config:, (*8)

``` yaml, (*9)

app/config/config.yml

happyr_mailer: fake_request: true #default value is false, (*10)


If a request object does not exists we will help you to create it. ## Changelog **1.3.0** It is not possible to send emails from a console command without getting errors like: "You cannot create a service ("request") of an inactive scope ("request")." **1.2.0** You will no logner get exceptions from switft. If you want to catch exceptions use Happyr\MailerBundle\Exceptions\MailException. You may now choose how error are handeled by using the error_tyoe config. ``` yaml # app/config/config.yml happyr_mailer: error_type: 'exception' #other possible values are 'error', 'warning', 'notice' and 'none'

The Versions

06/07 2018

dev-master

9999999-dev http://developer.happyr.com/symfony2-bundles/happyr-mailer-bundle

Happyr MailerBundle lets you send nice HTML emails. Use a twig template to design your emails. You may even use attachments.

  Sources   Download

MIT

The Requires

 

The Development Requires

mail html mail management

06/07 2018

2.1.5

2.1.5.0 http://developer.happyr.com/symfony2-bundles/happyr-mailer-bundle

Happyr MailerBundle lets you send nice HTML emails. Use a twig template to design your emails. You may even use attachments.

  Sources   Download

MIT

The Requires

 

The Development Requires

mail html mail management

07/08 2017

2.1.4

2.1.4.0 http://developer.happyr.com/symfony2-bundles/happyr-mailer-bundle

Happyr MailerBundle lets you send nice HTML emails. Use a twig template to design your emails. You may even use attachments.

  Sources   Download

MIT

The Requires

 

The Development Requires

mail html mail management

30/05 2017

2.1.3

2.1.3.0 http://developer.happyr.com/symfony2-bundles/happyr-mailer-bundle

Happyr MailerBundle lets you send nice HTML emails. Use a twig template to design your emails. You may even use attachments.

  Sources   Download

MIT

The Requires

 

The Development Requires

mail html mail management

18/01 2017

2.1.2

2.1.2.0 http://developer.happyr.com/symfony2-bundles/happyr-mailer-bundle

Happyr MailerBundle lets you send nice HTML emails. Use a twig template to design your emails. You may even use attachments.

  Sources   Download

MIT

The Requires

 

The Development Requires

mail html mail management

07/04 2016

2.1.1

2.1.1.0 http://developer.happyr.com/symfony2-bundles/happyr-mailer-bundle

Happyr MailerBundle lets you send nice HTML emails. Use a twig template to design your emails. You may even use attachments.

  Sources   Download

MIT

The Requires

 

The Development Requires

mail html mail management

12/11 2015

2.1.0

2.1.0.0 http://developer.happyr.com/symfony2-bundles/happyr-mailer-bundle

Happyr MailerBundle lets you send nice HTML emails. Use a twig template to design your emails. You may even use attachments.

  Sources   Download

MIT

The Requires

 

The Development Requires

mail html mail management

04/05 2015

2.0.3

2.0.3.0 http://developer.happyr.com/symfony2-bundles/happyr-mailer-bundle

Happyr MailerBundle lets you send nice HTML emails. Use a twig template to design your emails. You may even use attachments.

  Sources   Download

MIT

The Requires

 

The Development Requires

mail html mail management

29/04 2015

2.0.2

2.0.2.0 http://developer.happyr.com/symfony2-bundles/happyr-mailer-bundle

Happyr MailerBundle lets you send nice HTML emails. Use a twig template to design your emails. You may even use attachments.

  Sources   Download

MIT

The Requires

 

The Development Requires

mail html mail management

17/04 2015

2.0.1

2.0.1.0 http://developer.happyr.com/symfony2-bundles/happyr-mailer-bundle

Happyr MailerBundle lets you send nice HTML emails. Use a twig template to design your emails. You may even use attachments.

  Sources   Download

MIT

The Requires

 

The Development Requires

mail html mail management

17/04 2015

2.0.0

2.0.0.0 http://developer.happyr.com/symfony2-bundles/happyr-mailer-bundle

Happyr MailerBundle lets you send nice HTML emails. Use a twig template to design your emails. You may even use attachments.

  Sources   Download

MIT

The Requires

 

The Development Requires

mail html mail management

14/07 2014

1.2.8

1.2.8.0 http://developer.happyr.com/symfony2-bundles/happyr-mailer-bundle

HappyR MailerBundle lets you send nice HTML emails. Use a twig template to design your emails. You may even use attachments.

  Sources   Download

MIT

The Requires

 

The Development Requires

mail html mail management

11/06 2014

1.2.7

1.2.7.0 http://developer.happyr.se/symfony2-bundles/happyr-mailer-bundle

HappyR MailerBundle lets you send nice HTML emails. Use a twig template to design your emails. You may even use attachments.

  Sources   Download

MIT

The Requires

 

The Development Requires

mail html mail management

26/05 2014

1.2.6

1.2.6.0 http://developer.happyr.se/symfony2-bundles/happyr-mailer-bundle

HappyR MailerBundle lets you send nice HTML emails. Use a twig template to design your emails. You may even use attachments.

  Sources   Download

MIT

The Requires

 

The Development Requires

mail html mail management

09/11 2013

1.2.5

1.2.5.0 http://developer.happyr.se/symfony2-bundles/happyr-mailer-bundle

HappyR MailerBundle lets you send nice HTML emails. Use a twig template to design your emails. You may even use attachments.

  Sources   Download

MIT

The Requires

 

The Development Requires

mail html mail management

20/09 2013

1.2.4

1.2.4.0 http://developer.happyr.se/symfony2-bundles/happyr-mailer-bundle

HappyR MailerBundle lets you send nice HTML emails. Use a twig template to design your emails. You may even use attachments.

  Sources   Download

MIT

The Requires

 

The Development Requires

mail html mail management

19/09 2013

1.2.3

1.2.3.0 http://developer.happyr.se/symfony2-bundles/happyr-mailer-bundle

HappyR MailerBundle lets you send nice HTML emails. Use a twig template to design your emails. You may even use attachments.

  Sources   Download

MIT

The Requires

 

The Development Requires

mail html mail management

10/08 2013

1.2.2

1.2.2.0 http://developer.happyr.se/symfony2-bundles/happyr-mailer-bundle

HappyR MailerBundle lets you send nice HTML emails. Use a twig template to design your emails. You may even use attachments.

  Sources   Download

MIT

The Requires

 

The Development Requires

mail html mail management

10/08 2013

1.2.1

1.2.1.0 http://developer.happyr.se/symfony2-bundles/happyr-mailer-bundle

HappyR MailerBundle lets you send nice HTML emails. Use a twig template to design your emails. You may even use attachments.

  Sources   Download

MIT

The Requires

 

The Development Requires

mail html mail management

10/08 2013

1.2.0

1.2.0.0 http://developer.happyr.se/symfony2-bundles/happyr-mailer-bundle

HappyR MailerBundle lets you send nice HTML emails. Use a twig template to design your emails. You may even use attachments.

  Sources   Download

MIT

The Requires

 

The Development Requires

mail html mail management

10/07 2013

1.1.0

1.1.0.0 http://developer.happyr.se/symfony2-bundles/happyr-mailer-bundle

HappyR MailerBundle lets you send nice HTML emails. Use a twig template to design your emails. You may even use attachments.

  Sources   Download

MIT

The Requires

 

The Development Requires

mail html mail management

07/07 2013

1.0.3

1.0.3.0 http://developer.happyr.se/symfony2-bundles/happyr-mailer-bundle

HappyR MailerBundle lets you send nice HTML emails. Use a twig template to design your emails. You may even use attachments.

  Sources   Download

MIT

The Requires

 

The Development Requires

mail html mail management

01/07 2013

1.0.2

1.0.2.0 http://developer.happyr.se

HappyR MailerBundle lets you send nice HTML emails. Use a twig template to design your emails. You may even use attachments.

  Sources   Download

MIT

The Requires

 

The Development Requires

mail html mail management

01/07 2013

1.0.1

1.0.1.0 http://developer.happyr.se

HappyR MailerBundle lets you send nice HTML emails. Use a twig template to design your emails. You may even use attachments.

  Sources   Download

MIT

The Requires

 

The Development Requires

mail html mail management

01/07 2013

1.0.0

1.0.0.0 http://developer.happyr.se

HappyR MailerBundle lets you send nice HTML emails. Use a twig template to design your emails. You may even use attachments.

  Sources   Download

MIT

The Requires

 

The Development Requires

mail html mail management