mathieu-bour/laravel-mailjet

This package is abandoned and no longer maintained. No replacement package was suggested.

Mailjet Integration for Laravel and Lumen frameworks

Maintainers

👁 Mathieu Bour

Package info

github.com/matbour/laravel-mailjet

Homepage

Issues

Documentation

pkg:composer/mathieu-bour/laravel-mailjet

Statistics

Installs: 1 329

Dependents: 0

Suggesters: 0

Stars: 1

1.0.1 2020-07-26 20:43 UTC

Requires

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 31c06701f2743163f02469a6ff8e9d6c5e473271

emaillaravelMailjetlumen

This package is auto-updated.

Last update: 2026-06-20 16:11:33 UTC


README

👁 GitHub license
👁 Packagist Version
👁 Packagist
👁 GitHub issues
👁 GitHub pull requests
👁 Scrutinizer code quality

Allow to use the Mailjet Templating Language in Laravel mailables.

This package is not supported by Mailjet.

This package follows the Semantic Versioning specification.

Prerequisites

  • PHP >= 7.2
  • Laravel/Lumen 6 or 7

Compatibility matrix

laravel-mailjet Laravel / Lumen
^1.0.0 ^6.0 || ^7.0

Installation / configuration

Simply add the package to your dependencies.

composer require mathieu-bour/laravel-mailjet

Laravel

The package support the Package Discovery.

Lumen

Add the service provider to your bootstrap/app.php.

Configuration

In the config/services.php, add the following entry:

return [
 // ...
 'mailjet' => [
 'key' => 'your-mailjet-key',
 'secret' => 'your-mailjet-secret',
 'call' => true, // can be set to false to mock requests
 'options' => ['version' => 'v3.1'], // additional Mailjet options, see https://github.com/mailjet/mailjet-apiv3-php#options
 ],
 // ...
];

Usage

You can now use the class Windy\Mailjet\MailjetTemplateMailable as a base for your emails.

Example:

use Windy\Mailjet\MailjetTemplateMailable;

class PasswordForgottenMail extends MailjetTemplateMailable
{
 /** @var int The Mailjet Template ID. */
 protected $templateId = 1185614;
 public $firstName;
 public $resetLink;

 public function __construct(User $user)
 {
 // You can now use {{var:firstName}} and {{var:resetLink}} variables in your Mailjet templates
 $this->firstName = $user->firstname ?? $user->username ?? '';
 $this->resetLink = 'https://mysite.com/password-reset?token=' . $user->token;
 }
}