0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00
ghost/core/server/services
Kevin Ansfield a801352c7f Added email card and replacement handling to member emails
no issue

- adjusted mega's post serializer to get full email contents
  - fetch `mobiledoc` from the API rather than the pre-rendered `html` and `plaintext`
  - re-generate `html` using the mobiledoc renderer with an "email" target so that the email-only card content is included
  - re-generate `plaintext` from the newly generated email html

- added replacement handling to mega's `getEmailData` function
  - find all of our `%%{replacement "fallback"}%%` instances in the html template and push them into a replacements array with the respective property on the member instance and desired fallback
  - transform the replacement for Mailgun compatibility. Mailgun uses `%recipient.variable_name%` for its template variables so we need to replace our custom replacement string with the compatible version. Our replacements system allows for the same replacement (`{subscriber_name}`) to be used multiple times and have different fallbacks, Mailgun doesn't support fallbacks so for each replacement we also need an indexed `variable_name` part so that we can put our fallbacks in the correct place
  - perform the same Mailgun template transformation for the plaintext version except we re-use the replacements array to avoid bloating the API request to Mailgun with duplicate template variables for every recipient
  - swapped `reduce` for a plain loop for easier readability
2020-04-17 10:23:03 +01:00
..
adapter-manager Added base and default SSO Adapter 2020-04-05 21:13:47 +02:00
auth Added support for token session to /ghost (#11709) 2020-04-06 11:49:14 +02:00
bulk-email Captured bulk-email errors in Sentry 2020-03-04 13:44:23 +00:00
invitations Refactored authentication controller v0.1 (#10893) 2019-07-17 12:28:16 +02:00
mail Allowed localhost email for Ghost Mailer "from" address (#11476) 2020-01-13 12:58:53 +05:30
mega Added email card and replacement handling to member emails 2020-04-17 10:23:03 +01:00
members Added minified members.js file handling 2020-02-26 14:08:10 +08:00
permissions Remove External Apps 2020-03-20 10:40:22 +00:00
settings Added new brand blog setting (#11408) 2019-12-17 16:15:31 +05:30
webhooks Added member.edited webhook 2019-10-31 14:34:50 +00:00
labs.js Updated syntax in labs service 2019-11-06 14:53:53 +07:00
slack.js Added missing semicolon 2020-03-26 16:45:33 +00:00
xmlrpc.js 🏗 Migrated posts.page column to posts.type (#11111) 2019-09-16 11:51:54 +01:00