Download the PHP package mailblastr/mailblastr without Composer

On this page you can find all versions of the php package mailblastr/mailblastr. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package mailblastr

mailblastr-php

Official PHP SDK for the MailBlastr email API — send transactional and marketing email from your own verified domain.

Requirements

PHP 8.1+ with the curl and json extensions. No other runtime dependencies.

Install

Usage

Every method returns the decoded JSON response as an associative array. Any non-2xx response throws Mailblastr\Exceptions\MailblastrException carrying the API error shape:

Branch on getName(), and read getStatusCode() from the response rather than inferring it from the name — a handler may return a name with a non-default status (a missing User-Agent, for example, is validation_error with a 403, and max_active_keys is a 429). Messages are sanitized human text and change freely, so never match on them.

Some errors carry more than that envelope. The extras are accessors on the exception and return null on an ordinary error:

$e->getBody() is the whole parsed error body, so a field newer than this SDK version is still reachable.

Attachments

Attach files by hosted URL (path, fetched at send time) or inline base64 (content):

Options

timeout and maxRetries configure the default curl transport only; a transport you supply is used as-is.

Resources

The client exposes one property per resource, each following a consistent (create / get / list / update / remove, plus resource-specific verbs) shape:

emails (with nested emails->receiving), batch, domains, audiences, contacts, contactProperties, campaigns, segments, topics, templates, automations, webhooks, logs, events, apiKeys (list only — see below), polls.

API keys are managed in the dashboard

apiKeys->list() is the whole API-key surface: the SDK deliberately exposes no method to create, re-scope or revoke a key. Key lifecycle belongs to a signed-in dashboard session, and the API enforces it — POST /api-keys, PATCH /api-keys/:id and DELETE /api-keys/:id answer 403 dashboard_only to any API-key caller, whatever its permission. That is the point: a key that leaks cannot mint itself a replacement, widen its own access, or revoke the keys you would use to shut it off. Create and revoke keys at mailblastr.com.

Topics

Topics let contacts manage granular subscriptions (e.g. "Product updates").

Automations

Build multi-step automations triggered by events, then inspect their runs.

Every automation belongs to one of your sending domains — domain is REQUIRED on create, and events->send() names the domain it targets, so the same event name across several products can never trigger the wrong automation.

Webhooks

Subscribable events: email.sent, email.delivered, email.delivery_delayed, email.bounced, email.complained, email.opened, email.clicked, email.failed, email.scheduled, email.suppressed, email.received, email.replied, email.unsubscribed, contact.created, contact.updated, contact.deleted, domain.created, domain.updated, domain.deleted. Anything else is rejected with a 422.

Verify a delivery's Svix-style signature in your endpoint (a pure local HMAC-SHA256 computation — no HTTP request). Pass the EXACT raw request body:

Also available without a client: Mailblastr\WebhookSignature::verify(...).

Logs

Pagination

list() methods accept optional cursor pagination — ['limit' => …, 'after' => …, 'before' => …] — appended as a query string:

limit must be an integer between 1 and 100 (default 20). after and before are item ids and are mutually exclusive — passing both is a 422. Every list response is ['object' => 'list', 'has_more' => bool, 'data' => [...]]; there is no total and no next cursor, so page forward with the last data item's id as after. An unknown cursor returns an empty page, not an error.

Note that some list endpoints skip the 20-row default when you pass no pagination params at all, returning everything up to a hard ceiling of 1,000 rows instead — domains, apiKeys, topics, campaigns, contacts, contactProperties, segments, polls, segments->contacts(), contacts->listSegments(), contacts->getTopics() and emails->receiving->listAttachments(). Do not read that as "the whole collection": past 1,000 rows the response is truncated and has_more is true, so page with limit + after rather than relying on one unpaginated call. The other direction is just as uneven: templates, webhooks, audiences, automations, automations->runs() and events always cap an unpaginated call at 20.

Idempotency

Pass an idempotency key to safely retry a send:

The key must be 1–255 characters, measured after the server trims it — 255, not 256. Mailblastr\Client::IDEMPOTENCY_KEY_MAX_LENGTH carries that number. The SDK sends the key verbatim and lets the server be the authority: an out-of-range key comes back as a 400 invalid_idempotency_key.

Replaying a key returns the original response; reusing it with a different payload is a 409. emails->send(), batch->send(), and received-email reply/forward honour it — every other endpoint, including events->send(), still accepts an idempotencyKey option and forwards it, but the API ignores it there, so a retry creates a second resource. De-duplicate on your side instead.

Rate limits

Only the /emails SEND routes are rate limited: 30 requests per minute per IP. Reads (GET /emails, GET /emails/:id, the receiving subtree and attachment listings) are NOT subject to that cap — paging a large list no longer risks a

  1. Capped responses carry RateLimit-Limit / RateLimit-Remaining / RateLimit-Reset headers on success too. automations->createWithAi() is separately limited to 20 requests per minute per account. The default transport retries a 429 or 503 automatically (honouring Retry-After) up to maxRetries times.

Testing

The HTTP transport is swappable — pass any Mailblastr\Transport\TransportInterface implementation as 'transport' to fake responses in your tests. A real custom transport must send the headers it is handed verbatim: the API rejects any request without a non-empty User-Agent with a 403 before it even authenticates.

The SDK's own test suite (no framework needed) runs with:

Documentation

Full docs: https://www.mailblastr.com/docs

License

MIT

Recovery and tracking contracts

Use a stable, unique operation key for each intended send, batch, reply, or forward. Keep the same key and payload when recovering that operation. These are the supported idempotent send endpoints; events do not implement this header. Existing calls without options still work.

Automatic retries consider only 429/503. They stop on an original email id, positive sent_count, nonempty sent or reserved, or batch_incomplete. An ordinary rate limit can retry; a generic 503 can retry a read or a send with the same supported key. Other writes retry only documented pre-processing rejections (service_unavailable, sending_service_unavailable, sending_configuration_unavailable, contacts_busy, contacts_timeout). No network/body-read failure, 409, 422, or other 5xx is retried automatically. The default transport refuses redirects; a custom transport/client must enforce its own policy.

On a failed or unconfirmed send, inspect id with the email retrieval method before creating another send. A 422 with an ID can identify an uncertain provider handoff; 422 does not always mean nothing happened. For interrupted batches, sent contains confirmed sends, reserved contains the original attempted prefix (including uncertain handoffs), and unsent_count counts the never-attempted tail. Do not resend the full batch or the reserved prefix under a new key. Reconcile original IDs first, then submit only known unattempted items as a new operation. Recovery fields remain available in the full error body as well as language-specific fields/accessors.

Tracking health returns custom_host, status (shared, ready, or unavailable), and checked_at. Configure custom tracking through the domain API and check health before relying on it. A healthy endpoint cannot guarantee an open event: recipients may block images, and coupon redemption alone is not proof that the tracking pixel loaded. SDKs preserve supplied HTML/text and do not infer opens or rewrite editor spacing.

Campaign cancellation also stops pending follow-ups for an already-sent campaign while retaining its sent history. Permanent received-email deletion acknowledges a durable cleanup request; attachment/object cleanup can finish asynchronously. Retrying that deletion is safe; it cannot be undone after the purge request is accepted.


All versions of mailblastr with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-curl Version *
ext-json Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mailblastr/mailblastr contains the following files

Loading the files please wait ...