Search by

michalper / emaillabs

michalper

Unofficial PHP library for EmailLabs API

1.0.11 2017-10-17 11:58 UTC

This package is not auto-updated.

Last update: 2026-10-25 05:32:21 UTC


README

Unofficial PHP client for the EmailLabs transactional email API (HTTP Basic auth).

Install

composer require michalper/emaillabs_api

Usage

$client = (new EmailLabs())->setAppKey('...')->setSecret('...');

$email = (new Email())
    ->setTo('recipient@example.com', 'Recipient Name')
    ->setSmtpAccount('your-smtp-account')
    ->setFrom('you@example.com')
    ->setFromName('Your Name')
    ->setSubject('Hello')
    ->setHtml('<p>Hello!</p>');

$response = $client->sendMail($email);
$response = $client->sendEmailWithTemplate($email); // with setTemplateId()

$opens = $client->getOpens();
$clicks = $client->getClicks();
$client->addBlackList($account, $email, $reason);
$client->isEmailTemporary($email);

Covers sending (including templates, attachments, per-recipient template variables via setToExtended()), delivery analytics (getOpens, getClicks, getAgregate), SMTP account listing, and blacklist management. Built against the EmailLabs API docs.

License

GNU GPL