Skip to content

Newsletter commands: import, send

The Newsletter Verbs import, send as CLI commands, with inputs, result, refusals and an example.

Reference for Newsletter, one group of Newsletter commands.

Newsletter.import

Import adds subscribers from a CSV File, keeping each one’s consent basis and the date they subscribed. Verb page.

Text
npx startup-builder do Newsletter.import --json '<input>' [--try | --send | --do]

Emits Newsletter.imported.

Inputs

InputTypeRequiredDescription
newsletterNewsletterrequiredThe Newsletter.
fileFilerequiredThe CSV, one subscriber per row.
basisstringrequiredHow they consented, as the old tool recorded it.

Returns

OutputTypeRequiredDescription
newsletterNewsletterrequiredThe Newsletter, with its new subscribers counted.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.
A row with no email, and skips a suppressed addressrefusedClear what the check names, then call it again.None.

Example

Terminal
npx startup-builder do Newsletter.import --json '{"newsletter":"newsletter_FLjN3aQujc","file":"file_V1AuhyCTsH","basis":"Example basis"}'

Newsletter.send

Send emails one issue, a piece of Content, to every subscribed Contact, and a paid issue only to those whose Offer covers it. Verb page.

Text
npx startup-builder do Newsletter.send --json '<input>' [--try | --send | --do]

Emits Newsletter.sent.

Inputs

InputTypeRequiredDescription
newsletterNewsletterrequiredThe Newsletter.
contentContentrequiredThe issue to send.
atdatetimeWhen to send it. Unset: now.

Returns

OutputTypeRequiredDescription
newsletterNewsletterrequiredThe Newsletter, with the issue in its archive.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

Terminal
npx startup-builder do Newsletter.send --json '{"newsletter":"newsletter_FLjN3aQujc","content":"content_HYlnoorBdP"}'