Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Email broken styles #927

Merged
merged 3 commits into from
Dec 3, 2024
Merged

fix: Email broken styles #927

merged 3 commits into from
Dec 3, 2024

Conversation

spalmurray-codecov
Copy link
Contributor

@spalmurray-codecov spalmurray-codecov commented Dec 2, 2024

This PR fixes the very broken email templates we made. Turns out email clients are very restrictive of what html/css you use... lol. This new email template should be better. Key differences are table layouts and inline styles + removal of a few misc unsupported CSS attributes.

See this slack thread for screenshots.
https://sentry.slack.com/archives/C04MTDH3ZQA/p1732303415357999

@spalmurray-codecov spalmurray-codecov marked this pull request as ready for review December 2, 2024 19:39
@@ -6,286 +6,170 @@
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Poppins:wght@100;300;400;500;600;700;800;900&family=Source+Code+Pro:wght@200;300;400;500;600;700;800;900&display=swap"
/>
<style>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style tags bad

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inline styles good

</head>
<body>
<header>
<svg
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

svgs bad

</tr>
<tr style="height: 25px" />
<tr style="text-align: center">
<!-- these svgs don't work, to get this looking right we'd need to get PNGs served by CDN, perhaps we add these links to our app footer? -->
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coming back to these in the future

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fine to send em for now, SVGs do work on a few email clients (just not popular ones)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

didn't change any copy, just inlined styles and adjusted tags/layouts where necessary.

Copy link

codecov bot commented Dec 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.97%. Comparing base (3eed85d) to head (4f980ad).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #927   +/-   ##
=======================================
  Coverage   97.97%   97.97%           
=======================================
  Files         446      446           
  Lines       35666    35666           
=======================================
  Hits        34942    34942           
  Misses        724      724           
Flag Coverage Δ
integration 42.06% <0.00%> (ø)
unit 90.66% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@codecov-notifications
Copy link

codecov-notifications bot commented Dec 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

Copy link

github-actions bot commented Dec 2, 2024

✅ All tests successful. No failed tests were found.

📣 Thoughts on this report? Let Codecov know! | Powered by Codecov

Copy link
Contributor

@suejung-sentry suejung-sentry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pouring one out for your sanity having to work with html emails 😿

color: rgb(14, 27, 41);
"
>
Your ${{ amount }} payment to Functional Software, Inc, dba
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will amount always be based on currency of USD $? Just double checking

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, there's an upcoming change to these formats to accommodate other currencies though, so this is fine for now.

font-weight: 600;
line-height: 24px;
padding: 25px;
border-radius: 8px;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with falling back to square button yea

color: black;
"
>
Oops! Let's fix this, {{ name }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is name always populated in our system? I could see it being unset sometimes unless we fall back to email or something if they never told us their name

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is passed in by the caller. I believe it's name or username for the owner atm.

@spalmurray-codecov spalmurray-codecov added this pull request to the merge queue Dec 3, 2024
github-merge-queue bot pushed a commit that referenced this pull request Dec 3, 2024
@spalmurray-codecov spalmurray-codecov added this pull request to the merge queue Dec 3, 2024
Merged via the queue into main with commit 3c883aa Dec 3, 2024
23 checks passed
@spalmurray-codecov spalmurray-codecov deleted the spalmurray/fix-emails branch December 3, 2024 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants