0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00
ghost/core/server
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
..
adapters Refactored existing adapters to use adapter-manager 2020-04-05 21:13:47 +02:00
api Returned error upon oembed catch 2020-04-15 10:35:22 +01:00
config Refactored existing adapters to use adapter-manager 2020-04-05 21:13:47 +02:00
data 🐛 Fixed importer always erroring 2020-04-15 13:24:43 +01:00
lib Moved lib/thing/index.js files to lib/thing.js 2020-04-09 10:06:20 +01:00
models Returned full error upon missing tag/label 2020-04-15 10:15:48 +01:00
public Added minified members.js file handling 2020-02-26 14:08:10 +08:00
services Added email card and replacement handling to member emails 2020-04-17 10:23:03 +01:00
translations Remove External Apps 2020-03-20 10:40:22 +00:00
views Update default 404 page 2019-07-15 14:47:01 +02:00
web Fixed spam prevention for private sites 2020-04-15 16:44:53 +01:00
analytics-events.js
ghost-server.js Added debug info to controller process messages 2020-04-06 10:44:39 +01:00
index.js Refactored existing adapters to use adapter-manager 2020-04-05 21:13:47 +02:00
overrides.js
sentry.js Switched Sentry to use helper file for Ghost version 2020-03-26 15:35:46 +00:00
update-check.js Added site URL to Update Check body 2020-03-09 09:48:04 +00:00