2017 © Pedro Peláez
 

symfony-bundle mail-bundle

An easy way to send mail with swiftmailer and twig

image

donkeycode/mail-bundle

An easy way to send mail with swiftmailer and twig

  • Thursday, July 19, 2018
  • by cedriclombardot
  • Repository
  • 4 Watchers
  • 1 Stars
  • 1,268 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 4 Versions
  • 13 % Grown

The README.md

MailBundle

An easy way to send mail with twig and swift, (*1)

Setup

composer require donkeycode/mail-bundle

Add in AppKernel.php, (*2)

new DonkeyCode\MailBundle\DonkeyCodeMailBundle(),

Configuration

donkey_code_mail:
    mail_from: null
    reply_to: null
    options:
        header_bg: '#2d7cff'
        header_txt_color: '#ffffff'
        bg: '#efefef'
        txt_color: '#555555'
        font_family: 'Helvetica Neue'

Usage

Create your twig, (*3)

{% block subject %}
Subject of mail
{% endblock %}

{% block body %}
    {% embed "DonkeyCodeMailBundle:Mails:layout.html.twig" %}
    {# For sf4 #}
    {% embed "@DonkeyCodeMail/Mails/layout.html.twig" %}
        {% block title %}Header{% endblock %}
        {% block content %}
            Body Of mail
        {% endblock %}

    {% endembed %}
{% endblock %}

Send it simply, (*4)

$mailer = $this->getContainer()
    ->get('donkeycode.mailer')
    ->createMessage()
    ->setTemplate('YourBundle:Mails:invoices.html.twig', [
        'invoices' => $invoices,
    ])
    ->setTo($destMail)
    ->send();

The Versions

19/07 2018

dev-swiftmailer3

dev-swiftmailer3

An easy way to send mail with swiftmailer and twig

  Sources   Download

MIT

The Requires

 

by Cedric LOMBARDOT

24/05 2017

dev-master

9999999-dev

An easy way to send mail with swiftmailer and twig

  Sources   Download

MIT

The Requires

 

by Cedric LOMBARDOT

26/11 2016

dev-logo

dev-logo

An easy way to send mail with swiftmailer and twig

  Sources   Download

MIT

The Requires

 

by Cedric LOMBARDOT

24/11 2016

v1.0.0

1.0.0.0

An easy way to send mail with swiftmailer and twig

  Sources   Download

MIT

The Requires

 

by Cedric LOMBARDOT