[Koha-bugs] [Bug 35568] Add a plugin hook to allow modification of notices created via GetPreparedLetter

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Dec 14 13:09:45 CET 2023


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35568

--- Comment #1 from Kyle M Hall <kyle at bywatersolutions.com> ---
Created attachment 159832
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=159832&action=edit
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!"

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list