Skip to content

Newsletter programs: import, send

The Newsletter Verbs import, send as MCP do programs, with inputs, result, refusals and an example.

Reference for Newsletter, one group of Newsletter programs.

Newsletter.import

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

Text
do: return await $.Newsletter.import(input)

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

JSON
{
  "name": "do",
  "arguments": {
    "code": "return await $.Newsletter.import({ 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
do: return await $.Newsletter.send(input)

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

JSON
{
  "name": "do",
  "arguments": {
    "code": "return await $.Newsletter.send({ newsletter: 'newsletter_FLjN3aQujc', content: 'content_HYlnoorBdP' })"
  }
}