-
Notifications
You must be signed in to change notification settings - Fork 355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Email the service desk after a hold is placed #3955
base: dev
Are you sure you want to change the base?
Conversation
* | ||
* @return void | ||
*/ | ||
protected function emailRequestPlaced($holdDetails) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VuFind calls these user actions both holds (too specific) and requests (maybe too general). I use requests where possible but holds where the term is already used i.e. in that config section.
$message | ||
); | ||
} catch (\VuFind\Exception\Mail $e) { | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't want to throw an exception, after all the hold succeeded. Might be helpful to log the error but I wasn't sure if it was worth using LoggerAwareTrait for the one message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could also use error_log
as a last resort.
* | ||
* @return string The email address | ||
*/ | ||
protected function getEmailRecipient($holdDetails) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic I'll be implementing locally is to look at the pickup location and do a mapping from that to a particular email address. Not sure if that is generic enough to share.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could that be generalized to something like a prioritized list of $holdDetails properties mapped to email addresses? This is pretty ugly, but something like:
[EmailNotificationMap]
property_name[value] = "[email protected]"
other_property_name[value2] = "[email protected]"
default = "[email protected]"
(Obviously this would lend itself better to YAML or JSON configuration, but if we have to use .ini, it might work).
|
||
<?=$this->translate('Comments')?>: <?=$hold_details['comment'] ?? ''?> | ||
|
||
<?php /* Request Group: <?=$this->translate('request_group')?>: <?=$hold_details['requestGroupId'] ?? ''?> */ ?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll finish using requestGroup
after #3930.
@maccabeelevine, I haven't had a chance to look at this in depth yet, but I wonder if it's worth re-targeting it against the dev-11.0 branch; we've just switched from laminas-mail to symfony-mailer there, and so it may be good to test/develop this new feature against the library we'll be using going forward. (I assume this is unlikely to come out of draft mode in time for release 10.1 in any case). |
I think I'd like to see what happens with timing? The only thing holding this in draft is a change I'd like to make once #3930 is merged, and so I don't know how long either will take to review. Obviously I know we're close to the end so it's fine to push this if needed, but I'd rather wait to see. |
Sure, not a problem! |
I didn't realize when I responded above that we were past the 10.1 translation freeze. There is no point to doing this PR without the translations, so it should indeed wait for 11. That said, I hate re-basing branches so I'd rather just hold this until the |
Sure, no problem -- though rebasing to a future branch is a lot easier than rebasing to a past branch, so if this does get done before the dev-11.0 gets merged into dev, I'll happily volunteer to help with any necessary adjustments. :-) |
Actually, it was just a matter of clicking the "change base" button on this PR to re-target this against dev-11.0 without conflicts, so I went ahead and did that... helps prevent it from accidentally getting merged to the wrong place if I get sloppy. ;-) |
Not all ILS's notify the circ staff after a request is placed (psst FOLIO). Staff have to monitor the requests queue. This allows VuFind to do the email instead.