PHPackages                             1tomany/twig-mailto - 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. 1tomany/twig-mailto

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

1tomany/twig-mailto
===================

A Twig extension for safely generating mailto links

v0.0.2(1y ago)070MITPHPPHP &gt;=8.1

Since Mar 17Pushed 1y ago2 watchersCompare

[ Source](https://github.com/1tomany/twig-mailto)[ Packagist](https://packagist.org/packages/1tomany/twig-mailto)[ RSS](/packages/1tomany-twig-mailto/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (3)Used By (0)

Twig Extension for Generating `mailto:` Links
=============================================

[](#twig-extension-for-generating-mailto-links)

This Twig extension allows you to easily create `mailto:` links in your templates.

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

[](#installation)

Install the library with Composer:

```
composer require 1tomany/twig-mailto

```

Tag the `OneToMany\Twig\MailtoExtension` as a Twig extension in your services configuration:

```
services:
    OneToMany\Twig\MailtoExtension:
        tags: [twig.extension]
```

Usage
-----

[](#usage)

This extension exposes a single function named `mailto()` with the following signature:

```
function mailto(string $email, string $subject = '', string $content = ''): string;
```

In your Twig template, create a `mailto:` link by calling it like this:

```

  Email us for help

```

This will generate the following value:

```
mailto:contact@example.com?subject=I%20need%20help%21&amp;body=Please%20help%20me.%20Thank%20you%21
```

Testing
-------

[](#testing)

```
./vendor/bin/phpunit
```

Credits
-------

[](#credits)

- [Vic Cherubini](https://github.com/viccherubini), [1:N Labs, LLC](https://1tomany.com)

License
-------

[](#license)

The MIT License

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance49

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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 ~51 days

Total

2

Last Release

369d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4871f120e982df7aeb48003aadb2484606a34329e4946570f48f9be3e2138aec?d=identicon)[viccherubini](/maintainers/viccherubini)

---

Top Contributors

[![viccherubini](https://avatars.githubusercontent.com/u/60762?v=4)](https://github.com/viccherubini "viccherubini (12 commits)")

---

Tags

twightmlmailto

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/1tomany-twig-mailto/health.svg)

```
[![Health](https://phpackages.com/badges/1tomany-twig-mailto/health.svg)](https://phpackages.com/packages/1tomany-twig-mailto)
```

###  Alternatives

[twig/string-extra

A Twig extension for Symfony String

21946.0M133](/packages/twig-string-extra)[twig/markdown-extra

A Twig extension for Markdown

12114.3M83](/packages/twig-markdown-extra)[twig/html-extra

A Twig extension for HTML

777.6M41](/packages/twig-html-extra)[twig/cache-extra

A Twig extension for Symfony Cache

392.1M20](/packages/twig-cache-extra)[spress/spress

Static site generator with blogs support

37436.2k](/packages/spress-spress)[nochso/html-compress-twig

Twig extension for compressing HTML and inline CSS/Javascript

84468.6k8](/packages/nochso-html-compress-twig)

PHPackages © 2026

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