PHPackages                             utoronto/email-merge - 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. utoronto/email-merge

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

utoronto/email-merge
====================

Token interpolation for email merge operations

0.0.3(9y ago)0485↓93.8%GPL-3.0+PHPPHP &gt;=5.3.0

Since Dec 9Pushed 9y ago1 watchersCompare

[ Source](https://github.com/bsmithlea/email-merge)[ Packagist](https://packagist.org/packages/utoronto/email-merge)[ RSS](/packages/utoronto-email-merge/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (6)Used By (0)

email-merge
===========

[](#email-merge)

PHP component for handling email templates with placeholder tokens. The email templates are assumed to be user-editable. Creating a new template requires declaring the set of allowable placeholder tokens. An exception will be thrown if the template text contains something that looks like a token but which is not expected.

Basic usage
===========

[](#basic-usage)

```
// Define allowed token names
$tokens = new TokenSet(array("USERNAME", "FOO", "BAR"));

// Email subject line may contain tokens also
$subject = "Hello %USERNAME%";

// HTML email body
$htmlBody =  "qq12345",
    "FOO" => "my foo value",
    "BAR" => "my bar value"
);

// A Parser instance will return Template objects containing interpolated values
$result = $parser->getResult($data);
```

Unexpected token
================

[](#unexpected-token)

```
// Define allowed token names
$tokens = new TokenSet(array("USERNAME", "FOO", "BAR"));

// token name not in allowed set
$subject = "Hello %NOT_A_LEGAL_TOKEN%";

// throws UnrecognizedTokenException
$tpl = new Template($subject, "", $tokens);
```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

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

Every ~7 days

Total

4

Last Release

3469d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a5a0cda3e14c7d4da3c48079b7813629056e5f9063161bfe3473a523ba97d17f?d=identicon)[bsmithlea](/maintainers/bsmithlea)

---

Top Contributors

[![bsmithlea](https://avatars.githubusercontent.com/u/23702516?v=4)](https://github.com/bsmithlea "bsmithlea (6 commits)")[![carbontax](https://avatars.githubusercontent.com/u/1197916?v=4)](https://github.com/carbontax "carbontax (3 commits)")

---

Tags

emailtemplateinterpolation

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/utoronto-email-merge/health.svg)

```
[![Health](https://phpackages.com/badges/utoronto-email-merge/health.svg)](https://phpackages.com/packages/utoronto-email-merge)
```

###  Alternatives

[lorenzo/pinky

A Foundation for Emails (Inky) template transpiler

29314.3M14](/packages/lorenzo-pinky)[larablocks/pigeon

A more flexible email message builder for Laravel 5 including chained methods, reusable message configurations, and message layout and template view management.

143.7k](/packages/larablocks-pigeon)

PHPackages © 2026

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