Module: Millionsend::Batch

Defined in:
lib/millionsend/batch.rb

Overview

Send up to 100 emails in a single call.

Class Method Summary collapse

Class Method Details

.send(list, options = {}) ⇒ Object Also known as: create

POST /emails/batch with a bare array body. The trailing hash carries idempotency_key and batch_validation ("strict", the default, rejects the whole batch on one invalid item; "permissive" sends the valid subset and lists the rest under errors) — either flat or under options:, like Emails.send.



12
13
14
15
16
# File 'lib/millionsend/batch.rb', line 12

def send(list, options = {})
  Millionsend::Request.new(
    method: :post, path: "/emails/batch", body: list, **Millionsend::Util.request_options(options)
  ).perform
end