Start a newsletter
Status planned
Say "start a newsletter" and get a signup box on your page, a Consent record per subscriber, and each issue sent to every one of them.
Collect subscribers on your page and send them each issue by email. Its status is planned: your agent tells you so and runs nothing yet.
Needs Get email at my domain
What you get
- 1Newsletter with a signup box on your pageNewsletter
- 1Consent record per subscriberConsent
- 1issue sent, with an unsubscribe link in every emailMessage
Your agent does
You, to your agent
Start a newsletter.
Start a paid newsletter.
Email my subscribers every week.
# Look up the Mailbox: Mailbox.list
FROM= $(curl "https: //api.sb/ leaseline.app/ mailboxes? limit= 1" \
-H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" | jq -r '.mailboxes[0]["$id"] | split("/ ") | last')
# 1. Newsletter.create
NEWSLETTER= $(curl -X POST https: //api.sb/ leaseline.app/ newsletters \
-H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
-H "Content-Type: application/ json" \
-d '{"name": "Renewal notes", "from": "'"$FROM"'", "topic": "renewal-notes"}' | jq -r '.newsletter["$id"] | split("/ ") | last')
# Look up the Content: Content.list
CONTENT= $(curl "https: //api.sb/ leaseline.app/ content? limit= 1" \
-H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" | jq -r '.content[0]["$id"] | split("/ ") | last')
# 2. Newsletter.send
IDEMPOTENCY_KEY= $(uuidgen)
curl -X POST https: //api.sb/ leaseline.app/ newsletters/ $NEWSLETTER/ send \
-H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
-H "Idempotency-Key: $IDEMPOTENCY_KEY" \
-H "Content-Type: application/ json" \
-d '{"content": "'"$CONTENT"'"}'
import { $ } from 'startup-builder'
const [from] = await $.Mailbox.list({ limit: 1 })
const newsletter = await $.Newsletter.create({ name: 'Renewal notes', from: from.$id, topic: 'renewal-notes' })
const [content] = await $.Content.list({ limit: 1 })
await $.Newsletter.send({ newsletter: newsletter.$id, content: content.$id })
FROM= $(npx startup-builder do Mailbox.list --json '{"limit": 1}' | jq -r '.mailboxes[0]["$id"] | split("/ ") | last')
NEWSLETTER= $(npx startup-builder do Newsletter.create --json '{"name": "Renewal notes", "from": "'"$FROM"'", "topic": "renewal-notes"}' | jq -r '.newsletter["$id"] | split("/ ") | last')
CONTENT= $(npx startup-builder do Content.list --json '{"limit": 1}' | jq -r '.content[0]["$id"] | split("/ ") | last')
IDEMPOTENCY_KEY= $(uuidgen)
npx startup-builder do Newsletter.send --json '{"newsletter": "'"$NEWSLETTER"'", "content": "'"$CONTENT"'"}' --idempotency-key "$IDEMPOTENCY_KEY"
{
"name": "do",
"arguments": {
"code": "const [from] = await $.Mailbox.list({ limit: 1 })\nconst newsletter = await $.Newsletter.create({ name: 'Renewal notes', from: from.$id, topic: 'renewal-notes' })\nconst [content] = await $.Content.list({ limit: 1 })\nreturn await $.Newsletter.send({ newsletter: newsletter.$id, content: content.$id })"
}
}
Change it
- Charge $8 a month for the full issue.
- Import my subscribers from a CSV.
- Send every Monday at 7 a.m.
Under the hood
- Systems
- Email list, Mailboxes, CMS
- Nouns
- Newsletter, Contact, Consent, Content
- Events
Contact.subscribed,Newsletter.sent
Each signup calls Contact.subscribe, which writes one Consent for the Newsletter’s topic. A paid tier is an Offer whose Entitlement gates the full issue and the archive.