Skip to content
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

Draft
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

maccabeelevine
Copy link
Member

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.

*
* @return void
*/
protected function emailRequestPlaced($holdDetails)
Copy link
Member Author

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;
Copy link
Member Author

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.

Copy link
Member

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)
Copy link
Member Author

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.

Copy link
Member

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@example.com"
other_property_name[value2] = "email2@example.com"
default = "sharedbox@example.com"

(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'] ?? ''?> */ ?>
Copy link
Member Author

@maccabeelevine maccabeelevine Sep 20, 2024

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.

@demiankatz
Copy link
Member

@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).

@maccabeelevine
Copy link
Member Author

@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.

@demiankatz
Copy link
Member

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!

@maccabeelevine
Copy link
Member Author

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.

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 dev branch is for 11.

@maccabeelevine maccabeelevine added this to the 11.0 milestone Oct 8, 2024
@demiankatz
Copy link
Member

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 dev branch is for 11.

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. :-)

@demiankatz demiankatz changed the base branch from dev to dev-11.0 October 8, 2024 17:28
@demiankatz
Copy link
Member

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. ;-)

@demiankatz demiankatz added new feature new language strings adds new text in need of translation labels Oct 8, 2024
@demiankatz demiankatz changed the base branch from dev-11.0 to dev November 1, 2024 17:57
Copy link
Member

@demiankatz demiankatz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maccabeelevine, just noticed that some minor conflicts have cropped up here, while I was reviewing outstanding work to prepare for tomorrow's Community Call. No rush from my end, but if you're still planning to finish this draft, you might want to sort that out when time permits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature new language strings adds new text in need of translation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants