Skip to main content

Instantiation

Your API key is read automatically from the .env file (see Authentication). No constructor arguments are needed.

Building a message

A message is assembled from three objects (Header, Content, and Message) plus optional Attachment objects.

Content

Message

Attachments

Send a message

The response is a stdClass object:

Check delivery status

$disposition->data->message->message_deliveries is an array of per-recipient objects:
Common deliveryStatus values: delivered, opened, failed, pending.

Scheduled send

Schedule a message for future delivery, check its status, reschedule, or cancel it.

Schedule a message

$scheduledAt must be an ISO 8601 UTC datetime string in the future and within 30 days.

Get scheduled message status

Reschedule a message

Cancel a scheduled message

Error handling

Both sendMessage and getEmailDisposition throw \Exception on failure. Wrap calls in a try/catch block:
sendMessage throws if the Header or Content is null, or if the API response cannot be parsed. getEmailDisposition throws if the response cannot be parsed.