Bug 41733

Summary: Honor EmailPatronRegistrations preference in the API
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: REST APIAssignee: Nick Clemens (kidclamp) <nick>
Status: Needs Signoff --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: tomascohen
Version: Main   
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 41733: Unit tests
Bug 41733: Honor EmailPatronRegistrations in the API

Description Nick Clemens (kidclamp) 2026-01-29 15:30:25 UTC
Bug 23538 added the ability to have the library receive an email when a patron registers.

Some outside systems, e.g. Aspen, use the patron API to register new patrons.

AutoEmailNewUser is handled in the API and EmailPatronRegistrations should be too.
Comment 1 Nick Clemens (kidclamp) 2026-01-29 15:36:02 UTC
Created attachment 192150 [details] [review]
Bug 41733: Unit tests
Comment 2 Nick Clemens (kidclamp) 2026-01-29 15:36:05 UTC
Created attachment 192151 [details] [review]
Bug 41733: Honor EmailPatronRegistrations in the API

This patch adds new overrides opac_reg_yes and opac_reg_no to the patrons api
and will send a notice to the library when a patron is registered via the API if the pref is
active and the NO override is not sent, or the YES override is sent

To test:
1 - Apply patches
2 - yarn build
3 - restart_all
4 - run unit tests