sendflit/sendflit Composer package. It uses PHP’s curl extension and json extension, and has no other dependencies. It requires PHP 7.4 or later.
Looking for another language? See the SDK overview.
Install
curl and json extensions.
Create a client
Send an email
send takes an associative array and returns the response as an array.
Send with a template
Attachments
Each attachment is an array withfilename, content and an optional content_type. The SDK base64-encodes content for you. Pass the raw file contents, not a path.
- Up to 10 attachments per message.
- Up to 10 MB per attachment. Larger files are rejected with
422.
Send a batch
batch sends up to 100 emails in one request. It takes an array of arrays, each with the same keys as send.
results array in the same order as your input, and a count. An empty array throws InvalidArgumentException, and more than 100 emails throws RangeException, before any request is made. See Batch sending.
Manage emails
cancelEmail removes an email that hasn’t been sent yet. If the email was already sent, the API returns an error, which the SDK throws as SendFlitException.
Domains
Suppressions
'unsubscribe'. See Emails.
Usage and health
Verify webhooks
SendFlit signs each webhook. TheX-Sendflit-Signature header carries sha256=<hex>, an HMAC-SHA256 of the raw request body.
hash_equals, which runs in constant time. Read php://input before anything else touches the request body. See Webhooks for the event list.
Errors and retries
Every failed request throwsSendFlitException:
429 or 5xx are retried up to $maxRetries times, with exponential backoff. Other 4xx responses are not retried. See Errors, retries and limits.
Method reference
Next steps
- Quickstart: send your first email from the command line.
- Batch sending: limits and per-item results.
- Webhooks: events and payloads.