2017 © Pedro Peláez
 

library notifier-bundle

Notifier bundle for Symfony 2

image

imag/notifier-bundle

Notifier bundle for Symfony 2

  • Monday, February 3, 2014
  • by BorisMorel
  • Repository
  • 1 Watchers
  • 0 Stars
  • 3,674 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 3 % Grown

The README.md

NotifierBundle

NotifierBundle implements the most essential and basic functionalities of Swift_Mailer. The best way, is to sent a Html mail with Twig templating engine. You can also add many attachments at the mail., (*1)

Contact

Nick: aways
IRC: irc.freenode.net - #sf-grenoble

Install

  1. Download with composer
  2. Enable
  3. Configure
  4. Use it

Download

Add NotifierBundle in your project's composer.json, (*2)

{
    "require": {
        "imag/notifier-bundle": "1.0.*@stable"
    }
}

Enable

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new IMAG\NotifierBundle\IMAGNotifierBundle(),
    );
}

Configure

All next parameters are a default value., (*3)

#config.yml
imag_notifier:
    default_from: fqdn@d.tld
    default_subject: Defaul subject
    subject_prefix: "[Application][Tag] " #Default ''(empty string)

Use it

Html mail

$notifier = $this->get('imag_notifier.provider');

$html = $notifier->createHtmlMessage();

$attach = $notifier->createAttachment();
$attach
    ->loadFile('/tmp/toto')
    ->setFilename('toto.txt')
    ->setMimeType('application/txt')
    ;
$html->addAttachment($attach);

$attach = $notifier->createAttachment();
$attach->setData('Your content');
$html->addAttachment($attach);

$html
    ->addTo('foo@d.tld')
    ->addCc('foo@d.tld')
    ->setBcc(array(
        'foo@d1.tld',
    ))
    ->addBcc('foo@d2.tld')
    ->setSubject('Foo')
    ->setTemplate('IMAGYourBundle:Mail:contact.html.twig', array(
        'name' => 'toto',
        'subject' => 'subject',
        'date' => new \Datetime(),
        'body' => 'body',
    ))
    ;

$notifier->send($html);

Create basic mail

$notifier = $this->get('imag_notifier.provider');

$html = $notifier->createMessage();

The Versions

03/02 2014

dev-master

9999999-dev http://github.com/BorisMorel/NotifierBundle

Notifier bundle for Symfony 2

  Sources   Download

CeCILL

The Requires

 

26/01 2014

1.0.x-dev

1.0.9999999.9999999-dev http://github.com/BorisMorel/NotifierBundle

Notifier bundle for Symfony 2

  Sources   Download

CeCILL

The Requires

 

26/01 2014

v1.0.1

1.0.1.0 http://github.com/BorisMorel/NotifierBundle

Notifier bundle for Symfony 2

  Sources   Download

CeCILL

The Requires

 

04/11 2013

v1.0.0

1.0.0.0 http://github.com/BorisMorel/NotifierBundle

Notifier bundle for Symfony 2

  Sources   Download

CeCILL

The Requires