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.
Please discuss the implement before starting this.
Please discuss the implementation before starting this.
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.
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