reloop / reloop-email
Reloop PHP SDK
1.8.0
2026-06-14 05:51 UTC
Requires
- php: ^8.1
- guzzlehttp/guzzle: ^7.8
Requires (Dev)
- phpunit/phpunit: ^10.5
This package is auto-updated.
Last update: 2026-07-22 08:40:12 UTC
README
Official PHP client for the Reloop API.
Before you send
- API key — create one in your Reloop account
- Verified domain — add and verify a sending domain; use it in the
fromaddress
Full API reference: reloop.sh/docs
Install
composer require reloop/reloop-email
Quick start
<?php require 'vendor/autoload.php'; use Reloop\Exceptions\ReloopApiException; use Reloop\Exceptions\ReloopValidationException; use Reloop\Reloop; $reloop = Reloop::client('rl_your_api_key_here'); try { $result = $reloop->mail->send([ 'from' => 'Reloop <hello@your-verified-domain.com>', 'to' => 'user@example.com', 'subject' => 'Welcome to Reloop', 'html' => '<p>Thanks for signing up.</p>', 'text' => 'Thanks for signing up.', ]); echo $result['messageId'] . ' ' . $result['id'] . PHP_EOL; } catch (ReloopValidationException $e) { fwrite(STDERR, 'invalid request (' . $e->field . '): ' . $e->getMessage() . PHP_EOL); } catch (ReloopApiException $e) { fwrite(STDERR, 'API error ' . $e->status . ': ' . $e->getMessage() . PHP_EOL); }
Services
$reloop->apiKey; // create, list, get, update, delete, rotate, enable, disable $reloop->mail; // send $reloop->domain; // create, list, get, update, delete, verify $reloop->contacts; // CRUD + ->properties, ->groups, ->channels $reloop->webhook; // CRUD, pause/enable/disable, trigger, deliveries + verify $reloop->inbox; // ->mailboxes, ->messages, ->threads
Errors
| Kind | Type | When |
|---|---|---|
| Bad client args | ReloopValidationException |
Invalid params — no HTTP call |
| HTTP / network | ReloopApiException |
Non-2xx response or transport failure |
| Webhook HMAC | WebhookSignatureException |
Local signature verification failed |
Idiomatic PHP exceptions — aligned with the Java SDK and the Node/Python Result / Go (T, error) contracts.
Webhook verification
use Reloop\Services\WebhookVerify; $event = WebhookVerify::constructEvent($payload, $signature, $secret, 300); // or $reloop->webhook->verify([...])
License
Licensed under the Apache License 2.0 with additional use restrictions from Reloop Labs (same as the Reloop project).