From 7c9e44b24ec7f6cbe203ae5832924316a7601193 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 20 Oct 2020 09:43:22 +0100 Subject: [PATCH] Bug 26745: Add TT support to 'title' in notices This patch adds support for using TT syntax in the title element of the notices system. Test plan 1/ Edit an easily triggerable email notice such that the title contains some template toolkit markup. Example: Edit the 'CHECKOUT' notice to include [% today %] in the title field. 2/ Trigger the notice (For 'CHECKOUT' that means checking an item out to a user (Preferably with 'email' selected in their advanced messaging preferences for the notice) 3/ Either, navigate to the 'Notices' tab for the user, or run the message queue and inspect the subject line of the recieved email. 4/ Prior to the patch the TT syntax would remain 'as is'.. i.e '[% today %]'. 5/ After the patch, the TT syntax should have been properly replaced. 6/ Signoff Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi Signed-off-by: Jonathan Druart --- C4/Letters.pm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/C4/Letters.pm b/C4/Letters.pm index b69600fb89..cacd846e98 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -708,6 +708,15 @@ sub GetPreparedLetter { } ); + $letter->{title} = _process_tt( + { + content => $letter->{title}, + tables => $tables, + loops => $loops, + substitute => $substitute, + } + ); + $letter->{content} =~ s/<<\S*>>//go; #remove any stragglers return $letter; -- 2.39.5