-
Notifications
You must be signed in to change notification settings - Fork 391
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
Add styled default email templates #6912
Conversation
Avoids issues with outlook and IE conditional tags
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good conceptually, but I wasn't looking at the code closely.
<td style="width: 150px"> | ||
<img | ||
alt=" | ||
{f'{app_name} logo' if app_name else ''} | ||
" | ||
height="150" | ||
src="{logo_url}" | ||
style=" | ||
border: none; | ||
display: block; | ||
outline: none; | ||
text-decoration: none; | ||
height: 150px; | ||
width: 100%; | ||
font-size: 13px; | ||
" | ||
width="150" | ||
/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went with 150x150 here for lack of a better idea. Another option is to have the width set to 150 and have the height be auto
which would preserve the aspect ratio. We don't give much guidance to the developer about aspect ratio and size, and I think we should.
Even though we don't actually use this parameter, we pass it from callers via kwargs, so it's easier to just keep it.
Would you consider exposing an option for the user to retrieve the link and send their own transactional e-mails so that they can be styled by the user? |
We have a near term plan to allow setting the email templates (keep an eye on #6868) that would allow totally custom emails via your configured SMTP server, but we're likely going to still maintain the flows within the auth server/extension rather than exposing an API that you could piece something together with to send your own emails. In some senses, all of these flows are something that you could replace with your own bespoke flows since all of the data lives in your database. If you store the signing key securely on your server you could issue your own auth tokens, so you could implement your own password recovery and email verification flows directly. A bit of a heavy lift, but totally doable since the server code we're including here isn't privileged in any way that your own code isn't. |
Used MJML to produce some reasonable email templates based on some designs provided by Roman. I considered basically translating MJML into "components" but there are some tricky ways they wrap certain kinds of elements. Probably still doable, but I ran out of patience.
Here is the general shape (showing the magic link email)