PHPackages                             felds/quick-mailer-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. felds/quick-mailer-bundle

ActiveSymfony-bundle

felds/quick-mailer-bundle
=========================

5.1.0(7y ago)0106[3 issues](https://github.com/felds/QuickMailerBundle/issues)MITPHPPHP ^7.1

Since Jun 14Pushed 7y agoCompare

[ Source](https://github.com/felds/QuickMailerBundle)[ Packagist](https://packagist.org/packages/felds/quick-mailer-bundle)[ Docs](https://github.com/felds/QuickMailerBundle)[ RSS](/packages/felds-quick-mailer-bundle/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (8)Versions (22)Used By (0)

QuickMailerBundle
=================

[](#quickmailerbundle)

This bundle provides an easily configurable façade for sending transactional emails without having to build the message from scratch every time.

It has a limited scope by design, it's not infinitely configurable and it's not made to work outside a typical Symfony installation.

Installation
------------

[](#installation)

### Step 0: Before we begin

[](#step-0-before-we-begin)

Under the hood, QuickMailer uses Twig as its template engine, SwiftMailer to actually send the messages and Monolog to keep tabs on what is happening.

Make sure that those three bundles are installed and properly configured.

### Step 1: Download the bundle

[](#step-1-download-the-bundle)

Open a terminal, `cd` into your project directory and execute the following command to download the latest stable version of this bundle:

```
composer require felds/quick-mailer-bundle
```

This command requires you to have Composer installed globally, as explained in the [installation chapter](https://getcomposer.org/doc/00-intro.md)of the Composer documentation.

If you are using Symfony Flex and have contrib recipes enabled, it's all done.

Configuration
-------------

[](#configuration)

*to be done*

Usage
-----

[](#usage)

### Step 1: Create a template

[](#step-1-create-a-template)

Using this bundle, the whole message is composed from a single twig template.

The typical message looks something like this:

```
{# templates/email/cookie.html.twig #}

{% block subject %}
Hey, {{ name|title }}! You've got a cookie!
{% endblock %}

{% block html %}

  {{ name|title }}, take this delicious {{ flavor }} cookie!

{% endblock %}

{% block text %}
{{ name|title }}, take this delicious {{ flavor }} cookie!
{% endblock %}
```

Of course, you can use includes, extends and everything else available on Twig (even your own extensions!). Just keep in mind that each main block (`subject`, `html` and `text`) are rendered separately, and they are not visible to one another. Ex: a `set` declared outside the `html` block will not work inside it.

### Step 2: Add it to the configuration

[](#step-2-add-it-to-the-configuration)

```
# config/packages/felds_quickmailer.yaml
felds_quickmailer:
    # ...
    templates:
        cookie: email/cookie.html.twig
```

### Step 3: Send the email

[](#step-3-send-the-email)

```
