Skip to content

Newsletter methods: update, delete

The Newsletter Verbs update, delete as typed SDK methods, with inputs, result, refusals and an example.

Reference for Newsletter, one group of Newsletter methods.

Newsletter.update

Changes the given properties of a Newsletter. Verb page.

TypeScript
interface NewsletterVerbs {
  update(input: NewsletterUpdateInput, options?: SB.CallOptions): SB.Call<Newsletter>
}

Emits Newsletter.updated.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Newsletter.
namestringWhat subscribers see it called.
fromMailboxThe broadcast Mailbox each issue sends from.
topicstringThe topic a Contact subscribes to, recorded with their Consent.
offerOfferThe Offer whose Subscription unlocks paid issues and the archive.

Returns

OutputTypeRequiredDescription
newsletterNewsletterrequiredThe Newsletter.

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

TypeScript
import { $ } from 'startup-builder'

const newsletter = await $.Newsletter.update({ id: 'newsletter_FLjN3aQujc', name: 'Leaseline notes' })

Newsletter.delete

Deletes a Newsletter: a soft delete that keeps its history, undone by Thing.restore. Verb page.

TypeScript
interface NewsletterVerbs {
  delete(input: NewsletterDeleteInput, options?: SB.CallOptions): SB.Call<Newsletter>
}

Emits Newsletter.deleted.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Newsletter.

Returns

OutputTypeRequiredDescription
newsletterNewsletterrequiredThe Newsletter.

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

TypeScript
import { $ } from 'startup-builder'

const newsletter = await $.Newsletter.delete({ id: 'newsletter_FLjN3aQujc' })