Commit Graph

136 Commits

Author SHA1 Message Date
Sodbileg Gansukh
1a2fa55c1e Fixed product card image overflow in Gmail
no issues

- product card images have explicit width/height attributes, and when the width value is large (e.g. 2560), it causes an overflow on Gmail on Android
- the reason why there's no issue on other email clients is that Gmail on Android has autofit feature which makes the email width fit inside the screen automatically, and it made the email width very narrow when the product card image width isn't responsive
- this fix makes the product card image width responsive by explicitly setting it 100%
2023-08-23 22:02:54 +08:00
Sodbileg Gansukh
2a8c09e3d4
Fixed enormous site icon issue in Outlook (#17672)
refs https://github.com/TryGhost/Product/issues/3704

- the site icon has sizes defined in CSS and it works great for most
browsers
- but it becomes very large in Outlook and it requires explicit sizes in
the image markup for some reason
2023-08-10 17:26:55 -07:00
Steve Larson
8273671425
Updated bookmark card renderer (#17662)
refs https://github.com/TryGhost/Product/issues/3609
-reverted css changes
-reverted mobiledoc renderer
-made lexical renderer consistent with mobiledoc
-css classes were inverted for theme backwards compatibility
2023-08-10 13:41:59 +00:00
Sodbileg Gansukh
6a1906b14e Improved mobile styles of the header card email 2023-08-10 20:07:41 +08:00
Simon Backx
4c8179312d
🎨 Added support for relative links in emails (#17630)
fixes https://github.com/TryGhost/Product/issues/3687

After this change, relative URLs in emails will be replaced with
absolute URLs using the post URL. Making relative Portal URLs possible
etc.

Updates the test data generator to fix invalid URL encoding (somehow a
backslash + escaped double quote was added when it wasn't required).
2023-08-08 13:22:56 +02:00
Sodbileg Gansukh
7d08b4a2fc Fixed background repeat of split header email 2023-08-08 18:50:44 +08:00
Sodbileg Gansukh
209649c556 Adjusted padding of the split header content 2023-08-08 16:08:14 +08:00
Sodbileg Gansukh
267d0fc045 Increased padding of the header card email 2023-08-07 08:37:57 +08:00
Sodbileg Gansukh
b9b959cd3c Header card email typography and spacing 2023-08-07 08:37:57 +08:00
Sodbileg Gansukh
013719f2db Reverted old header card styles and added explicit rules for the new card 2023-08-07 08:37:57 +08:00
Sodbileg Gansukh
4699f5b86e Added email styles for Header v2 2023-08-07 08:37:57 +08:00
Steve Larson
c539417e89
🐛 Fixed bookmark card metadata styles (#17577)
refs TryGhost/Product#3609
- author and publisher styles were mixed up in mobiledoc
- made consistent for author coming after publisher for md and lexical
- updated renderer packages
2023-08-02 14:13:25 -05:00
Ronald Langeveld
0029c444ad
Added test email rate limiting (#17505)
refs https://github.com/TryGhost/Product/issues/3651

- This is a security fix that addresses an issue causing malicious users
to abuse the test / preview email API endpoint.
- We have multiple procedures in place now to limit such users.
- First, we now only allow one email address to be passed into the
`sendTestEmail` method. This method only have one purpose, which is to
compliment the test email functionality within the Editor in Admin and
therefore have no reason to send to more than one email address at a
time.
- We then add an additional rate limiter to prevent a user from making
multiple requests, eg via a script.
- The new imposed limit is 10 test emails per hour.
2023-07-27 08:46:50 +02:00
Ghost CI
fc50d1e92c Merged v5.55.1 into main 2023-07-25 02:46:04 +00:00
Chris Raible
e50ad7561c
🐛 Fixed image rendering in Outlook email client (#17475)
refs TryGhost/Product#3647

- The latest version of juice (which Ghost uses to inline css in email
newsletters) included new functionality to add height="auto" and
width="auto" for any images with dimensions set to auto in css
- This was causing rendering issues in Outlook, which would render the
image at full width, which often added a horizontal scroll and generally
messed up the flow of the document
- This change prevents juice from modifying the height or width of `<img
/>` tags
2023-07-24 18:33:56 -07:00
Michael Barrett
184c6ae951
Retain newsletter subscriptions on suppression (#17373)
refs https://github.com/TryGhost/Product/issues/2610
2023-07-24 10:47:57 +01:00
Steve Larson
22441fe730
Made lexical rendering async (#17438)
-moved lexical rendering to async
-includes rendering for front end and email
-necessary to pull dynamic data into render method, e.g. collections
2023-07-20 17:48:48 -05:00
Sanne de Vries
1a9ca8a993
Added support for nested lists to email newsletter template (#17161)
Refs https://github.com/TryGhost/Team/issues/1919
2023-07-03 11:26:16 +02:00
Michael Barrett
576fba0568
🐛 Fixed members-only content incorrectly showing in plaintext email (#17137)
fixes https://github.com/TryGhost/Ghost/issues/16131

Members only content was incorrectly being shown in a plaintext email
due to the email `preheader` using the post model `plaintext` field
directly (which contained the members-only content). This changes this
behaviour so that the post html content is utilised for the `preheader`
but has all members-only content (post-preview content + segmented
content) removed
2023-06-29 09:40:04 +01:00
Kuba
9601285c3d
Added bulkEmail.batchSize option to configure batch size
refs https://github.com/TryGhost/Ghost/issues/15725

This pull request adds a new configuration option for the Mailgun email
provider that allows the user to set the maximum number of recipients
per email batch via a new config option `bulkEmail.batchSize`
2023-06-26 12:57:44 +02:00
Naz
c507ea9600 Improved oversized batch correction logic
refs 551532f874
refs https://github.com/TryGhost/Team/issues/3324

- After analyzing data dumps, the data revealed that we have extra data from a stray batch. The filtering logic manually filters out the data to the recipients that belong to a "current batch".
- Hunting down the root cause of the data mixup proved to be too expensive of an investigation, so this is a "good enough patch" to deal with the problem.
- Most likely cause is the concurrent batch sending, but reducing the concurrency would be too expensive of a performance price to pay instead of filtering the data rarely.
2023-06-09 14:40:12 +07:00
Naz
efac36c36c
Removed data dump during email batching
refs 551532f874
refs https://github.com/TryGhost/Team/issues/3324

- Having a data dumped in production was a one-off trick to allow us debug the error. Now that we have data it's no longer needed.
2023-06-09 10:44:13 +07:00
Michael Barrett
83847bf22c
Added emailCustomization flag and removed makeItRain flag (#16903)
refs https://github.com/TryGhost/Team/issues/3337

Moved current email customization functionality that is behind the
`makeItRain` to its own flag (`emailCustomization`) and removed the now
redundant `makeItRain` flag
2023-06-01 12:32:37 +01:00
Naz
1605198a1a
Added debug data dump to email service
closes https://github.com/TryGhost/Team/issues/3324

- When the recipients batch size is larger than the limit in addition to logging the error we need extra data to figure out what exactly is inside those `2000` or `3000` records causing faulty behavior.
- This change grabs all available models and dumps them into a file inside of the `content/data` folder. The code is temporary and should be removed once the problem is narrowed down
2023-05-30 21:32:01 +07:00
naz
320c659a1e
Added forced debug output for EmailRecipients fetching (#16823)
refs TryGhost/Team#3229

- The issue we are observing that even though the returned amount of email recipients should not ever accede the max batch size (1000 in case of MailGun), there are rare glitches when this number is doubled and we fetch 2000 records instead.
- The fix takes it's best guess in de-duping data in the batch and then truncates it if the amount of records is still above the threshold. This ensures we at least end up sending the emails out to some of the recipients instead of none.
2023-05-19 17:57:24 +07:00
Fabien "egg" O'Carroll
104f84f252 Added eslint rule for file naming convention
As discussed with the product team we want to enforce kebab-case file names for
all files, with the exception of files which export a single class, in which
case they should be PascalCase and reflect the class which they export.

This will help find classes faster, and should push better naming for them too.

Some files and packages have been excluded from this linting, specifically when
a library or framework depends on the naming of a file for the functionality
e.g. Ember, knex-migrator, adapter-manager
2023-05-09 12:34:34 -04:00
Chris Raible
0b0e3f8e85
Added error handling for email analytics unsubscribe event (#16613)
refs TryGhost/Team#2974

- currently the unsubscribeFromNewsletters event is failing with 'member
not found' in elastic
- this change catches the error and logs it, which should allow the rest
of the event(s) to be processed
2023-04-11 13:13:34 -07:00
Chris Raible
16c625a630
Added retries to flaky email test (#16556)
refs TryGhost/Team#2891

- test was flaking frequently enough that we had to remove it — not a perfect fix but figure it's better to enable retries than to completely remove the test
- ran CI 5 times (x 4 environments) and it passed 5 times in a row
2023-04-05 22:01:59 -07:00
Sanne de Vries
47750f3d23 Fixed email styles leaking from labs flag
Refs https://github.com/TryGhost/Team/issues/2845
2023-04-05 16:27:53 +02:00
Sanne de Vries
92663ea731
Fixed email width and dark mode images in email template (#16566)
Refs https://github.com/TryGhost/Team/issues/2845

---------

Co-authored-by: Fabien "egg" O'Carroll <fabien@allou.is>
Co-authored-by: Simon Backx <simon@ghost.org>
2023-04-05 15:53:51 +02:00
Simon Backx
ec40484983
Reverted " Added email design customization" (#16570) 2023-04-05 15:28:20 +02:00
Simon Backx
ca00a3d682 Fixed duplicate images in Outlook for dark/light mode
refs https://github.com/TryGhost/Team/issues/2671

The inline style display: none; isn't applied to the images in Outlook for some reason. This change manually removes the images in the backend.
2023-04-05 12:58:11 +02:00
Simon Backx
4639514a3b Added email design customization
fixes https://github.com/TryGhost/Team/issues/2671

Co-authored-by: Fabien 'egg' O'Carroll <fabien@allou.is>
Co-authored-by: Sanne de Vries <sannedv@protonmail.com>
2023-04-05 11:13:48 +02:00
Sanne de Vries
57fcfe76d8
Updated images in email template to be work with light/dark mode
refs https://github.com/TryGhost/Team/issues/2845

We needed to update the html out of the cards to include images for light
and dark mode, and then we've used CSS to show/hide them 

Co-authored-by: Fabien "egg" O'Carroll <fabien@allou.is>
2023-04-04 00:32:08 +07:00
Simon Backx
33237c4df7 Added newsletter auto border color and dynamic color picker
fixes https://github.com/TryGhost/Team/issues/2879
fixes https://github.com/TryGhost/Team/issues/2880

- Replaced black border color with 'auto' based on background color.
- When a color is 'auto', the color that are visible in the UI (color pciker) will be dynamic based on the background color.
2023-04-03 11:27:57 +02:00
Sanne de Vries
b8a8b7fd19 Updated newsletter footer section headings to use titleColor
Refs https://github.com/TryGhost/Team/issues/2830
2023-04-03 10:17:51 +02:00
Sanne de Vries
8eefaee591 Implemented newsletter customisation in admin preview
Refs https://github.com/TryGhost/Team/issues/2846
2023-03-30 17:34:01 +02:00
Fabien 'egg' O'Carroll
0f72816951
Newsletter email template customisation (#16523)
Refs https://github.com/TryGhost/Team/issues/2845

Co-authored-by: Sanne de Vries <sannedv@protonmail.com>
2023-03-30 15:33:46 +02:00
Sanne de Vries
4ffb8509b9 Moved inline koenig styles to styles-old.hbs
Refs https://github.com/TryGhost/Team/issues/2845
- In order to have more control over koenig card styling, we're moving some of the inline styles from the koenig repo over to the dedicated email style files.
2023-03-30 12:14:44 +02:00
Fabien "egg" O'Carroll
f4c14410c4 Used feature flag to switch between old and new email design
refs https://github.com/TryGhost/Team/issues/2845

We've copied over the existing styles and html to new files and added a feature
flag based switch to choose which to render. We've also had to remove the
caching of the render function so that the switch can be dynamic and not
require a restart.
2023-03-30 12:21:58 +07:00
Fabien "egg" O'Carroll
f23b869499 Added newsletter design customisation data to template
refs https://github.com/TryGhost/Team/issues/2845

Ideally the calculation of these values would be handled by a Newsletter entity
but we don't have one yet, we can look to fix this if we have time. For now
we're calculating them in separate methods to make it easier to extract in
future.
2023-03-30 12:21:58 +07:00
Simon Backx
109cdeb492 Fixed exporting post metrics without email
no issue

Bookshelf by default returns an empty model when requesting .related('email') for a post without an email. So we need to be a bit smarter to know if a post has an email or not. This fixed an issue where we always showed 'published and emailed' instead of 'published only'.

Since this change also included some changes to test helpers, it also made some changes to the email service because coverage dropped below 100% as a result of fixing the .related method mocking. Ideally we want to move test test helpers to a seperate package in the future.
2023-03-28 12:41:32 +02:00
Rishabh Garg
2e2b3c7c0f
Fixed LinkReplacer bug causing broken links on published post/page (#16514)
refs TryGhost/Team#2840

- moves the `entities.decode()` step to the `LinkReplacer` class so that
it's applied to all links, not just the ones that are replaced in the
email service
- adds a test case to `LinkReplacer` to ensure that the
`entities.decode()` step is applied to all links correctly, decoding any
URLs with HTML entities in them

---------

Co-authored-by: Chris Raible <chris@ghost.org>
2023-03-28 15:59:15 +05:30
Sanne de Vries
387dfa59c9
Fixed issue with email template in Outlook (#16486)
Refs https://github.com/TryGhost/Team/issues/2801

- It was not possible to click latest post links in Outlook due to <a>
tag wrapping around a table
- The post meta data wouldn't display properly when centered in Outlook

---------

Co-authored-by: Simon Backx <simon@ghost.org>
2023-03-24 14:54:16 +01:00
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
Simon Backx
d9c92816e0 Added dynamic text truncation in email latest posts
refs https://github.com/TryGhost/Team/issues/2675

Truncate text depending on mobile/desktop and feature image.
2023-03-24 12:15:16 +01:00
Simon Backx
07b6cda3db Added subscription details to newsletters
fixes https://github.com/TryGhost/Team/issues/2674

Co-authored-by: Sanne de Vries <sannedv@protonmail.com>
2023-03-24 10:54:45 +01:00
Simon Backx
104a81d8c3 Added latests posts to newsletters
fixes https://github.com/TryGhost/Team/issues/2675

Co-authored-by: Sanne de Vries <sannedv@protonmail.com>
2023-03-24 10:54:45 +01:00
Simon Backx
21ded0b4b8 Corrected email link in subscription box
refs https://github.com/TryGhost/Team/issues/2674

The replacement didn't work inside an attribute, so I removed it to a link that doesn't do anything.
2023-03-24 10:23:51 +01:00
Simon Backx
814f7ac6fb Updated latest posts feature image resolution to 100x100
refs https://github.com/TryGhost/Team/issues/2675

Updated resolution to be square and 100x100 (200x200 actual to have retina).
2023-03-24 10:18:37 +01:00