-
Notifications
You must be signed in to change notification settings - Fork 10
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
Emails sent from the site are not rendered nicely any more #338
Comments
This is more serious than it first seems. In doing some more testing around this, the link can sometimes get truncated in the linked portion of the email, meaning that the user can never click on it and change their password: When they click it, they get to the page to reset their password, but it never works because the token is incorrect. To make it work, they would have to notice and then copy and paste the text portion. |
This is getting worse. In the above example, the token rendered in the email is |
Does the SendGrid API allow for sending text emails only? A workaround until we can get it working properly would be to comment out the line that includes the HTML version so only the text version of emails is sent. |
I'm not convinced this is down to the email being in HTML, but something to do with how SendGrid formats them. In the previous reset emails (before the recent refactorings), the link to reset (on the button) was of the form In the new emails, no such reformatting occurs, resulting in a broken link. For the time being, I've disabled sending of HTML emails and pushed that to production (it does make the submitted session emails look really pants, but that's better than preventing people from being able to log in). The recent email changes will need looking at again to fix it though. |
Agreed it needs looking at again. The problem here isn't SendGrid, it's the Markdown library. The new emailing code works as follows:
The issue is that the password reset link is substituted before the template is passed for Markdown rendering, so the URL is run through the Markdown parser too. Pairs of underscores in Markdown of course mean "make this text italic", and there seems to be a precedence issue in the Markdown parser causing underscores in the URL to be replaced with HTML. The fix might be as simple as upgrading to a newer version of MarkdownSharp (or whatever it's called). |
Ah yes, that would explain why the link appears as partially italicised. We should probably only run the session abstract through the markdown parser, not the whole email, as that is the only bit we want converting. |
I've undone the PR that introduced this bug, to ensure that the password reset emails are working properly. The changes that originally went in will need looking at again to not introduce the issue. |
This is a regression caused by #330.
Before the change, the HTML emails were formatted nicely, and had a text-specific version inside them (different content and differently formatted so as to be suitable for reading in a text client):
After the changes to email the submissions to submitters, the emails now don't look nice, and the text and HTML versions appear to have the same content:
There is also a duplicate bit of text about how to contact us (reported separately in #335).
The text was updated successfully, but these errors were encountered: