Is there an existing issue for this?
Current Behavior
In emails where rich text content is shown, it also shows the HTML tags and some random HTML comments (screenshot shown below). This behaviour is seen in development and likely is also happening in production. These emails includes:
DistributionMailer.partner_mailer - Sent when a new distribution is created or an existing one is updated.
ReminderDeadlineMailer.notify_deadline - Sent on set reminder_day for PartnerGroup or for Organization if reminder_day is not set for PartnerGroup. (In production, this email does not include the rich text content as of yet. But this PR will introduce this feature and it adds rich text content.)
Screenshot of the email:
Expected Behavior
The plain text versions of the emails should not show any HTML (comments or tags).
Steps To Reproduce
- Sign in as an org/bank admin user -- for example
org_admin1@example.com
- In "My Organization" page, ensure that the field
Default email text: has some text with some formatting applied. If it's empty, add some text with any formattings.
- Pick a Partner for which we'll create a Distribution so that the email is sent -- for example, use partner
Pawnee Parent Service -- edit the Partner Information by checking the Do you want this partner to receive emails for distributions and reminders from the system? setting.
- Create any Distribution for the Partner selected in the last step.
- An email should be sent to the Partner. In development environment, the email is saved under
tmp/letter_opener -- Voilà, issue found! 🎉 -- the text.erb version will have the HTML comments and tags which shouldn't be there.
Environment
- OS:Ubuntu 24.04.1 (WSL virtualization)
- Node:
- npm:
Criteria for Completion
Anything else?
Screenshot of the email:
Additional notes:
This bug is found while working on #5093 PR.
This is where the rich text is rendered:
|
<%= @default_email_text_interpolated %> |
Code of Conduct
Is there an existing issue for this?
Current Behavior
In emails where rich text content is shown, it also shows the HTML tags and some random HTML comments (screenshot shown below). This behaviour is seen in development and likely is also happening in production. These emails includes:
DistributionMailer.partner_mailer- Sent when a new distribution is created or an existing one is updated.ReminderDeadlineMailer.notify_deadline- Sent on setreminder_dayfor PartnerGroup or for Organization ifreminder_dayis not set for PartnerGroup. (In production, this email does not include the rich text content as of yet. But this PR will introduce this feature and it adds rich text content.)Screenshot of the email:
Expected Behavior
The plain text versions of the emails should not show any HTML (comments or tags).
Steps To Reproduce
org_admin1@example.comDefault email text:has some text with some formatting applied. If it's empty, add some text with any formattings.Pawnee Parent Service-- edit the Partner Information by checking theDo you want this partner to receive emails for distributions and reminders from the system?setting.tmp/letter_opener-- Voilà, issue found! 🎉 -- thetext.erbversion will have the HTML comments and tags which shouldn't be there.Environment
Criteria for Completion
DistributionMailer.partner_mailer-- thetext.erbversion of email should not show any HTML comments/tags.Anything else?
Screenshot of the email:
Additional notes:
This bug is found while working on #5093 PR.
This is where the rich text is rendered:
human-essentials/app/views/distribution_mailer/partner_mailer.text.erb
Line 4 in ac675e8
Code of Conduct