camuthig / courier-mailjet
A Mailjet courier implementation
Requires
- php: ^7.1
- ext-json: *
- guzzlehttp/guzzle: ^6.3
- mailjet/mailjet-apiv3-php: ^1.4.1
- quartzy/courier: ^0.6
- ramsey/uuid: ^3.0
Requires (Dev)
- ext-imap: *
- phpunit/phpunit: ^7.4
- vlucas/phpdotenv: ^2.5
- zbateson/mail-mime-parser: ^0.4.8
This package is auto-updated.
Last update: 2022-11-28 05:33:10 UTC
README
Archived
The quartzy/courier has moved to read-only.
Courier Mailjet
A Courier implementation for Mailjet using the v3.1 API.
Installation
composer require camuthig/courier-mailjet
Usage
Visit Mailjet to retrieve your API key and secret.
<?php require_once __DIR__ . '/vendor/autoload.php'; use Camuthig\Courier\Mailjet\MailjetCourier; use Mailjet\Client; use PhpEmail\EmailBuilder; use PhpEmail\Content\SimpleContent; $client = new Client(getenv('MAILJET_API_KEY'), getenv('MAILJET_API_SECRET')); $courier = new MailjetCourier($client); $email = EmailBuilder::email() ->to('to@test.com') ->from('from@test.com') ->withSubject('Great Email!') ->withContent(SimpleContent::text('Text')->addHtml('HTML')) ->build(); $courier->deliver($email);
Receipt ID
Mailjet returns a unique ID for each receipient of a message. However, the Courier receipt API expects a single ID to be returned for each email delivery. To work around this, the receipt ID returned by this implementation is actually added to the messages as the Custom ID property.
Change log
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING and CONDUCT for details.
Credits
License
The Apache License, v2.0. Please see License File for more information.