hakimrazalan/enginemailer-php

EngineMailer PHP REST SDK

v1.2.1 2025-05-06 08:09 UTC

This package is auto-updated.

Last update: 2025-05-06 08:13:46 UTC


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>')