Is your feature request related to a problem? Please describe.
Janeway's notification system uses the dataclass EmailData when passing email context between views, events and the notification system. Then, it relies on 1st order functions to handle the actual email sending logic. The django team discourages using the internal email api (in particular sanitize_address) as it is not documented. Instead, the recommendation is to use the EmailMessage class which encapsulates both data and behaviour
Describe the solution you'd like
- Find references to
EmailData and swap them for EmailMessage
- Find notifications receiving
EmailData as an argument and swap calls to the first order functions like send_message() for calls to the EmailMessage api (e.g EmailMessage.send())
- If time allows, find any other email notifications not yet using
EmailData but that still rely on sanitize_address() and make use of EmailMessage instead
Additional context
Django's sanitize_address can result on an invalid header with linebreaks when running Django<4.2 or janeway<1.9 (https://code.djangoproject.com/ticket/32008)
Is your feature request related to a problem? Please describe.
Janeway's notification system uses the dataclass
EmailDatawhen passing email context between views, events and the notification system. Then, it relies on 1st order functions to handle the actual email sending logic. The django team discourages using the internal email api (in particularsanitize_address) as it is not documented. Instead, the recommendation is to use theEmailMessageclass which encapsulates both data and behaviourDescribe the solution you'd like
EmailDataand swap them forEmailMessageEmailDataas an argument and swap calls to the first order functions likesend_message()for calls to theEmailMessageapi (e.gEmailMessage.send())EmailDatabut that still rely onsanitize_address()and make use ofEmailMessageinsteadAdditional context
Django's
sanitize_addresscan result on an invalid header with linebreaks when running Django<4.2 or janeway<1.9 (https://code.djangoproject.com/ticket/32008)