PHPackages                             georgringer/templatedmail - 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. georgringer/templatedmail

ActiveTypo3-cms-extension

georgringer/templatedmail
=========================

Better HTML email templates

121422[2 issues](https://github.com/georgringer/templatedMail/issues)[1 PRs](https://github.com/georgringer/templatedMail/pulls)PHP

Since Jul 17Pushed 6y ago1 watchersCompare

[ Source](https://github.com/georgringer/templatedMail)[ Packagist](https://packagist.org/packages/georgringer/templatedmail)[ RSS](/packages/georgringer-templatedmail/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (2)Used By (0)

TYPO3 extension `templatedMail`
===============================

[](#typo3-extension-templatedmail)

This extension is a proof of concept how to improve the templating of mails. The plans are to ship this code with TYPO3 10 and provide the extension for 9x.

**Benefits**

- **All** mails share the same layout which makes it easier to style mails
- It is faster to create nice mails

Requirements
------------

[](#requirements)

- TYPO3 10
- PHP 7.2

Usage
-----

[](#usage)

```
$templatedEmail = GeneralUtility::makeInstance(TemplatedEmail::class);
$templatedEmail
    ->to('dummy@example.org')
    ->from(new NamedAddress('noreply@example.org', 'TYPO3'))
    ->subject('A mail')
    ->htmlContent('Hello an example')
    ->textContent('Hello' . LF . 'an example')
    ->send();
```

This example will send one mail with the following parts:

HTML partPlain text part[![HTML](Resources/Public/Screenshots/example-html.png)](Resources/Public/Screenshots/example-html.png)[![Plain](Resources/Public/Screenshots/example-txt.png)](Resources/Public/Screenshots/example-txt.png)Further examples
----------------

[](#further-examples)

The examples can also be called by CLI with `./web/bin/typo3 mail:template`.

### Using a single template file

[](#using-a-single-template-file)

```
$templatedEmail = GeneralUtility::makeInstance(TemplatedEmail::class);
$templatedEmail
    ->to('dummy@example.org')
    ->from(new NamedAddress('noreply@example.org', 'TYPO3'))
    ->subject('A mail')
    ->context(['title' => 'My title'])
    ->htmlTemplateFile('EXT:templatedmail/Resources/Private/Templates/Examples/Example.html')
    ->send();
```

### Using custom template paths

[](#using-custom-template-paths)

```
$templatedEmail = GeneralUtility::makeInstance(TemplatedEmail::class);
$templatedEmail
    ->to('dummy@example.org')
    ->from(new NamedAddress('noreply@example.org', 'TYPO3'))
    ->subject('A mail')
    ->setTemplateRootPaths(['EXT:dummy/Resources/Private/Templates/'])
    ->setLayoutRootPaths(['EXT:dummy/Resources/Private/Layouts/'])
    ->context(['title' => 'My title'])
    ->htmlByTemplate('Examples/Simple')
    ->textByTemplate('Examples/Simple')
    ->send();
```

### Providing custom translations

[](#providing-custom-translations)

```
$templatedEmail = GeneralUtility::makeInstance(TemplatedEmail::class);
$templatedEmail
    ->to('dummy@example.org')
    ->from(new NamedAddress('noreply@example.org', 'TYPO3'))
    ->subject('A mail')
    ->setLanguage('de')
    ->context(['title' => 'My title'])
    ->htmlTemplateFile('EXT:templatedmail/Resources/Private/Templates/Examples/Example.html')
    ->send();
```

```

	{f:translate(languageKey:defaults.language,key:'LLL:EXT:templatedmail/Resources/Private/Language/dummy.xml:good_morning')}, {title}

```

### Adding inline images

[](#adding-inline-images)

Use the provided ViewHelper to attach images properly.

```

```

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

[](#configuration)

The paths are configured in the site configuration

```
templatedMail:
  templateRootPath: EXT:templatedmail/Resources/Private/Templates/
  partialRootPath: EXT:templatedmail/Resources/Private/Partials/
  layoutRootPath: EXT:templatedmail/Resources/Private/Layouts/
```

If a mail is sent via CLI, the used site can be set with `$templatedEmail->setSite($site);`

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 80% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/1d08c176686c8914d32c70d4af388887d738930fdfdf07c7ca9c841ad10ed683?d=identicon)[georgringer](/maintainers/georgringer)

---

Top Contributors

[![georgringer](https://avatars.githubusercontent.com/u/1905663?v=4)](https://github.com/georgringer "georgringer (32 commits)")[![simonschaufi](https://avatars.githubusercontent.com/u/941794?v=4)](https://github.com/simonschaufi "simonschaufi (7 commits)")[![josefglatz](https://avatars.githubusercontent.com/u/2861556?v=4)](https://github.com/josefglatz "josefglatz (1 commits)")

---

Tags

typo3-cms-extensiontypo3-extension

### Embed Badge

![Health badge](/badges/georgringer-templatedmail/health.svg)

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

PHPackages © 2026

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