Bug 22843

Summary: Finer control of who receives purchase suggestion notifications
Product: Koha Reporter: Martin Renvoize (ashimema) <martin.renvoize>
Component: AcquisitionsAssignee: Martin Renvoize (ashimema) <martin.renvoize>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: jonathan.druart
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22821
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22818
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 5770, 22823    
Bug Blocks:    

Description Martin Renvoize (ashimema) 2019-05-03 15:45:50 UTC
Bug 5770 adds the ability to send emails to various addresses when a patron makes a purchase suggestion.

It uses the existing email address fields at either the branch or whole library level (or the option to add a single alternate address).

It might be nice to be able to define a 'Acquisitions librarian' per branch rather than re-using the branchemail address.
Comment 1 Jonathan Druart 2019-05-13 14:02:02 UTC Comment hidden (obsolete)
Comment 2 Jonathan Druart 2019-05-13 14:02:14 UTC
Please discuss the implementation before starting this.
Comment 3 Martin Renvoize (ashimema) 2019-05-14 15:52:24 UTC
My plan was to either add a distinct email_for_acquisitions field to the existing branches table, or perhaps add a 'branch_librarians' table setup a foreign key relationship such that it's extensible for other branch specific addresses.

I was then going to add accessors to Koha::Library which would look for the corresponding field and if empty continuously fallback through branchreplyto, branchemail, defaultreplyto and finally kohaadminemail system preferences until it found a populated one.

I was also temped to allow the field to take either a plaintext email address or a borrowernumber which we could use to lookup a librarian.. but I've not decided whether I like that concept or now yet.. up for debate.

Once I had that it's a model for how other such branch specific addresses could be defined.

Finally, I'd plumb it into the suggestions notification system such that the 'to' address was populated using this new accessor.
Comment 4 Jonathan Druart 2019-05-15 13:33:14 UTC
I would go with a list of patrons we could link to a library.
Like what we have for funds (join table aqbudgetborrowers):
https://snag.gy/sbSNCl.jpg

And then use $patron->notice_email_address