Skip to content

LUYA and Yii Framework integration for mailjet service.

Notifications You must be signed in to change notification settings

slowfox089/luya-mailjet

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LUYA Logo

LUYA Mailjet

LUYA Build Status Total Downloads Latest Stable Version Test Coverage Maintainability

LUYA and Yii Framework integration for mailjet 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.

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',
        ],
    ]
]

Usage

Transactionals

Send transactional E-Mail:

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

Transactional with Template

$mail = $this->app->mailer->compose()
    ->setFrom('from@domain.com')
    ->setSubject('Hello!')
    ->setTemplate(484590)
    ->setVariables(['lastnbame' => 'Lastname Value'])
    ->setTo(['to@domain.com'])
    ->send();

About

LUYA and Yii Framework integration for mailjet service.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%