PHPackages                             eightmarq/mail-template-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. [Mail &amp; Notifications](/categories/mail)
4. /
5. eightmarq/mail-template-bundle

ActiveSymfony-bundle[Mail &amp; Notifications](/categories/mail)

eightmarq/mail-template-bundle
==============================

Mail template bundle is help to build emails easily.

v1.0.1(6mo ago)1229MITPHPPHP &gt;=8.3CI passing

Since Dec 16Pushed 6mo ago1 watchersCompare

[ Source](https://github.com/eightmarq/mail-template-bundle)[ Packagist](https://packagist.org/packages/eightmarq/mail-template-bundle)[ RSS](/packages/eightmarq-mail-template-bundle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (8)Dependencies (10)Versions (9)Used By (0)

Mail template bundle
====================

[](#mail-template-bundle)

Mail template bundle helps to build and send emails from different sources:

```
- Twig
- Database via Doctrine

```

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

[](#installation)

### Install via composer

[](#install-via-composer)

```
composer require schvoy/mail-template-bundle
```

### Required environment variables

[](#required-environment-variables)

- MAILER\_SENDER\_ADDRESS
- MAILER\_SENDER\_NAME
- MAILER\_SIGNATORY

What is MailType?
-----------------

[](#what-is-mailtype)

Imagine `MailTypes` as different kind of emails such as: registration email, forgotten password email etc.

For each type of emails that you want to send you need to create an individual `MailType`.

For each `MailTypes` you could choose a base: TwigBased or DoctrineBased. These traits determine where should get the content for the email.

TwigBased emails
----------------

[](#twigbased-emails)

A `TwigBased` emails can be easily used to send translated emails with a custom template.

### Creating new twig based email type

[](#creating-new-twig-based-email-type)

Twig based emails will automatically populated based on the `$key` value.

```
