Create, test and send a campaign from the terminal
This walks a campaign from an HTML file to a list, checking it on the way.
It needs @skrybe/cli 0.2.0 or newer.
1. Find the list
skrybe lists --counts
ID NAME ACTIVE
l7763lkC1Ld892Ty4p3pvxw Newsletter 1,204
Keep the ID in a variable:
LIST=l7763lkC1Ld892Ty4p3pvxw
2. Create a draft
From an HTML file:
skrybe campaigns create \
--title 'Q4 newsletter' --subject 'Your Q4 update' \
--from-name Acme --from-email hello@acme.test --reply-to hello@acme.test \
--html-text file://q4.html
# ✓ Campaign created (id 42).
Or from a saved template, which supplies the body and sender:
skrybe templates # find the template ID
skrybe campaigns create --template 7 --title 'Q4 newsletter' --subject 'Your Q4 update'
To capture the new ID in a script, use JSON output:
ID=$(skrybe campaigns create --template 7 --title 'Q4 newsletter' \
--subject 'Your Q4 update' --output json | jq -r .campaign_id)
3. Check it
skrybe campaigns get "$ID"
skrybe campaigns get "$ID" --content > check.html # the HTML, to open in a browser
Fix anything with campaigns update. Only the fields you pass change:
skrybe campaigns update "$ID" --preheader 'Three things we shipped this quarter'
skrybe campaigns update "$ID" --html-text file://q4-v2.html
4. Send a test
skrybe campaigns test "$ID" --to ada@example.com --to team@example.com
# ✓ Test of campaign 42 sent to ada@example.com.
# ✓ Test of campaign 42 sent to team@example.com.
Up to 5 addresses per call, and 20 test sends an hour per brand.
5. Count the recipients
skrybe campaigns send "$ID" --list "$LIST" --dry-run
# ✓ Campaign 42 would go to 1,204 recipients. Nothing was sent.
A dry run runs every check the real send does, so an unverified From domain, a wrong list ID or an exhausted quota shows up here.
6. Send it, or schedule it
Send now:
skrybe campaigns send "$ID" --list "$LIST"
# Send campaign 42 to 1,204 recipients? [y/N] y
# ✓ Campaign 42 is sending to 1,204 recipients.
Or schedule it:
skrybe campaigns schedule "$ID" --list "$LIST" --at '2027-06-15 18:05' --timezone Africa/Lagos
Changed your mind? skrybe campaigns unschedule "$ID" turns it back into a
draft. Running schedule again on a scheduled campaign moves it.
In a script, add --yes to send or schedule, since there is no one to
answer the prompt.
7. Follow the results
skrybe campaigns stats "$ID"
skrybe campaigns activity "$ID" --type clicks
skrybe campaigns activity "$ID" --type bounces --all --output text | cut -f1 > bounced.txt