PHPackages                             luyadev/luya-mailjet - 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. luyadev/luya-mailjet

ActiveLuya-extension[Mail &amp; Notifications](/categories/mail)

luyadev/luya-mailjet
====================

1.9.1(3y ago)220.2k3MITPHP

Since Jan 31Pushed 3y ago2 watchersCompare

[ Source](https://github.com/luyadev/luya-mailjet)[ Packagist](https://packagist.org/packages/luyadev/luya-mailjet)[ RSS](/packages/luyadev-luya-mailjet/feed)WikiDiscussions master Synced 1mo ago

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

 [![LUYA Logo](https://raw.githubusercontent.com/luyadev/luya/master/docs/logo/luya-logo-0.2x.png)](https://raw.githubusercontent.com/luyadev/luya/master/docs/logo/luya-logo-0.2x.png)

LUYA Mailjet
============

[](#luya-mailjet)

[![LUYA](https://camo.githubusercontent.com/c30b61934591d3a6fcb8718a93fd61bf840c0abd8a8d49aa0fdd4ab99567bdf4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f506f776572656425323062792d4c5559412d627269676874677265656e2e737667)](https://luya.io)[![Tests](https://github.com/luyadev/luya-mailjet/workflows/Tests/badge.svg)](https://github.com/luyadev/luya-mailjet/workflows/Tests/badge.svg)[![Total Downloads](https://camo.githubusercontent.com/898bf032d38832d724c4ad45e58fbc664a3768021f2d7f2c12bb0ee270a72fcb/68747470733a2f2f706f7365722e707567782e6f72672f6c7579616465762f6c7579612d6d61696c6a65742f646f776e6c6f616473)](https://packagist.org/packages/luyadev/luya-mailjet)[![Latest Stable Version](https://camo.githubusercontent.com/7ab31b3e1a421962534fca439863c2ca08fff69f36a305ff168dfaf9f44f8fe7/68747470733a2f2f706f7365722e707567782e6f72672f6c7579616465762f6c7579612d6d61696c6a65742f762f737461626c65)](https://packagist.org/packages/luyadev/luya-mailjet)[![Test Coverage](https://camo.githubusercontent.com/fc72cdb3d4cacb92161bfd82551c479964c4a5d0de1d9dd59c6e13464065a042/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f37393038373433333938366331366437663431642f746573745f636f766572616765)](https://codeclimate.com/github/luyadev/luya-mailjet/test_coverage)[![Maintainability](https://camo.githubusercontent.com/4f12775d97bcc74afa3ab99d7c85cbbd379e1abf4e820ad0d66d8b2534587c85/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f37393038373433333938366331366437663431642f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/luyadev/luya-mailjet/maintainability)

LUYA and Yii Framework integration for [Mailjet](https://mailjet.com) service.

Contains:

- Yii Framework BaseMailer for Transaction E-Mails trough API.
- Interface for Subscription Mail Sync including CLI command for Synchronisation.
- A PHP library to convert MJML content into Mailjet Passport json format.
- LUYA Admin Module to convert MJML into HTML based on MJML.io API.
- LUYA Active Window to retrieve informations about a given User E-Mail.
- A Widget to subscribe to a List with double opt in (can be disabled).
- SMS Sending helpers
- Yii 2 Queue Job to send mails with a template

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

[](#installation)

Install the extension through composer:

```
composer require luyadev/luya-mailjet
```

Add to config:

```
'components' => [
    //...
    'mailjet' => [
        'class' => 'luya\mailjet\Client',
        'apiKey' => '...',
        'apiSecret' => '...',
    ],
    'mailer' => [
        'class' => 'luya\mailjet\Mailer',
    ],
]
```

Basic Send Mail
---------------

[](#basic-send-mail)

Sending transactional E-Mail:

```
Yii::$app->mailer->compose()
    ->setFrom('from@domain.com')
    ->setTo('to@domain.com')
    ->setSubject('Message subject')
    ->setTextBody('Plain text content')
    ->setHtmlBody('HTML content')
    ->send();
```

Send a transactional E-Mail based on the Template id stored in Mailjet:

```
Yii::$app->mailer->compose()
    ->setTemplate(484590)
    ->setVariables(['lastname' => 'Lastname Value'])
    ->setTo(['to@domain.com'])
    ->send();
```

MJML to HTML
------------

[](#mjml-to-html)

With version 1.3 of LUYA Mailjet library there is an admin module you can configured in order to parser MJML into HTML, therefore add the module to your configuration and provide mjml.io API keys:

```
'modules' => [
    //...
    'mailjetadmin' => [
        'class' => 'luya\mailjet\admin\Module',
        'mjmlApiApplicationId' => 'ApplicationIdFromMjml.io',
        'mjmlApiSecretKey' => 'ApplicationSecretFromMjml.io',
    ]
]
```

Afterwards you can retrieve and render the HTML of MJML template with:

```
luya\mailjet\models\Template::renderHtml('slug', ['foo' => 'bar']);
```

###  Health Score

37

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 93.8% 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 ~62 days

Recently: every ~96 days

Total

21

Last Release

1411d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/86184bf08843ed8fcc4aedb2fdecd8a9e832e47e89a7166cebfda529c176f5ce?d=identicon)[nadar](/maintainers/nadar)

---

Top Contributors

[![nadar](https://avatars.githubusercontent.com/u/3417221?v=4)](https://github.com/nadar "nadar (180 commits)")[![JohnnyMcWeed](https://avatars.githubusercontent.com/u/9844452?v=4)](https://github.com/JohnnyMcWeed "JohnnyMcWeed (6 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")[![hbugdoll](https://avatars.githubusercontent.com/u/6715827?v=4)](https://github.com/hbugdoll "hbugdoll (2 commits)")[![rolandschaub](https://avatars.githubusercontent.com/u/3786245?v=4)](https://github.com/rolandschaub "rolandschaub (2 commits)")

---

Tags

hacktoberfestluyamailjetmailjet-apiyii2yii2yiiluyaMailjet

### Embed Badge

![Health badge](/badges/luyadev-luya-mailjet/health.svg)

```
[![Health](https://phpackages.com/badges/luyadev-luya-mailjet/health.svg)](https://phpackages.com/packages/luyadev-luya-mailjet)
```

###  Alternatives

[luyadev/luya-module-admin

Administration core module for all LUYA admin modules

48179.0k24](/packages/luyadev-luya-module-admin)[tuyakhov/yii2-notifications

The extension provides support for sending notifications across a variety of delivery channels, including mail, SMS, Slack etc. Notifications may also be stored in a database so they may be displayed in your web interface.

6735.5k2](/packages/tuyakhov-yii2-notifications)[baibaratsky/php-mailgun

Mailgun API PHP library and Yii extension (as well as Yii2)

3224.6k](/packages/baibaratsky-php-mailgun)[luyadev/luya-module-cms

The LUYA CMS module provides a full functional Content Management System for adding contents based on blocks.

32176.1k18](/packages/luyadev-luya-module-cms)[djagya/yii2-sparkpost

A library provides Yii2 integration with SparkPost mail service

1816.3k](/packages/djagya-yii2-sparkpost)

PHPackages © 2026

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