Repository navigation
AhaSend CLI v0.4.0
This release moves the CLI to AhaSend Go SDK v0.6.0. It adds segments, segment audiences for campaigns, AhaML designs and the contact webhook events. Read the breaking changes before you upgrade scripts.
Breaking changes
templates getshows a template's working copy, the draft while it has one, instead of its published copy, so a change withtemplates updatebuilds on what it shows.templates get --publishedshows the published copy, the one sends use.templates draft getis removed, as the API no longer reads a draft on its own:templates getshows it.templates draftholdsdiscardalone.- The CSV output of
messages sendhas the columnmessage_id_headerafterid, and that ofcampaigns recipientsthe columnssegment_idandsegment_nameafterlist_name. - The CSV output of a template, a template version, a campaign and a campaign template, in the
templates,templates versions,campaignsandcampaigns templatescommands, has the columnsmarkupandmarkup_erroraftermjml. The single views of a template, a campaign and a campaign template end with amarkup_warningscolumn. - The
variablesvalue of a template and a template version names each variable's kind, soitems (required)readsitems (list of name/price; required)for a list. - The CSV output of a campaign, in the
campaignscommands that print one,campaigns sendincluded, has the columnssegment_ids,exclude_list_idsandexclude_segment_idsafterlist_ids. - The limit of 50 lists of
campaigns createandcampaigns updatecounts the excluded lists too, and more fail with--list-id and --exclude-list-id take at most 50 lists in all, got <n>instead of--list-id takes at most 50 lists, got <n>. - The CSV output of a webhook, in
webhooks list,get,createandupdate, has the columnoriginsafterevents. - The event flags of
webhooks updatename the webhook's whole set of 21 events, so an event they do not name, such as a contact event turned on in the dashboard, is turned off.
Added
- The Chocolatey package has the AhaSend icon.
webhooks listenprints on stderr the warnings the stream sends when it connects, such as that the API key does not have the read scope of an event family the webhook turns on, so those events are not sent.messages sendthat makes one request shows each message's Message-ID header, whichmessages list --message-idtakes, after its ID.messages getshows the report message ID of a delivery attempt that was bounced out of band: a Report Message ID column in table output and aReport Message ID:line in plain output.campaigns recipientsshows the segment a recipient was reached through; the List of such a recipient is empty.apikeysandsubaccounts api-keystake thesegments:read,segments:writeandsegments:deletescopes.templates,campaignsandcampaigns templatesread and write the design of the Simple Editor as AhaML (AhaSend Markup).createandupdatetake--markup-file, which makes a created designsimple, andget --markupwrites only the design's AhaML to stdout, so it can be edited and written back.- The views of a template, a template version, a campaign and a campaign template show a design's markup, or why the API could not give it as AhaML, after the MJML, and a write that carried AhaML shows its warnings.
- A write whose AhaML the API refuses lists each problem under the error, with its line and column, outside JSON output.
- A template's variables show their kind: a condition, or a list with the fields of its elements.
- The
segmentsgroup manages segments, which find contacts by rules:list,get,create,update,delete,preview, which counts the contacts a definition matches without saving it, andmembers. A segment's rules come from a JSON definition file, whose keys and JSON types are checked before the request, with the place of each mistake. contacts segmentslists the segments a contact is a member of.campaigns createandcampaigns updatetake--segment-id,--exclude-list-idand--exclude-segment-id, so a campaign sends to segments and leaves out the contacts of lists and segments, up to 10 segments in all.campaigns updatetakes--clear-lists,--clear-segments,--clear-exclude-listsand--clear-exclude-segments. The view of a campaign shows its segments, excluded lists and excluded segments after its lists.- A campaign send or test refused with the
text_uncheckedissue ends with a line that says to run the command again, with a new--idempotency-keyfor a send that had one. - The webhook commands take 21 events:
unsubscribed,complainedandsuppression_deletedjoin the others, with eight contact events, such ascontact_createdandcontact_added_to_list, which need an account with the marketing features and thecontacts:readscope, andlists:readfor some.webhooks create,updateandtriggertake--all-contact-events, which selects the contact events. webhooks createandwebhooks updatetake--origins, which picks whose changes the contact and suppression events report, andwebhooks updatetakes--all-origins. The views of a webhook show its origins after its events.webhooks list --eventslists only the webhooks that have every event it names on.
Changed
- Plain output prints no blank line under a template's MJML, HTML or text that ends in a newline.
messages getandmessages cancelhelp describe the message ID as the message'sid, a UUID, whichmessages sendprints. The error for an ID that is not valid now ends innot a UUID.smtp sendhelp says to find a sent message withmessages list --message-idand the Message-ID the command printed.smtp send,messages getandmessages list --show-detailslabel the Message-ID headerMessage-ID, notMessage ID.- The
messages list --message-idhelp says it filters by the Message-ID header, with its angle brackets. - The error of
templates createandcampaigns templates createwithout a design file or--editor, and the "at least one of" errors of theupdatecommands oftemplates,campaignsandcampaigns templates, name--markup-file. - The "at least one of" error of
campaigns updatenames the audience flags, and its error for an empty--list-idnames--clear-lists. - The help of
campaigns create,update,duplicateandsendsays what to do while a segment of the campaign is building, and that ofcampaigns sendthat the API stores its answer to a send with--idempotency-key, a refusal included. The help oflists deleteandcampaigns deletesays the API refuses while a segment refers to the list or campaign. --all-eventsofwebhooks create,updateandtrigger, andallin the events prompt ofwebhooks create, select every event except the contact events. The "at least one of" errors ofwebhooks updateandwebhooks trigger, and the error for a blank answer to the events prompt, name--all-contact-events; the error ofwebhooks updatealso names--originsand--all-origins.
Installation
See the installation instructions.
Checking a download
checksums.txt has the SHA-256 of every asset. Download it next to the files, then run sha256sum --ignore-missing -c checksums.txt on Linux, or shasum -a 256 --ignore-missing -c checksums.txt on macOS.