Managing lists and custom fields
This sets up a list with custom fields, fills it, and tidies it up. It needs
@skrybe/cli 0.2.0 or newer.
Create a list
LIST=$(skrybe lists create 'Beta testers' --opt-in single)
skrybe lists get "$LIST"
lists create prints the new ID on stdout. Use --opt-in double to make new
subscribers confirm by email first.
Add custom fields
skrybe lists fields add "$LIST" City
skrybe lists fields add "$LIST" Birthday --type date
skrybe lists fields "$LIST"
NAME TYPE TAG
City text [City,fallback=]
Birthday date [Birthday,fallback=]
The TAG column is what to put in an email, for example
Hi from [City,fallback=your city].
Add subscribers
Pass custom fields by name with --field:
skrybe subscribers add ada@example.com --list "$LIST" \
--name 'Ada Lovelace' --field City=Lagos --field Birthday=1990-01-01
From a CSV file of email,name,city:
while IFS=, read -r email name city; do
skrybe subscribers add "$email" --list "$LIST" --name "$name" --field "City=$city" \
|| echo "failed: $email" >&2
done < testers.csv
Adding an address that is already on the list updates its name and fields and still succeeds, so the loop can be re-run.
Check and clean up
skrybe subscribers status ada@example.com --list "$LIST" # Subscribed
skrybe subscribers ls --list "$LIST" --status bounced
skrybe subscribers unsubscribe ada@example.com --list "$LIST" # keeps the record
skrybe subscribers delete ada@example.com --list "$LIST" # removes it
Change fields and lists
skrybe lists fields rename "$LIST" City Town
skrybe lists update "$LIST" --name 'Beta testers 2027' --opt-in double
Renaming a field updates autoresponders and segments that use it, but not
[City,fallback=] tags already written into campaigns and templates; update
those yourself.
Deleting asks first, and needs --yes from a script:
skrybe lists fields delete "$LIST" Town
skrybe lists delete "$LIST" --yes
Deleting a list deletes all its subscribers.