Backend/emails: Use user content as the preview line - #9122
Conversation
MobileInstall the Dev Tool (iOS via TestFlight, iOS Simulator, or Android .apk) here. Scan the QR with your phone camera, or tap Open in Dev Tool on the device, to open this branch in the installed Dev Tool dev client.
Deep linksiOS Android Web (Vercel)View the Vercel web preview for this branch. Backend
Other
|
aapeliv
left a comment
There was a problem hiding this comment.
what about when the user puts in something naughty? i'm not opposed but we gotta be careful here.
how about instead using the subtitle similar to what we do on ios?
737f66f to
73a262d
Compare
I was thinking more along the lines of scammy stuff where it looks like the message is system-generated because it's in the preview line. Either way, I do not think this is any worse than our current practice of putting much user generated content in the subject line. I had a think about this and I see this as no more risky. |
📝 Release NotesThis PR should be included in the release notes. Suggested release note: 🤖 Bot Debug InformationModel: |



We previously inconsistently either reused or paraphrased the email subject as a preview line. I think we should use it to surface the most important information from the email body not redundant with the subject, which is any quoted user content such as the message content or event description. If we don't have that, don't include a preview line (Gmail will show the beginning of the email).
Since those can contain markdown, but preview lines wouldn't display them, adds a
markdown_to_plaintextfunction and refactors our markdown conversion to its own file, with new tests. This allowed me to find a discrepancy with respect to how newlines are interpreted vs the frontend, which I'm aso fixing (seebreaksoption andnewlinerule).Testing
Added markdown/html-related tests. Preview lines themselves are difficult to test without the Gmail client (MailDev) doesn't surface them.
Backend checklist
developif necessary for linear migration historyFor maintainers