0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00
ghost/ghost/email-service
Chris Raible 64c9e66b56
🐛 Fixed broken link tracking in newsletters (#16473)
refs https://github.com/TryGhost/Team/issues/2805

When we render mobiledoc to HTML, it automatically escapes HTML entities in the process, so a button or directly pasted link with href="https://example.com?code=test" will be rendered as href="https://example.com?code&#x3Dtest" as the url is encoded in the rendered HTML. Our link tracking was using the encoded URL as the redirect URL in newsletters, causing certain links to break.

This change updates the link tracking to decode the URL with `entities.decode(url)` so we store the correct redirect URL in our DB and ensure link tracking redirects to the correct url from newsletters.

---------

Co-authored-by: Rishabh <zrishabhgarg@gmail.com>
2023-03-24 18:44:55 +05:30
..
lib 🐛 Fixed broken link tracking in newsletters (#16473) 2023-03-24 18:44:55 +05:30
test 🐛 Fixed broken link tracking in newsletters (#16473) 2023-03-24 18:44:55 +05:30
.eslintrc.js
index.js Added mailgun provider for sending emails (#15896) 2022-11-30 16:21:58 +05:30
package.json 🐛 Fixed broken link tracking in newsletters (#16473) 2023-03-24 18:44:55 +05:30
README.md

Email Service

Manages how posts are sent via email

Usage

Develop

This is a monorepo package.

Follow the instructions for the top-level repo.

  1. git clone this repo & cd into it as usual
  2. Run yarn to install top-level dependencies.

Test

  • yarn lint run just eslint
  • yarn test run lint and tests