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.
npx startup-builder do Newsletter.import --json '<input>' [--try | --send | --do]Emits Newsletter.imported.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
newsletter | Newsletter | required | The Newsletter. |
file | File | required | The CSV, one subscriber per row. |
basis | string | required | How they consented, as the old tool recorded it. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
newsletter | Newsletter | required | The Newsletter, with its new subscribers counted. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use 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 address | refused | Clear what the check names, then call it again. | None. |
Example
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.
npx startup-builder do Newsletter.send --json '<input>' [--try | --send | --do]Emits Newsletter.sent.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
newsletter | Newsletter | required | The Newsletter. |
content | Content | required | The issue to send. |
at | datetime | When to send it. Unset: now. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
newsletter | Newsletter | required | The Newsletter, with the issue in its archive. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
Example
npx startup-builder do Newsletter.send --json '{"newsletter": "newsletter_FLjN3aQujc", "content": "content_HYlnoorBdP"}'