adt / spark-post-api-mailer
There is no license information available for the latest version (v1.8) of this package.
Sending emails through SparkPost API.
v1.8
2023-06-28 13:14 UTC
Requires
- guzzlehttp/guzzle: ^6.2
- php-http/guzzle6-adapter: ^1.1
- sparkpost/sparkpost: ^2.1
Requires (Dev)
- nette/di: ^2.4
- nette/mail: ^2.4
README
Installation
-
composer
composer require adt/spark-post-api-mailer
-
config.neon
extensions: sparkPostApiMailer: ADT\SparkPostApiMailer\DI\SparkPostApiMailerExtension sparkPostApiMailer: authToken: <YOUR TOKEN>
Usage
-
standalone
config.neon
services: nette.mailer: class: \ADT\SparkPostApiMailer\Services\SparkPostApiMailerService
MailComponent.php
function __construct(\Nette\Mail\IMailer $mailer) { $this->mailer = $mailer; } function sendMail(\Nette\Mail\Message $mail) { $this->mailer->send($mail); }
-
with adt/single-recipient-mailer
Mailer.php
class Mailer extends \ADT\Mail\SingleRecipientMailer { public function __construct( array $options, \ADT\SparkPostApiMailer\Services\SparkPostApiMailerService $apiMailer ) { parent::__construct($options); $this->mailer = $apiMailer; } }