Sendio.Broadcasts (sendio v1.1.0)

Manage broadcasts in Sendio.

Summary

Functions

Cancels a broadcast. A scheduled broadcast goes back to draft; one that is sending stops.

Lists the links clicked in a broadcast, by clicks.

Creates a new broadcast.

Duplicates a broadcast into a new draft named after it with " (copy)" appended.

Estimates how many contacts an audience reaches, before anything is saved.

Gets a version of a broadcast by its version number or ID.

Lists broadcasts, newest first.

Lists the saved versions of a broadcast, newest first.

Lists the recipients of a broadcast for an event type.

Removes a draft or scheduled broadcast.

Restores a version into a draft or scheduled broadcast, saved as a new version.

Sends a draft broadcast.

Gets the delivery and engagement stats of a broadcast.

Sends a test of a broadcast to 1 to 5 addresses, personalized with a sample contact and with the subject prefixed [Test].

Updates a broadcast. Only the options given are changed.

Labels a version of a broadcast. A version's content cannot change.

Functions

Link to this function

cancel(client \\ Sendio.client(), broadcast_id)

Cancels a broadcast. A scheduled broadcast goes back to draft; one that is sending stops.

Link to this function

clicked_links(client_or_id, id_or_opts \\ [])

Lists the links clicked in a broadcast, by clicks.

Options

  • :limit - Maximum number of links to return (1-100, default: 20)
  • :after - Cursor for pagination
  • :before - Cursor for pagination
Link to this function

clicked_links(client, broadcast_id, opts)

Link to this function

create(client \\ Sendio.client(), opts)

Creates a new broadcast.

Without send: true this saves a draft, and a draft may leave any field empty. With send: true the broadcast needs :from, :subject, an :html or :text body and an audience (:segment_id, :segment_ids or audience: "all").

Options

  • :name - Internal friendly name for the broadcast
  • :from - The sender email address
  • :subject - The email subject
  • :reply_to - Reply-to email addresses
  • :html - The HTML content
  • :text - The plain text content ("" opts out of the generated text part)
  • :preview_text - Preview text for email clients
  • :topic_id - Scope broadcast to a specific topic
  • :segment_id - The segment to send to
  • :segment_ids - Several segments to send to (a contact in more than one gets one email)
  • :exclude_segment_ids - Segments whose members never get the broadcast
  • :audience - "segments" (the default) or "all" (every contact)
  • :unsubscribe_scope - "all" or "list" (unsubscribe from the broadcast's segments only)
  • :tracking - false turns off open and click tracking (default true)
  • :template_engine - "simple" merge tags (the default) or "handlebars"
  • :send - true sends the broadcast (or schedules it with :scheduled_at) right away
  • :scheduled_at - When to send it, ISO 8601 or natural language; requires send: true
Link to this function

duplicate(client \\ Sendio.client(), broadcast_id)

Duplicates a broadcast into a new draft named after it with " (copy)" appended.

Link to this function

estimate(client \\ Sendio.client(), opts)

Estimates how many contacts an audience reaches, before anything is saved.

Options

  • :segment_id, :segment_ids, :exclude_segment_ids, :audience and :topic_id, as in create/2
Link to this function

get(client \\ Sendio.client(), broadcast_id)

Gets a broadcast by ID.

Link to this function

get_version(client \\ Sendio.client(), broadcast_id, version)

Gets a version of a broadcast by its version number or ID.

Link to this function

list(client_or_opts \\ [])

Lists broadcasts, newest first.

Options

  • :limit - Maximum number of broadcasts to return (1-100)
  • :after - Cursor for pagination (broadcast ID to start after)
  • :before - Cursor for pagination (broadcast ID to start before)
  • :status - Only broadcasts with this status ("draft", "scheduled", "queued", "sent", ...)
  • :segment_id - Only broadcasts sent to this segment
  • :search - Only broadcasts whose name matches
Link to this function

list(client, opts)

Link to this function

list_versions(client_or_id, id_or_opts \\ [])

Lists the saved versions of a broadcast, newest first.

Options

  • :limit - Maximum number of versions to return (1-100)
  • :after - Cursor for pagination
  • :before - Cursor for pagination
Link to this function

list_versions(client, broadcast_id, opts)

Link to this function

recipients(client \\ Sendio.client(), broadcast_id, opts)

Lists the recipients of a broadcast for an event type.

Options

  • :type - Required: "sent", "delivered", "opened", "clicked", "bounced", "complained", "unsubscribed" or "suppressed"
  • :email - Only recipients whose email contains this value
  • :bounce_type - With type: "bounced": "permanent", "transient" or "undetermined"
  • :limit - Maximum number of recipients to return (1-100, default: 20)
  • :after - Cursor for pagination
  • :before - Cursor for pagination
Link to this function

remove(client \\ Sendio.client(), broadcast_id)

Removes a draft or scheduled broadcast.

Link to this function

restore_version(client \\ Sendio.client(), broadcast_id, version)

Restores a version into a draft or scheduled broadcast, saved as a new version.

Link to this function

send(client_or_id, id_or_opts \\ [])

Sends a draft broadcast.

Options

  • :scheduled_at - Optional datetime to schedule the broadcast
Link to this function

send(client, broadcast_id, opts)

Link to this function

stats(client \\ Sendio.client(), broadcast_id)

Gets the delivery and engagement stats of a broadcast.

Link to this function

test(client \\ Sendio.client(), broadcast_id, to)

Sends a test of a broadcast to 1 to 5 addresses, personalized with a sample contact and with the subject prefixed [Test].

Link to this function

update(client \\ Sendio.client(), broadcast_id, opts)

Updates a broadcast. Only the options given are changed.

Once a broadcast is sending or sent, only its :name can be changed.

Options

The same as create/2 without :send and :scheduled_at: :name, :from, :subject, :reply_to, :html, :text, :preview_text, :topic_id, :segment_id, :segment_ids, :exclude_segment_ids, :audience, :unsubscribe_scope, :tracking and :template_engine.

Link to this function

update_version(client \\ Sendio.client(), broadcast_id, version, opts)

Labels a version of a broadcast. A version's content cannot change.

Options

  • :name - The version's name
  • :comment - The version's comment