openemail broadcasts
Çdo komandë në këtë hapësirë emrash, me argumentet, flamujt dhe shembujt e saj.
Komandat
One message sent to everybody in one or more audiences, a personalised copy for each person, with unsubscribe handled for you.
Çdo komandë këtu pranon edhe flamujt globalë, si --json, --profile dhe --dry-run. Shihni flamujt globalë
openemail broadcasts preview
Count who a broadcast to some audiences would reach
Përdorimi
openemail broadcasts preview --audience-ids <a,b> [flags] openemail broadcasts preview --data <json|@file|-> [flags]
Returns the numbers send would work from, without sending or writing anything: recipients, the people a broadcast to these audiences would reach now, unsubscribed, the contacts skipped because they have unsubscribed from every one of these audiences they are in, and suppressed, the subscribed contacts skipped because their address is on the suppression list. A contact in several of the audiences counts once.
The count is taken at the moment of the call, so contacts who join or leave before a send change it. Only --audience-ids is sent, so you can pass the same object you are about to give send.
Flamujt
--audience-ids <a,b>I përsëritshëm1 to 10 audience ids. One that names no audience in the workspace is a 404
audience_not_found. Required, here or in--data.--data <json|@file|->The whole
bodyas JSON, inline, from a file with @path, or - for standard input. Flags override its keys.
Shembuj
openemail broadcasts preview --audience-ids aud_4c1b8e2a7d9f05c36b4e8a71,aud_7e3d9a1c5b2f84e06d9a3c51openemail broadcasts preview --data @broadcast.jsonE disponueshme edhe në
openemail broadcasts send
Send one message to everybody in one or more audiences
Përdorimi
openemail broadcasts send --audience-ids <a,b> --from <value> [flags] openemail broadcasts send --data <json|@file|-> [flags]
Creates a broadcast: one message sent to every contact in the audiences you name, as a separate copy for each person. Every copy has exactly one recipient and no cc or bcc, so nobody sees who else it went to, and every copy is an ordinary email with its own msg_ id, events, tracking and webhooks. emails.list({ broadcastId }) lists them. Copies are not filed in the Sent folder, because the broadcast is the record.
The promise settles straight away with the broadcast queued, or scheduled when you pass --scheduled-at, and the sending happens in the background, 50 people at a time. Poll get to follow status and counts as it goes.
Who gets it: every contact in at least one of --audience-ids, counted once however many of them hold it, except a contact that has unsubscribed from every one of those audiences it is in, and except an address on the suppression list. A contact added to one of the audiences after this call but before the sending reaches it is included. counts.recipients is the estimate taken at the call, and preview returns the same count without sending.
subject, html and text take merge fields, filled in from each contact: {{firstName}}, {{lastName}}, {{name}}, {{email}} and {{unsubscribeUrl}}. Each takes a fallback after a bar, so {{firstName|there}} reads there for a contact with no name. The first name is the first word of the contact's name and the last name is the rest. Values are escaped in html, and any other {{…}} is left as written. With template, the same values are passed as props, but only the ones the template declares.
Every copy carries the one-click unsubscribe headers mail clients and the large mailbox providers look for. An html or text body that does not place {{unsubscribeUrl}} itself gets a one-line footer with the link, while a template is sent as it is, so put {{unsubscribeUrl}} in the template. Following the link marks the person unsubscribed in every audience this broadcast went to; their other audiences, their contact and mail sent to them one message at a time are not affected.
The whole send is checked against the plan's monthly sends before anything is written. A broadcast the allowance cannot cover throws 429 send_quota_exceeded and leaves nothing behind, and each copy counts as one send.
Flamujt
--audience-ids <a,b>I përsëritshëm1 to 10 audience ids such as
aud_9f2c4b7e1a0d63d84c5f2e7b. A contact in several of them gets one copy. An id that names no audience in the workspace is a 404audience_not_foundand nothing is sent. Required, here or in--data.--from <value>Sender as
[email protected],Acme <[email protected]>or{ email, name }. It must be an address the key may send as, otherwise 403from_address_forbidden. Required, here or in--data.--reply-to <value>Where replies go, the same for every copy.
--subject <value>Required unless a template supplies it, at most 998 characters. Takes merge fields.
Parazgjedhja""--html <value>HTML body, at most 1,000,000 characters, with merge fields. Without
{{unsubscribeUrl}}in it an unsubscribe footer is added.--text <value>Plain text body, at most 1,000,000 characters, with merge fields. Without
{{unsubscribeUrl}}in it an unsubscribe line is added.--template <json|@file|->A stored template instead of
htmlandtext, never beside them. The merge values reach it as props it declares, such asfirstNameandunsubscribeUrl. JSON shaped as{ id: string, version?: number, props?: Record<string, unknown>, slots?: Record<string, unknown> }, inline or from a file with @path.--tracking <json|@file|->Open and link tracking for every copy. A field left out follows the address it is sent from when that address set it, and is on otherwise. JSON shaped as
{ opens?: boolean, clicks?: boolean }, inline or from a file with @path.--tags <json|@file|->I përsëritshëmUp to 8 tags, keys of 1 to 64 letters, digits,
_or-, values up to 256 characters. Every copy carries them, plusbroadcast_id, which the server adds.Parazgjedhja{}--scheduled-at <when>A
Date, an ISO 8601 instant or a duration such asPT2HorP1D, in the future and at most 365 days out. Left out, the sending starts straight away.--idempotency-key <value>Your own key, 1 to 255 characters of letters, digits,
_,.,:or-. Left out, the SDK makes one for the call, so its own retries never send twice. Sending the same key again answers with the broadcast it created instead of a new one; the same key with a different body is a 422idempotency_key_reuse.--data <json|@file|->The whole
bodyas JSON, inline, from a file with @path, or - for standard input. Flags override its keys.
Shembuj
openemail broadcasts send --audience-ids aud_4c1b8e2a7d9f05c36b4e8a71 --from 'Acme <[email protected]>'openemail broadcasts send --audience-ids aud_4c1b8e2a7d9f05c36b4e8a71 --from 'Acme <[email protected]>' --subject '{{firstName|Hello}}, the September release is out' --html '<p>Hi {{firstName|there}},</p><p>Here is what changed this month.</p><p><a href="{{unsubscribeUrl}}">Unsubscribe</a></p>' --scheduled-at PT2Hopenemail broadcasts send --data @broadcast.jsonopenemail broadcasts send --audience-ids aud_4c1b8e2a7d9f05c36b4e8a71 --from 'Acme <[email protected]>' --yesE disponueshme edhe në
openemail broadcasts list
List one page of broadcasts, newest first
lsPërdorimi
openemail broadcasts list [flags]
Returns one page of the broadcasts in the workspace, newest first, each with live counts. --audience-id keeps the ones that were sent to that audience, alone or beside others.
Paging is keyset: --limit takes 1 to 100 and defaults to 25, and nextCursor, the id of the last broadcast on the page, goes back as --cursor while hasMore is true. Send the same --audience-id with every page.
The individual messages are not here. List the copies of one broadcast with emails.list({ broadcastId }).
Add --all to walk every page: a table on a terminal, one JSON object per line when piped or with --ndjson, and one { items, hasMore, nextCursor } document with --json. --max <n> stops after that many items.
Flamujt
--audience-id <value>Only the broadcasts that included this audience. An id that names no audience answers an empty page.
--limit <n>Rows per page, a whole number from 1 to 100. The server defaults to 25.
Parazgjedhja25--cursor <value>The
nextCursorfrom the previous page, a broadcast id. One that names no broadcast in the workspace is a 400invalid_cursor.--allFetch every page and stream the items as they arrive.
--max <n>Stop after this many items. Implies
--all.--ndjsonPrint every item as one JSON object per line. Implies
--all
Shembuj
openemail broadcasts listopenemail broadcasts list --audience-id aud_4c1b8e2a7d9f05c36b4e8a71 --limit 10openemail broadcasts list --all --max 100openemail broadcasts list --all > broadcasts.ndjsonE disponueshme edhe në
openemail broadcasts get
Read one broadcast and how far it has got
showviewPërdorimi
openemail broadcasts get <id> [flags]
Returns one broadcast with counts read live from its copies, which makes this the call to poll while it sends.
status moves from scheduled or queued to sending and settles on sent once every copy handed over has gone out or failed. It reads sending for as long as copies are still waiting, even after the last person was reached and completedAt was set. cancelled and failed are the other two ends, and on failed lastError says why: the from address can no longer be sent from, the template stopped resolving, the plan ran out part way, the sending itself kept failing, or not one copy could be written.
counts.recipients is the estimate taken when it was created. created is the copies written, one per person reached, skipped the people passed over because their address was suppressed by then, and failedToQueue the people whose copy could not be written. queued, sending, sent, failed and cancelled count the copies by the state each one is in now.
Argumentet
<id>E detyrueshmeA
brd_id fromsendorlist.
Shembuj
openemail broadcasts get brd_5a8c1e3f7b2d94a06c8e1f3bopenemail broadcasts get brd_5a8c1e3f7b2d94a06c8e1f3b --jsonE disponueshme edhe në
openemail broadcasts stats
Read how a broadcast performed
Përdorimi
openemail broadcasts stats <id> [flags]
Resolves with the totals and a series for one broadcast. totals counts copies sent, delivered, bounced, complained (reported as spam) and failed, pending for the ones still waiting, and people who opened, clicked and unsubscribed, with opens and clicks as event counts. series is sparse and oldest first: one bucket per grain in which something happened, counting each person once at the first time it happened to them, so it adds up to the totals.
Pass days or minutes to also read what happened lately. window then counts the copies delivered, bounced, reported as spam, opened, clicked and unsubscribed inside it, and series keeps only its buckets, while totals still covers the whole broadcast. Without either, window is null.
Argumentet
<id>E detyrueshmeA
brd_id fromsendorlist.
Flamujt
--grain <value>Bucket width:
minute,hourorday, defaulting tohour.Parazgjedhja"hour"--offset-minutes <n>Minutes east of UTC to cut the buckets in, from -840 to 840. Pass
-new Date().getTimezoneOffset()for the local zone.Parazgjedhja0--days <n>Reads a window of this many days too, from 1 to 1095. It starts at the beginning of its first
grainbucket and ends now.--minutes <n>The window in minutes, from 1 to 1576800, which wins over
dayswhen both are sent.
Shembuj
openemail broadcasts stats brd_5a8c1e3f7b2d94a06c8e1f3bopenemail broadcasts stats brd_5a8c1e3f7b2d94a06c8e1f3b --grain dayopenemail broadcasts stats brd_5a8c1e3f7b2d94a06c8e1f3b --jsonE disponueshme edhe në
openemail broadcasts analytics
Read how broadcasts did over a time window
Përdorimi
openemail broadcasts analytics [flags]
Returns the numbers behind the Analytics tab of the Broadcasts page in one request: how the live broadcasts sent inside a window did, added up in totals and cut to grain in series, and one row per broadcast in broadcasts so they can be compared.
A copy counts when it was sent inside the window, and everything that happened to it afterwards counts with it, so an open today of a copy sent last week is in a 30 day window but not in a 1 day one. Test mode broadcasts are left out. totals and series add up the broadcasts named in --broadcast-ids, or every one when it is left out, while broadcasts always lists every broadcast in the window, newest first.
series is sparse and oldest first: a bucket in which nothing happened has no entry, so a chart must fill the gaps. It counts each person once, at the first time it happened to them. grain sets the bucket width and the key shape, YYYY-MM-DD, YYYY-MM-DDTHH or YYYY-MM-DDTHH:MM, and --offset-minutes shifts the boundaries so days break where the reader's day does. The window starts at the beginning of its oldest bucket, reported as since, and ends now, reported as until.
Flamujt
--broadcast-ids <a,b>I përsëritshëmUp to 50 broadcast ids for
totalsandseriesto add up, sent comma separated. Leave it out, or pass an empty array, for every broadcast in the window. An id with no copy in the window adds nothing, and more than 50 is a 422.--days <n>Window length in days, from 1 to 1095, defaulting to 30.
Parazgjedhja30--minutes <n>Window length in minutes, from 1 to 1576800, which wins over
dayswhen both are sent.--grain <value>Bucket width:
minute,hourorday, defaulting today.Parazgjedhja"day"--offset-minutes <n>Minutes east of UTC to cut the buckets in, from -840 to 840, defaulting to 0. Pass
-new Date().getTimezoneOffset()for the local zone.Parazgjedhja0
Shembuj
openemail broadcasts analyticsopenemail broadcasts analytics --days 90openemail broadcasts analytics --jsonE disponueshme edhe në
openemail broadcasts list-recipients
List who a broadcast went to and what happened to each copy
Përdorimi
openemail broadcasts list-recipients <id> [flags]
Resolves one page of the people a broadcast went to, one row per copy, sorted by address. Each row says the copy's status, when it was sent and delivered, whether it bounced or was reported as spam, how often it was opened and clicked, and whether the person unsubscribed from one of the broadcast's audiences after it went out.
Opens and clicks leave out image proxies and link scanners, and stay 0 when the broadcast went out with tracking off. emailId is the copy's msg_ id, which getRecipient reads with its content and emails.get reads as a sent email.
Add --all to walk every page: a table on a terminal, one JSON object per line when piped or with --ndjson, and one { items, hasMore, nextCursor } document with --json. --max <n> stops after that many items.
Argumentet
<id>E detyrueshmeA
brd_id fromsendorlist.
Flamujt
--filter <value>Keeps one group:
pending,sent,delivered,opened,not_opened(sent and never opened),clicked,bounced,complained,failed(failed or cancelled) orunsubscribed.BROADCAST_RECIPIENT_FILTERSnames them.--q <value>Searches the address and the name, ignoring case.
--limit <n>Page size, from 1 to 200. The server defaults to 50.
Parazgjedhja50--cursor <value>The
nextCursorof the previous page. Send the samefilterandqwith it.--allFetch every page and stream the items as they arrive.
--max <n>Stop after this many items. Implies
--all.--ndjsonPrint every item as one JSON object per line. Implies
--all
Shembuj
openemail broadcasts list-recipients brd_5a8c1e3f7b2d94a06c8e1f3bopenemail broadcasts list-recipients brd_5a8c1e3f7b2d94a06c8e1f3b --filter bouncedopenemail broadcasts list-recipients brd_5a8c1e3f7b2d94a06c8e1f3b --all --max 100openemail broadcasts list-recipients brd_5a8c1e3f7b2d94a06c8e1f3b --all > broadcasts.ndjsonE disponueshme edhe në
openemail broadcasts get-recipient
Read one person's copy of a broadcast
Përdorimi
openemail broadcasts get-recipient <id> <email-id> [flags]
Resolves with one copy: the same row listRecipients gives, plus the subject, html and text exactly as that person received them, with the merge fields filled in and their own unsubscribe link. The HTML is from before open and click tracking was added.
Argumentet
<id>E detyrueshmeA
brd_id fromsendorlist.<email-id>E detyrueshmeThe
emailIdof the copy, fromlistRecipients.
Shembuj
openemail broadcasts get-recipient brd_5a8c1e3f7b2d94a06c8e1f3b msg_01dad25067bc4dac966d515dopenemail broadcasts get-recipient brd_5a8c1e3f7b2d94a06c8e1f3b msg_01dad25067bc4dac966d515d --jsonE disponueshme edhe në
openemail broadcasts cancel
Stop a broadcast that is scheduled, queued or still sending
Përdorimi
openemail broadcasts cancel <id> [flags]
Stops a broadcast that is scheduled, queued or sending, including one that has reached everybody while some copies are still waiting to go. Nobody else is added, and every copy still waiting is cancelled. A copy already being handed over finishes, and copies that have gone cannot be recalled, so counts.sent keeps them and counts.cancelled shows what was stopped.
Once every copy has gone out there is nothing left to stop, and the call throws 409 broadcast_not_cancellable. A failed broadcast with copies still waiting can be cancelled to stop them, and one with nothing waiting is refused the same way. Cancelling a broadcast that is already cancelled resolves with it as it stands, so the call is safe to repeat, and the SDK retries it after a network failure.
Argumentet
<id>E detyrueshmeThe
brd_id to cancel.
Shembuj
openemail broadcasts cancel brd_5a8c1e3f7b2d94a06c8e1f3bopenemail broadcasts cancel brd_5a8c1e3f7b2d94a06c8e1f3b --yes