michalper / emaillabs
Unofficial PHP library for EmailLabs API
1.0.11
2017-10-17 11:58 UTC
Requires
- php: >=5.3
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
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