Company
Date Published
Author
Chris Knowles
Word count
1900
Language
English
Hacker News points
None

Summary

Contentful provides a modern approach to generating email notifications that keeps code and design separate, using webhooks functionality and cloud functions to create, schedule, and send campaigns based on publish events in Contentful. The solution uses MailChimp's templates with editable sections, Mustache templating language, and JSON-friendly templating to simplify the process of sending campaigns. To trigger the creation of a campaign in MailChimp, Contentful's webhook is used to send data that is then processed by a cloud function, which generates HTML content using Mustache's render function and sends it to MailChimp for campaign creation. The solution aims to keep template design in MailChimp, minimize errors, and improve scalability.