PHPackages                             ite/mail-bundle - 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. ite/mail-bundle

ActiveSymfony-bundle

ite/mail-bundle
===============

Provides functional for send emails using email templates and less generating functionality for end emails

116PHP

Since Jun 18Pushed 10y ago5 watchersCompare

[ Source](https://github.com/itedev/MailBundle)[ Packagist](https://packagist.org/packages/ite/mail-bundle)[ RSS](/packages/ite-mail-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

MailBundle
==========

[](#mailbundle)

Provides functional for send emails using email templates and less generating functionality for end emails

Installation and configuration:
-------------------------------

[](#installation-and-configuration)

Pretty simple with [Composer](http://packagist.org), run:

```
composer require ite/mail-bundle
```

### Configuration example

[](#configuration-example)

You can configure default parameters for email senders and using styles for email templates

```
ite_mail:
    bcc_email: %bcc_email%
    from_email: %support_email%
    support_email: %support_email%
    noreply_email: %noreply_email%
    template_folder: AcmeCoreBundle:Email/Template #folder with all email templates
    styles: ['@AcmeCoreBundle/Resources/public/less/email/style.less', '@AcmeCoreBundle/Resources/public/less/email/style2.less'] #additional styles for email templates will be generated to inline styles in end email
    translation_domain: email_subjects #provide translations for end email subjects
```

### Add ITEMailBundle to your application kernel

[](#add-itemailbundle-to-your-application-kernel)

```
// app/AppKernel.php
public function registerBundles()
{
    return array(
        // ...
            new ITE\MailBundle\ITEMailBundle(),
        // ...
    );
}
```

Usage examples:
---------------

[](#usage-examples)

### Add Extension

[](#add-extension)

Create tokens based on context name

```
// src/Acme/CoreBundle/Extension/Mail
namespace Acme\CoreBundle\Extension\Mail;

use ITE\MailBundle\Extension\BaseExtension;
use ITE\MailBundle\Extension\TokenExtensionInterface;
use ITE\MailBundle\Token\Context;
use ITE\MailBundle\Token\Token;
use Symfony\Component\DependencyInjection\ContainerInterface;

class MainExtension extends BaseExtension implements TokenExtensionInterface
{

    private $twig;

    private $container;

    /**
     * @param ContainerInterface $container
     * @internal param $twig
     */
    function __construct(ContainerInterface $container)
    {
        $this->container = $container;
        $this->twig = $container->get('twig');
    }

    /**
     * Retrieve token list depend on token context
     *
     * @param Context $context
     *
     * @return Token[]
     */
    public function getTokens(Context $context)
    {
        $this->setContext($context);
        $data = $context->getData();
        switch ($context->getName()) {
            case 'test_context_name':
                return [
                    new Token('test_token', $data['someData'], 'Test Token'),
                ];
                break;
        }

        return [];
    }

    public function setContext(Context $context)
    {
        if ($context->getData()) {
            return null;
        }
    }

    /**
     * Retrieve global token list, not depended on context
     *
     * @return Token[]
     */
    public function getGlobals()
    {
        return [];
    }

}
```

### Add Extension to Services

[](#add-extension-to-services)

Add mail extension to services.yml

```
services:
    admin.mail.token.main_extension:
        class: Acme\CoreBundle\Extension\Mail\MainExtension
        arguments: [@service_container]
        tags:
            - {name: ite.mail.extension}
```

### Add template to AcmeCoreBundle:Email/Template folder (template\_folder in config.yml)

[](#add-template-to-acmecorebundleemailtemplate-folder-template_folder-in-configyml)

Create the template test\_template.html.twig in AcmeCoreBundle:Email/Template folder

```
Hi User,
[test_token] {#This is the token name from Acme\CoreBundle\Extension\Mail\MainExtension#}
```

### Controller

[](#controller)

You can send email using template test\_template.html.twig:

```
// Acme\MainBundle\Controller\ArticleController.php

    public function sendAction()
    {
        $data = ['someData' => 123];
        $this
            ->get('ite.mail.manager')
            ->mail('test_template', 'some_email@mail.com', 'Some subject', [
                'token_context' => new Context($data, 'test_context_name')
            ]);

        return [];
    }
```

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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.

### Community

Maintainers

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

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

---

Top Contributors

[![jekamozg](https://avatars.githubusercontent.com/u/1221485?v=4)](https://github.com/jekamozg "jekamozg (14 commits)")

### Embed Badge

![Health badge](/badges/ite-mail-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/ite-mail-bundle/health.svg)](https://phpackages.com/packages/ite-mail-bundle)
```

PHPackages © 2026

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