Bug 37918

Summary: Properly encode email subjects in mailto: links
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: TemplatesAssignee: Martin Renvoize (ashimema) <martin.renvoize>
Status: Signed Off --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: martin.renvoize, shi-yao.wang
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36595
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
Bug 37918: Add email_header template toolkit filter

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 (ashimema) 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 (ashimema) 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.
Comment 3 Shi Yao Wang 2024-09-26 15:56:27 UTC
Created attachment 171994 [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.

Signed-off-by: Shi Yao Wang <shi-yao.wang@inlibro.com>
Comment 4 Shi Yao Wang 2024-09-26 15:58:49 UTC
Assuming I only needed to make sure the test passes for the sign-off.

Should we include refactoring of mailto with subject in this bug?