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
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 99eb693cd9)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
This commit is contained in:
parent
42ec05bee3
commit
1a98247b8a
|
|
@ -3316,7 +3316,7 @@ sub notify_library_of_registration {
|
|||
my ( $self, $email_patron_registrations ) = @_;
|
||||
|
||||
if (
|
||||
my $letter = C4::Letters::GetPreparedLetter(
|
||||
my $letter = GetPreparedLetter(
|
||||
module => 'members',
|
||||
letter_code => 'OPAC_REG',
|
||||
branchcode => $self->branchcode,
|
||||
|
|
@ -3339,7 +3339,7 @@ sub notify_library_of_registration {
|
|||
|| C4::Context->preference('KohaAdminEmailAddress');
|
||||
}
|
||||
|
||||
my $message_id = C4::Letters::EnqueueLetter(
|
||||
my $message_id = EnqueueLetter(
|
||||
{
|
||||
letter => $letter,
|
||||
borrowernumber => $self->borrowernumber,
|
||||
|
|
|
|||
|
|
@ -160,6 +160,13 @@ sub add {
|
|||
}
|
||||
}
|
||||
|
||||
my $notify_library = C4::Context->preference('EmailPatronRegistrations');
|
||||
if ( $overrides->{opac_reg_yes}
|
||||
|| ( $notify_library && !$overrides->{opac_reg_no} ) )
|
||||
{
|
||||
$patron->notify_library_of_registration($notify_library);
|
||||
}
|
||||
|
||||
if ( C4::Context->preference('EnhancedMessagingPreferences') ) {
|
||||
C4::Members::Messaging::SetMessagingPreferencesFromDefaults(
|
||||
{
|
||||
|
|
|
|||
|
|
@ -435,6 +435,8 @@
|
|||
enum:
|
||||
- welcome_yes
|
||||
- welcome_no
|
||||
- opac_reg_yes
|
||||
- opac_reg_no
|
||||
collectionFormat: csv
|
||||
consumes:
|
||||
- application/json
|
||||
|
|
|
|||
|
|
@ -911,6 +911,7 @@ OPAC:
|
|||
- '<br>If you choose <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=EmailAddressForPatronRegistrations">EmailAddressForPatronRegistrations</a> you have to enter a valid email address: '
|
||||
- pref: EmailAddressForPatronRegistrations
|
||||
class: email
|
||||
- '<br><strong>NOTE:</strong> This uses the OPAC_REG notice.'
|
||||
-
|
||||
- pref: PatronSelfRegistrationAlert
|
||||
choices:
|
||||
|
|
|
|||
Loading…
Reference in New Issue