hakimrazalan / enginemailer-php
EngineMailer PHP REST SDK
v1.2.1
2025-05-06 08:09 UTC
Requires
- laravie/codex: ^6.2
- laravie/codex-filter: ^2.1
- spatie/ray: ^1.42
- symfony/http-client: ^7.2
Requires (Dev)
- php-http/guzzle7-adapter: ^1.1
- rector/rector: ^2.0
README
Installation
Composer
To install through composer by using the following command:
composer require php-http/guzzle7-adapter hakimrazalan/enginemailer-php
HTTP Adapter
Refer PHP-HTTP Clients & Adapters for other supported clients and adapters.
Get Started
Creating client
To create EngineMailer client, use the following codes:
use HakimRazalan\EngineMailer\Client;
$client = Client::setup("<api-key>");
Alternatively, you could configure Http\Client\Common\HttpMethodsClient
manually
use HakimRazalan\EngineMailer\Client;
$http = Laravie\Codex\Discovery::client();
$client = Client::setup("<api-key>", $http);
Usages
Currently this library only cater to send transaction email
use HakimRazalan\EngineMailer\Client;
$http = Laravie\Codex\Discovery::client();
$client = Client::setup("<api-key>", $http);
$emailSender = $client->sendEmail();
$response = $emailSender
->sendEmail()
->setToEmail("receiver@receiver.com")
->setSenderEmail("sender@sender.my")
->setSubject("Test subject")
->setSubmittedContent("Email content")
->handle();
For full supported parameter please refer EngineMailer documentation.
Note: Just append set
infront of the parameter name to include in the request. eg. TemplateId
to setTemplateId('<template-id>')