Buttondown Documentation
Want to send routine emails to your audience? Buttondown’s API paired with a Markdown-formatted template document and text replacement scripts let you send variable-filled, realtime emails via Buttondown.
One thing before we get going: It’s always a good idea to have our API reference doc on hand in case you need it!
First things first: Write up an email template in plain text with Markdown formatting. Everything else is up to you.
We recommend adding your email subject on the first line, with your email body after a linebreak. We also recommend adding variables preceded with a dollar sign, like $this
, to easily find and replace them later.
Here’s a very simple example template email:
Or, here’s a much more useful email template: A community email to share the top three Slack threads of the week, from our variable-driven email newsletters guide:
Then, in Terminal, fetch your template file, replace the variables with your up-to-date text, and send it to Buttondown as a draft.
Here’s the code to send that first template email—with code to extract your subject, remove the leading H1 hash, and replace any variables with the correct text:
For a more advanced example, check this Gist for the full code to fetch a Slack channel’s most popular threads, merge them with the Slack template above, then turn them into a Buttondown draft.
Ready to edit your template email, preview it, and send it to your followers? Check our Drafting emails via the API recipe for everything you need—then check the Scheduling emails via the API to queue your email up automatically if you’re confident sending it directly from a template.
Our support team is always here to help. Just send us a message and we'll take a look!