Bug 39638 - Notice display modal should respect 'email' message transport type
Summary: Notice display modal should respect 'email' message transport type
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Notices (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: Martin Renvoize (ashimema)
QA Contact: Testopia
URL:
Keywords:
Depends on: 39410
Blocks:
  Show dependency treegraph
 
Reported: 2025-04-15 14:41 UTC by Martin Renvoize (ashimema)
Modified: 2025-04-15 23:56 UTC (History)
2 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize (ashimema) 2025-04-15 14:41:16 UTC
So, we got another step closer to displaying accurate renders of generated notices in a modal from the user notices pages with bug 39410..  However, whilst this properly dissociates the stylesheets used in the staff client from the notice preview modal using shadow DOM.. it does not yet mimic the escaping and reduced function set of HTML that email clients use to render mail.

We should consider message transport type when rendering the display and for email type notices, we should parse them in the same way an email client would.
Comment 1 Martin Renvoize (ashimema) 2025-04-15 14:45:22 UTC
Email clients typically support:

* Inline CSS only

* Basic tags (<table>, <tr>, <td>, <p>, <img>, <a>, etc.)

* No <style>, <script>, or modern CSS like flexbox, grid, etc.

Perhaps I'm looking at this from the wrong level.. we should be considering this when generating email type notices and use an inliner or transposer to convert our modern HTML template driven notices to the restricted rules from above.  We could even bundle something like https://bootstrapemail.com/.
Comment 2 David Cook 2025-04-15 23:55:31 UTC
This sounds pretty interesting. 

Some of the local feedback I got for bug 11583 was about generating previews but I didn't feel confident that we could do a really good preview. This could help a lot with that.
Comment 3 David Cook 2025-04-15 23:56:27 UTC
We could even add some advice near the editor to tell people to keep it simple as you've described, Martin. 

I notice sometimes that libraries want to do these really elaborate emails, but simpler is better imho...