PHPackages                             ronrademaker/mailer - 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. ronrademaker/mailer

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

ronrademaker/mailer
===================

Wrapper around Swiftmailer

1.2.0(8y ago)01.5k3[1 issues](https://github.com/RonRademaker/Mailer/issues)MITPHP

Since Nov 24Pushed 8y ago1 watchersCompare

[ Source](https://github.com/RonRademaker/Mailer)[ Packagist](https://packagist.org/packages/ronrademaker/mailer)[ RSS](/packages/ronrademaker-mailer/feed)WikiDiscussions master Synced 2mo ago

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

Mailer
======

[](#mailer)

Wrapper around Swiftmail.

Usage
=====

[](#usage)

The mailer wrapper can be used without any knowledge of Swift Mailer, or by using the full power by creating your own Swift\_Message.

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

[](#installation)

```
composer require ronrademaker/mailer

```

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

[](#configuration)

Assuming you'll want to register the mailer in a DIC, Symfony XML example:

```

    [LOCATION OF YOUR TEMPLATES]

      [ADD YOUR OPTIONS]

      %mailer_twig.path%

      %mailer_twig.options%

```

Sending mails with twig template
--------------------------------

[](#sending-mails-with-twig-template)

### Example template

[](#example-template)

```
{% block subject 'My Mail Subject' %}

{% block body_html %}
  Some mail with HTML formatting
{% endblock %}

{% block body_text %}
  Some mail in boring plain text
{% endblock %}

```

### Send the mail

[](#send-the-mail)

```
$mailer->sendEmail(['example@example.org' => 'Example Receiver'], 'sender@example.org' => 'Example Sender', 'my_twig_template');

```

Send a Swift Message
--------------------

[](#send-a-swift-message)

Create your message in $message and

```
$mailer->sendMessage($message);

```

Retrieving receivers from objects
---------------------------------

[](#retrieving-receivers-from-objects)

It is possible to use a Determiner to retrieve the receivers (email/name) from an email configuration. For instance from an object:

```
$profile = new Profile();
$profile->setEmail('foobarz@example.com');
$profile->setFullName('Foo Barz');

$emailConfiguration = ['{{email}}' => '{{full_name'}}];
$determiner = new RonRademaker\Mailer\Receiver\Determiner();
$receiver = $determiner->getReceivers($profile, null, $emailConfiguration);
// results in ['foobarz@example.com' => 'Foo Barz'];
```

Or an object with chained field configuration:

```
$profile = new Profile();
$profile->setEmail('foobarz@example.com');
$profile->setFullName('Foo Barz');
$company = new Company();
$company->setContactperson($profile);

$emailConfiguration = ['email' => '{{contactperson.email}}', 'name' => '{{contactperson.full_name'}}];
$determiner = new RonRademaker\Mailer\Receiver\Determiner();
$receiver = $determiner->getReceivers($company, null, $emailConfiguration);
// results in ['email' => 'foobarz@example.com', 'name' => 'Foo Barz'];
```

NOTE: The determiner requires getters.

Or just hardcoded settings:

```
$emailConfiguration = ['email' => 'foobarz@example.com', 'name' => 'Foo Barz'];
$determiner = new RonRademaker\Mailer\Receiver\Determiner();
$receiver = $determiner->getReceivers($object, null, $emailConfiguration);
// results in ['email' => 'foobarz@example.com', 'name' => 'Foo Barz'];
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 92.9% 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 ~187 days

Total

4

Last Release

3265d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/32c77f5ff7ffcce6bdf072dd76718e014643cb4b3083b27ecf1806606a5ce363?d=identicon)[RonRademaker](/maintainers/RonRademaker)

---

Top Contributors

[![RonRademaker](https://avatars.githubusercontent.com/u/2697738?v=4)](https://github.com/RonRademaker "RonRademaker (13 commits)")[![reyostallenberg](https://avatars.githubusercontent.com/u/3579090?v=4)](https://github.com/reyostallenberg "reyostallenberg (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ronrademaker-mailer/health.svg)

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

###  Alternatives

[cspoo/swiftmailer-mailgun-bundle

Swiftmailer Mailgun bundle

1031.1M](/packages/cspoo-swiftmailer-mailgun-bundle)[mgilet/notification-bundle

A simple Symfony 3 bundle for user notifications

111142.0k](/packages/mgilet-notification-bundle)[mailcarrier/mailcarrier

Mailing platform with templates and logs included

1632.0k](/packages/mailcarrier-mailcarrier)[ras/flash-alert-bundle

FlashAlertBundle provides a simplified way to handle (add/display) Symfony flash messages. Client side scripts are written in pure JavaScript.

2423.3k](/packages/ras-flash-alert-bundle)[azine/mailgunwebhooks-bundle

Symfony2 Bundle to easily capture feedback from mailgun.com via their provided webhooks

104.1k](/packages/azine-mailgunwebhooks-bundle)

PHPackages © 2026

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