Bug 37918 - Properly encode email subjects in mailto: links
Summary: Properly encode email subjects in mailto: links
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Martin Renvoize
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-13 14:05 UTC by Katrin Fischer
Modified: 2024-09-16 09:42 UTC (History)
1 user (show)

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


Attachments
Bug 37918: Add email_header template toolkit filter (4.92 KB, patch)
2024-09-16 09:31 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2024-09-13 14:05:38 UTC
There are some places in Koha where we use mailto: links with a subject line. 
An example is the email link added by bug 36595.

I believe we need to take a closer look at making sure we are encoding the subject line correctly.

Also need to make sure to not include untranslatable and therefore hardcoded bits into the subject messages.
Comment 1 Martin Renvoize 2024-09-13 14:13:15 UTC
So, on my quick research I reckon we need a new TT filter to make sure subjects are properly RFC2047 encoded.

We should be able to add that fairly trivially using Encode::MIME::Header I think.
Comment 2 Martin Renvoize 2024-09-16 09:31:51 UTC
Created attachment 171518 [details] [review]
Bug 37918: Add email_header template toolkit filter

This patch adds a new email_header TT filter to properly encode strings
according to RFC2047 as per the email specification.  This allows
developers to set default subjects in mailto links with the correct
encoding.