Experiments >

Markdown email idea

Experiment #4313th March, 2021by Joshua Nussbaum

Today I did some thinking about an idea to make transactional e-mail easier for developers.

The idea is to use markdown and git:

# define an email template
vi templates/welcome.md
---
subject: Welcome! Confirm your email
---

Hi {{name}}!

Please confirm your email address:

{{confirmationUrl}}

then, deploy the template with a git-based workflow:

git add templates/welcome.md
git commit -m 'welcome template'
git push

Now we can call it via curl, pass any values we’d like to interpolate:

curl domain.tld/welcome 
  -H "authorization: Bearer <api-key>" 
  --data '{"name": "Josh", "confirmationUrl": "...", "recepient": {"email": "user@example.com"}}'

That’s the gist of it.

I’m gonna try to apply the same concept (markdown + git flow) to a few different areas. Since I’ve already proven that it can work, my focus will be on the marketing portion.

Code

https://svelte.dev/repl/0d853435222f475ea60ee66a74315752?version=3.35.0

Demo

animation
view all experiments

Stay tuned in

Learn how to add more experimentation to your workflow