Bugzilla – Attachment 131283 Details for
Bug 30214
Send WELCOME notice for new patrons added via self registration
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30214: Add ACCTDETAILS notice to self registeration
Bug-30214-Add-ACCTDETAILS-notice-to-self-registera.patch (text/plain), 3.59 KB, created by
Martin Renvoize (ashimema)
on 2022-03-02 16:08:25 UTC
(
hide
)
Description:
Bug 30214: Add ACCTDETAILS notice to self registeration
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-03-02 16:08:25 UTC
Size:
3.59 KB
patch
obsolete
>From 6b9b244baa94de70bfd080b3dbf9c334830a5293 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 2 Mar 2022 16:03:55 +0000 >Subject: [PATCH] Bug 30214: Add ACCTDETAILS notice to self registeration > >This patch adds the ACCTDETAILS notice trigger to the opac self >registration process. Allowing new users, without varification enabled, >to receive the ACCTDETAILS notice immediately after their account is >created. > >Test plan >1) Enable AutoEmailOpacUser system preference >2) Ensure the ACCTDETAILS notice is configured >3) Ensure `PatronSelfRegistrationVerifyByEmail` is disabled >4) Register a new user via the opac self registration process using an > email address you have access to >5) The new user should have been created and you should be able to see > the account details notice in their associated notices >6) Confirm that the email address used above has received the notice. >--- > opac/opac-memberentry.pl | 33 +++++++++++++++++++++++++++++++++ > 1 file changed, 33 insertions(+) > >diff --git a/opac/opac-memberentry.pl b/opac/opac-memberentry.pl >index db3795dbf4..f31e89ca3e 100755 >--- a/opac/opac-memberentry.pl >+++ b/opac/opac-memberentry.pl >@@ -26,6 +26,7 @@ use String::Random qw( random_string ); > use C4::Auth qw( get_template_and_user ); > use C4::Output qw( output_html_with_http_headers ); > use C4::Context; >+use C4::Letters qw( GetPreparedLetter EnqueueLetter SendQueuedMessages ); > use C4::Members qw( checkcardnumber ); > use C4::Form::MessagingPreferences; > use Koha::AuthUtils; >@@ -241,6 +242,38 @@ if ( $action eq 'create' ) { > > $template->param( password_cleartext => $patron->plain_text_password ); > $template->param( borrower => $patron->unblessed ); >+ >+ # If 'AutoEmailOpacUser' syspref is on, email user their account details from the 'notice' that matches the user's branchcode. >+ if ( C4::Context->preference("AutoEmailOpacUser") ) { >+ #look for defined primary email address, if blank - attempt to use borr.email and borr.emailpro instead >+ my $emailaddr = $patron->notice_email_address; >+ # if we manage to find a valid email address, send notice >+ if ($emailaddr) { >+ eval { >+ my $letter = GetPreparedLetter( >+ module => 'members', >+ letter_code => 'ACCTDETAILS', >+ branchcode => $patron->branchcode,, >+ lang => $patron->lang || 'default', >+ tables => { >+ 'branches' => $patron->branchcode, >+ 'borrowers' => $patron->borrowernumber, >+ }, >+ want_librarian => 1, >+ ) or return; >+ >+ my $message_id = EnqueueLetter( >+ { >+ letter => $letter, >+ borrowernumber => $patron->id, >+ to_address => $emailaddr, >+ message_transport_type => 'email' >+ } >+ ); >+ SendQueuedMessages({ message_id => $message_id }); >+ }; >+ } >+ } > } else { > # FIXME Handle possible errors here > } >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 30214
:
131283
|
131284
|
131337
|
131338
|
131407
|
131408