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 broadcast by ID.
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
cancel(client \\ Sendio.client(), broadcast_id)
@spec cancel(Sendio.Client.t(), String.t()) :: Sendio.Client.response(Sendio.Broadcasts.Broadcast.t())
Cancels a broadcast. A scheduled broadcast goes back to draft; one that is sending stops.
clicked_links(client_or_id, id_or_opts \\ [])
@spec clicked_links(String.t(), Keyword.t()) :: Sendio.Client.response(Sendio.List.t(Sendio.Broadcasts.ClickedLink.t()))
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
clicked_links(client, broadcast_id, opts)
@spec clicked_links(Sendio.Client.t(), String.t(), Keyword.t()) :: Sendio.Client.response(Sendio.List.t(Sendio.Broadcasts.ClickedLink.t()))
create(client \\ Sendio.client(), opts)
@spec create(Sendio.Client.t(), Keyword.t()) :: Sendio.Client.response(Sendio.Broadcasts.Broadcast.t())
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-falseturns off open and click tracking (defaulttrue):template_engine-"simple"merge tags (the default) or"handlebars":send-truesends the broadcast (or schedules it with:scheduled_at) right away:scheduled_at- When to send it, ISO 8601 or natural language; requiressend: true
duplicate(client \\ Sendio.client(), broadcast_id)
@spec duplicate(Sendio.Client.t(), String.t()) :: Sendio.Client.response(Sendio.Broadcasts.Broadcast.t())
Duplicates a broadcast into a new draft named after it with " (copy)" appended.
estimate(client \\ Sendio.client(), opts)
@spec estimate(Sendio.Client.t(), Keyword.t()) :: Sendio.Client.response(Sendio.Broadcasts.Estimate.t())
Estimates how many contacts an audience reaches, before anything is saved.
Options
:segment_id,:segment_ids,:exclude_segment_ids,:audienceand:topic_id, as increate/2
get(client \\ Sendio.client(), broadcast_id)
@spec get(Sendio.Client.t(), String.t()) :: Sendio.Client.response(Sendio.Broadcasts.Broadcast.t())
Gets a broadcast by ID.
get_version(client \\ Sendio.client(), broadcast_id, version)
@spec get_version(Sendio.Client.t(), String.t(), integer() | String.t()) :: Sendio.Client.response(Sendio.Broadcasts.Version.t())
Gets a version of a broadcast by its version number or ID.
list(client_or_opts \\ [])
@spec list(Keyword.t()) :: Sendio.Client.response(Sendio.List.t(Sendio.Broadcasts.Broadcast.t()))
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
list(client, opts)
@spec list(Sendio.Client.t(), Keyword.t()) :: Sendio.Client.response(Sendio.List.t(Sendio.Broadcasts.Broadcast.t()))
list_versions(client_or_id, id_or_opts \\ [])
@spec list_versions(String.t(), Keyword.t()) :: Sendio.Client.response(Sendio.List.t(Sendio.Broadcasts.Version.t()))
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
list_versions(client, broadcast_id, opts)
@spec list_versions(Sendio.Client.t(), String.t(), Keyword.t()) :: Sendio.Client.response(Sendio.List.t(Sendio.Broadcasts.Version.t()))
recipients(client \\ Sendio.client(), broadcast_id, opts)
@spec recipients(Sendio.Client.t(), String.t(), Keyword.t()) :: Sendio.Client.response(Sendio.List.t(Sendio.Broadcasts.Recipient.t()))
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- Withtype: "bounced":"permanent","transient"or"undetermined":limit- Maximum number of recipients to return (1-100, default: 20):after- Cursor for pagination:before- Cursor for pagination
remove(client \\ Sendio.client(), broadcast_id)
@spec remove(Sendio.Client.t(), String.t()) :: Sendio.Client.response(Sendio.Empty.t())
Removes a draft or scheduled broadcast.
restore_version(client \\ Sendio.client(), broadcast_id, version)
@spec restore_version(Sendio.Client.t(), String.t(), integer() | String.t()) :: Sendio.Client.response(Sendio.Broadcasts.Version.t())
Restores a version into a draft or scheduled broadcast, saved as a new version.
send(client_or_id, id_or_opts \\ [])
@spec send(String.t(), Keyword.t()) :: Sendio.Client.response(Sendio.Broadcasts.Broadcast.t())
@spec send(Sendio.Client.t(), String.t()) :: Sendio.Client.response(Sendio.Broadcasts.Broadcast.t())
Sends a draft broadcast.
Options
:scheduled_at- Optional datetime to schedule the broadcast
send(client, broadcast_id, opts)
@spec send(Sendio.Client.t(), String.t(), Keyword.t()) :: Sendio.Client.response(Sendio.Broadcasts.Broadcast.t())
stats(client \\ Sendio.client(), broadcast_id)
@spec stats(Sendio.Client.t(), String.t()) :: Sendio.Client.response(Sendio.Broadcasts.Stats.t())
Gets the delivery and engagement stats of a broadcast.
test(client \\ Sendio.client(), broadcast_id, to)
@spec test(Sendio.Client.t(), String.t(), String.t() | [String.t()]) :: Sendio.Client.response(Sendio.Broadcasts.TestResult.t())
Sends a test of a broadcast to 1 to 5 addresses, personalized with a sample contact
and with the subject prefixed [Test].
update(client \\ Sendio.client(), broadcast_id, opts)
@spec update(Sendio.Client.t(), String.t(), Keyword.t()) :: Sendio.Client.response(Sendio.Broadcasts.Broadcast.t())
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.
update_version(client \\ Sendio.client(), broadcast_id, version, opts)
@spec update_version( Sendio.Client.t(), String.t(), integer() | String.t(), Keyword.t() ) :: Sendio.Client.response(Sendio.Broadcasts.Version.t())
Labels a version of a broadcast. A version's content cannot change.
Options
:name- The version's name:comment- The version's comment