ephios icon indicating copy to clipboard operation
ephios copied to clipboard

`NotificationDetailView` does not use the `NotificationType`'s template

Open felixrindt opened this issue 6 months ago • 2 comments

Describe the bug When rendering a notification, e.g. for a NewEvent, the template of the type is not used in NotificationDetailView, leading to display not in correspondance with email content.

To Reproduce Steps to reproduce the behavior:

  1. Create an Event and send a NewEvent-Notification
  2. View the notification in it's detail view.
  3. See missing event date and time information

Expected behavior The content should be shown in full as templated in the Notifcation Type.

Additional info To fix this might need some refactoring, as the template currently contains the whole email, not just the actual notification content parts. With content only inside the template, NewEventNotificationType is inconsistent with it's plaintext not containing any date/time info.

https://github.com/ephios-dev/ephios/blob/7a7a4e1fb245b613b057a2e9c36ece32aff08bdc/ephios/core/services/notifications/types.py#L207-L218

I'd suggest changing the role of the notification type template. It should only apply to the body of the mail where the plaintext is rendered into. That way, we could render the body alone for displaying notifications in the browser as well.

felixrindt avatar May 20 '25 10:05 felixrindt

Your suggestion may still lead to weird behaviour because of heading levels etc, so that may need further work.

On the other hand we are only using a separate HTML template for the NewEventNotification, which is also so simple that it could just use plaintext. Then we could remove the custom HTML templates alltogether.

jeriox avatar May 25 '25 12:05 jeriox

On the other hand we are only using a separate HTML template for the NewEventNotification, which is also so simple that it could just use plaintext. Then we could remove the custom HTML templates alltogether.

Yeah probably simplest for now.

felixrindt avatar May 25 '25 18:05 felixrindt