diff --git a/Koha/Patron.pm b/Koha/Patron.pm index d1acc9ea09..394d3f070b 100644 --- a/Koha/Patron.pm +++ b/Koha/Patron.pm @@ -3338,7 +3338,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, @@ -3361,7 +3361,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, diff --git a/Koha/REST/V1/Patrons.pm b/Koha/REST/V1/Patrons.pm index 05ae08688e..a6f9fb6657 100644 --- a/Koha/REST/V1/Patrons.pm +++ b/Koha/REST/V1/Patrons.pm @@ -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( { diff --git a/api/v1/swagger/paths/patrons.yaml b/api/v1/swagger/paths/patrons.yaml index 6ec12ddedf..7257bc1798 100644 --- a/api/v1/swagger/paths/patrons.yaml +++ b/api/v1/swagger/paths/patrons.yaml @@ -435,6 +435,8 @@ enum: - welcome_yes - welcome_no + - opac_reg_yes + - opac_reg_no collectionFormat: csv consumes: - application/json diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref index ed9bd02d00..eb974797a8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -912,6 +912,7 @@ OPAC: - '
If you choose EmailAddressForPatronRegistrations you have to enter a valid email address: ' - pref: EmailAddressForPatronRegistrations class: email + - '
NOTE: This uses the OPAC_REG notice.' - - pref: PatronSelfRegistrationAlert choices: