liqd / a4-meinberlin

The central participation platform of the city of Berlin, Germany
https://mein.berlin.de
GNU Affero General Public License v3.0
40 stars 6 forks source link

#8433 fix: improve text-based emails (remove html) - some mails still have html tags in the plaintext part #5725

Open sblindow opened 1 month ago

sblindow commented 1 month ago

expected behaviour:

As a user I want to have the option to read all mein.berlin mails in clean plaintext.

behaviour:

After the Improvement, some mails still have html tags in them:

'office worker notification' and 'submitter confirmation'

https://github.com/liqd/a4-meinberlin/blob/219819b1f40b062ae2cd553bad26da6bf700de74/meinberlin/apps/bplan/templates/meinberlin_bplan/emails/office_worker_notification.de.email https://github.com/liqd/a4-meinberlin/blob/219819b1f40b062ae2cd553bad26da6bf700de74/meinberlin/apps/bplan/templates/meinberlin_bplan/emails/submitter_confirmation.de.email

The user statement that is inserted at the bottom of these two emails is encapsulated by an html paragraph tag.

screenshots:

new-statement

your-statement

'notify creator on moderator feedback'

https://github.com/liqd/a4-meinberlin/blob/219819b1f40b062ae2cd553bad26da6bf700de74/meinberlin/apps/notifications/templates/meinberlin_notifications/emails/notify_creator_on_moderator_feedback.de.email https://github.com/liqd/a4-meinberlin/blob/219819b1f40b062ae2cd553bad26da6bf700de74/meinberlin/apps/notifications/templates/meinberlin_notifications/emails/notify_creator_on_moderator_feedback.en.email 

In this mail the greeting is encapsulated by html tags. Another Issue you can see in the plaintext is the 'Rückmeldung:' string. This is not visible in the html version of the mail (see screenshot).

screenshot

moderator-feedback

moderator-feedback_html

Newsletter, Initiator Mail and Platform Mail

Links to the code were not in the US so these might have been overlooked. These can be sent by Initiators in the Organization Dashboard.

screenshots

newsletter

initiator-mail

vellip commented 1 month ago

also a sentry error:

UnicodeEncodeError: 'utf-8' codec can't encode characters in position 191-192: surrogates not allowed (16 additional frame(s) were not displayed) ... File "meinberlin/apps/newsletters/emails.py", line 25, in dispatch return super().dispatch(object, *args, **kwargs)

CarolingerSeilchenspringer commented 2 weeks ago

@vellip @hom3mad3 who can handle this issue? the respective story is already closed (as we decided on the new issue process afterwards).

hom3mad3 commented 2 weeks ago

@CarolingerSeilchenspringer @vellip wonder if this could be handled with the new email template story? @MarleyMi is already aware

CarolingerSeilchenspringer commented 2 weeks ago

good idea @hom3mad3 ! @MarleyMi I added a link to this issue to the story.