Koha/C4
Kyle M Hall ad1d8fd561
Bug 35568: Add a transform_prepared_letter plugin hook to allow modification of notices created via GetPreparedLetter
A plugin hook for GetPreparedLetter would be very useful. It could be used to add universal headers and/or footers to messages, attach news, and modify notices in other ways in whole or in part. It could even be used for call webhooks when certain types of notices are sent.

For example, the MessageBee ( https://uniquelibrary.com/messagebee/ ) plugin for Koha generates YAML based notice content, which is then further processed by the before_send_messages hook. This process is unreliable due to the possible changes in data between the creation of the yaml and the reading of that yaml and transforming it into JSON with much more data. For example, the yaml may contain an issue_id, but that checkout may have been returned in the meantime. A hook like this would allow the MessageBee plugin to skip the yaml step and create the json data directly which is then sent to MessageBee for transmission to the patron.

Test Plan:
1) Apply this patch
2) prove t/db_dependent/Koha/Plugins/Transform_prepared_letter_hook.t
3) Download and install the Kitchen Sink plugin v2.4.0
   https://github.com/bywatersolutions/dev-koha-plugin-kitchen-sink/releases/tag/v2.4.0
4) Generate any notice or slip, such as a checkin or checkout notice
5) Note that all notices now end with "Thanks for using your local library!"

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-22 08:57:38 +02:00
..
AuthoritiesMarc
Barcodes
ClassSortRoutine Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
ClassSplitRoutine Bug 28572: Remove C4::Debug 2021-06-22 12:04:32 +02:00
Creators Bug 10762: (QA follow-up) Perltidy 2023-10-25 10:35:31 -03:00
External Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Form Bug 28572: Remove C4::Debug 2021-06-22 12:04:32 +02:00
Heading Bug 21828: build $bib_heading_fields only once per invocation 2023-09-22 12:57:46 -03:00
ILSDI Bug 34893: ILS-DI can return the wrong patron for AuthenticatePatron 2024-02-02 17:31:46 +01:00
Installer
Labels Bug 10762: (QA follow-up) Perltidy 2023-10-25 10:35:31 -03:00
Linker Bug 30280: Add support for subject headings from different thesaurus when using Elasticsearch 2022-10-03 10:00:04 -03:00
Members Bug 33239: Add the ability to run borrowers-force-messaging-defaults.pl only on a specified message name 2023-10-11 10:31:46 -03:00
OAI Bug 30308: Fix bulkmarcimport.pl broken by OAI-PMH:AutoUpdateSets(EmbedItemData) 2022-07-29 15:43:39 -03:00
Output Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Patroncards Bug 34532: Silence warns in Patroncard.pm 2023-09-15 11:57:08 -03:00
Reports
Search Bug 30718: Use flatpickr's altInput 2022-08-19 08:26:31 -03:00
Serials
SIP Bug 36386: Pass user and group to Net::Server 2024-04-18 16:51:16 +02:00
Utils/DataTables Bug 34913: Fix perlcritic for VirtualShelves.pm 2024-01-29 12:24:54 +01:00
Accounts.pm
Acquisition.pm Bug 14092: (QA follow-up) Avoid fiddling with the hash in the template 2023-10-20 16:31:15 -03:00
Auth.pm Bug 23102: 404 errors on page causes SCI user to be logged out 2024-04-12 12:12:30 +02:00
Auth_cas_servers.yaml.sample
Auth_with_cas.pm Bug 34893: (QA follow-up) Tidy code for qa script 2024-02-02 17:31:47 +01:00
Auth_with_ldap.pm Bug 34893: ILS-DI can return the wrong patron for AuthenticatePatron 2024-02-02 17:31:46 +01:00
Auth_with_shibboleth.pm Bug 34893: ILS-DI can return the wrong patron for AuthenticatePatron 2024-02-02 17:31:46 +01:00
AuthoritiesMarc.pm Bug 29522: [alternate] Skip relinking bibliographic records when merging authorities 2024-03-15 15:39:15 +01:00
Barcodes.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Biblio.pm Bug 36473: (follow-up) Additionally warn the stringified exception 2024-04-18 16:51:18 +02:00
Breeding.pm Bug 28166: (QA follow-up) Fix and tidy tests and code 2023-10-23 11:33:50 -03:00
Budgets.pm Bug 31631: Optionally use tax-exclusive values for calculating fund values 2023-10-18 15:41:35 -03:00
Calendar.pm Bug 32048: Added clear cache routine to delete_holiday_range_repeatable 2023-09-18 15:31:50 -03:00
Charset.pm
Circulation.pm Bug 35394: Correction to booked items logic 2024-04-19 18:06:34 +02:00
ClassSortRoutine.pm
ClassSource.pm
ClassSplitRoutine.pm
Context.pm Bug 33431: Make C4::Circulation use C4::Context->yaml_preference 2024-03-18 11:03:37 +01:00
Contract.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
CourseReserves.pm Bug 30016: Remove GetOpenIssue subroutine 2022-08-31 08:50:37 -03:00
Creators.pm
Heading.pm Bug 33557: Add LinkerConsiderThesaurus system preference 2023-05-10 15:26:26 -03:00
HoldsQueue.pm Bug 35432: Expand comments to explain the priority of filling requests 2024-04-16 17:59:50 +02:00
HTML5Media.pm Bug 18984: Remove NORMARC support 2021-10-07 15:36:40 +02:00
ImportBatch.pm Bug 35438: Remove skip_intermediate_commit parameter 2024-01-16 12:06:08 +01:00
ImportExportFramework.pm Bug 13952: (follow-up) JS translatability, clean warns, other 2022-04-04 16:23:46 +02:00
InstallAuth.pm Bug 36102: Fix expired session on the login page of the installer (?) 2024-03-01 11:00:35 +01:00
Installer.pm
ItemCirculationAlertPreference.pm
Items.pm Bug 32029: Automatic item modifications by age add biblio table 2024-01-26 15:13:50 +01:00
Koha.pm Bug 35833: Fix warnings from C4/Koha 2024-01-29 12:24:58 +01:00
Labels.pm
Languages.pm Bug 32775: (QA follow-up) Fix tab and indenting issues 2023-05-15 18:23:54 -03:00
Letters.pm Bug 35568: Add a transform_prepared_letter plugin hook to allow modification of notices created via GetPreparedLetter 2024-04-22 08:57:38 +02:00
Linker.pm
Log.pm Bug 32057: (QA follow-up) Remove pretty flag 2023-03-14 08:49:34 -03:00
MarcModificationTemplates.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Matcher.pm
Members.pm Bug 26170: Add protected status for patrons 2023-11-01 17:23:06 -03:00
Message.pm
Output.pm Bug 34478: Remove check_csrf from pl files 2024-03-01 10:56:01 +01:00
Overdues.pm
Patroncards.pm
Record.pm Bug 33431: Make C4::Record use C4::Context->yaml_preference 2024-03-18 11:03:38 +01:00
Reports.pm
Reserves.pm Bug 35491: Add logging to RevertWaitingStatus 2023-12-19 13:42:13 +01:00
Ris.pm Bug 33431: Fix remaining cases 2024-03-18 11:03:39 +01:00
RotatingCollections.pm Bug 31735: Avoid re-fetcing objects from database by passing them directly instead of ids to various subroutines 2023-05-12 12:40:21 -03:00
Scheduler.pm
Scrubber.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Search.pm Bug 35833: Silence few warnings from searching 2024-01-29 12:24:58 +01:00
Serials.pm Bug 31846: (QA follow-up) Tidy code to make qa script happy 2023-10-25 10:35:28 -03:00
Service.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
ShelfBrowser.pm
SMS.pm Bug 36051: (QA follow-up): Use yaml_preference 2024-04-12 11:26:12 +02:00
SocialData.pm
Stats.pm Bug 33608: (QA follow-up) Remove ->insert method 2023-10-25 11:07:59 -03:00
Suggestions.pm
Tags.pm
Templates.pm Bug 35070: Tidy 2024-01-04 16:51:45 +01:00
TmplToken.pm Bug 16011: $VERSION - Remove the $VERSION init 2016-03-24 17:20:28 +00:00
TmplTokenType.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
TTParser.pm
UsageStats.pm
XISBN.pm Bug 30813: (QA follow-up) Adjust three use statements 2022-06-08 11:40:32 -03:00
XSLT.pm Bug 33217: Tidy 2023-11-08 17:52:42 -03:00