LUYA Mailjet

  1. Installation
  2. Basic Send Mail
  3. MJML to HTML

LUYA TestsTotal Downloads Latest Stable Version Test Coverage Maintainability

LUYA and Yii Framework integration for Mailjet service.


  • 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 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


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

Sending transactional E-Mail:

    ->setSubject('Message subject')
    ->setTextBody('Plain text content')
    ->setHtmlBody('<b>HTML content</b>')

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

    ->setVariables(['lastnbame' => 'Lastname Value'])


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 API keys:

'modules' => [
    'mailjetadmin' => [
        'class' => 'luya\mailjet\admin\Module',
        'mjmlApiApplicationId' => '',
        'mjmlApiSecretKey' => '',

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

luya\mailjet\models\Template::renderHtml('slug', ['foo' => 'bar']);
0 0
1 follower
11 498 downloads
Yii Version: Unknown
License: MIT
Category: Mail
Tags: mailjet
Developed by: nadario
Created on: Dec 17, 2019
Last updated: (not set)
Packagist Profile
Github Repository

Related Extensions