Skip to content

Add support for Bulk Email API (deliver_bulk, get_bulk_status)#161

Open
ctmaloney wants to merge 1 commit into
ActiveCampaign:mainfrom
newleaders:main
Open

Add support for Bulk Email API (deliver_bulk, get_bulk_status)#161
ctmaloney wants to merge 1 commit into
ActiveCampaign:mainfrom
newleaders:main

Conversation

@ctmaloney

Copy link
Copy Markdown

Adds support for Postmark's Bulk Email API, which is now generally available.

The bulk API differs from the existing email/batch endpoint — it accepts a single message definition (subject, body, from, stream) with a Messages array of per-recipient data, rather than a full message object per recipient. This makes it significantly more efficient for large sends.

Changes

Two new methods on ApiClient:

  • deliver_bulk(attributes) — sends to the email/bulk endpoint. Accepts a hash matching Postmark's bulk API shape, with a top-level Messages array for per-recipient overrides.
  • get_bulk_status(bulk_request_id) — fetches the status of a submitted bulk request by ID, returning progress and submission metadata.

Both methods follow existing gem conventions: with_retries, format_response, serialize, and HashHelper.to_postmark.

Example

client.deliver_bulk(
  From: "sender@example.com",
  Subject: "Hello",
  HtmlBody: "<b>Hi there</b>",
  TextBody: "Hi there",
  MessageStream: "your-broadcast-stream",
  Messages: [
    { To: "a@example.com" },
    { To: "b@example.com" }
  ]
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant