PHPackages                             rauwebieten/twigmailer - 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. [Templating &amp; Views](/categories/templating)
4. /
5. rauwebieten/twigmailer

ActiveLibrary[Templating &amp; Views](/categories/templating)

rauwebieten/twigmailer
======================

1.0.0-alpha(9y ago)4156PHPPHP &gt;=5.4.0

Since Jun 12Pushed 3y ago1 watchersCompare

[ Source](https://github.com/rauwebieten/twigmailer)[ Packagist](https://packagist.org/packages/rauwebieten/twigmailer)[ RSS](/packages/rauwebieten-twigmailer/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (1)Dependencies (5)Versions (2)Used By (0)

TwigMailer
==========

[](#twigmailer)

Send mails with PHPMailer and a Twig template.

- Uses a PHPMailer instance for sending the mail
- Uses a Twig Environment to render templates
- Creates a text version from the HTML version
- If linked CSS files are found in the HTML, they are loaded and converted to inline styles
- Sets the subject from the HTML title tag

Installation
============

[](#installation)

Install with composer/packagist

`composer require rauwebieten/twigmailer`

Basic usage
-----------

[](#basic-usage)

Make sure you have a configured PHPMailer instance. Check the PHPMailer documentation for details.

```
$loader = new \Twig\Loader\FilesystemLoader(__DIR__ . '/templates');
$twig = new \Twig\Environment($loader);
```

Make sure you have a configured Twig Environment instance. Check the Twig documentation for details.

```
$phpMailer = new \PHPMailer();
$phpMailer->Mailer = 'mail';
$phpMailer->setFrom('me@example.com', 'Me');
```

Create a TwigMailer instance

```
$mailer = new \RauweBieten\TwigMailer\TwigMailer($phpMailer, $twig);
```

Create content from the template

```
$mailer->create('some-template.html.twig', [
    'some-variable' => 'Some value'
]);
```

And send the mail

```
$mailer->getPhpMailer()->addAddress('someone@example.com', 'Someone');
$mailer->send();
```

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 54.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3306d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/11740475?v=4)[Peter ](/maintainers/rauwebieten)[@rauwebieten](https://github.com/rauwebieten)

---

Top Contributors

[![peter-kinamo](https://avatars.githubusercontent.com/u/20679429?v=4)](https://github.com/peter-kinamo "peter-kinamo (6 commits)")[![rauwebieten](https://avatars.githubusercontent.com/u/11740475?v=4)](https://github.com/rauwebieten "rauwebieten (5 commits)")

---

Tags

mailsphpphpmailertwig

### Embed Badge

![Health badge](/badges/rauwebieten-twigmailer/health.svg)

```
[![Health](https://phpackages.com/badges/rauwebieten-twigmailer/health.svg)](https://phpackages.com/packages/rauwebieten-twigmailer)
```

###  Alternatives

[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.6k38.2k](/packages/matomo-matomo)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
