diff --git a/functions/digest.js b/functions/digest.js new file mode 100644 index 0000000..c9b2417 --- /dev/null +++ b/functions/digest.js @@ -0,0 +1,145 @@ +const { + MAILCHIMP_API_KEY, + MAILCHIMP_SERVER_PREFIX, + MAILCHIMP_LIST_ID, + MAILCHIMP_DIGEST_TEMPLATE_ID, +} = process.env +const { schedule } = require('@netlify/functions') +const mailchimp = require('@mailchimp/mailchimp_marketing') +let emailHTML = '' + +mailchimp.setConfig({ + apiKey: MAILCHIMP_API_KEY, + server: MAILCHIMP_SERVER_PREFIX, +}) + +const postTemplate = (title, excerpt, image, date, slug) => { + return `
+
+
+
+
|
+