Bug 30214

Summary: Send WELCOME notice for new patrons added via self registration
Product: Koha Reporter: Martin Renvoize <martin.renvoize>
Component: PatronsAssignee: Martin Renvoize <martin.renvoize>
Status: Pushed to stable --- QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: andrewfh, barbara.johnson, bwsdonna, dcook, fiona.borthwick, gmcharlt, katrin.fischer, kris.sinnaeve, kyle.m.hall, kyle, lucy.vaux-harvey, mirjam.vantieghem, oleonard, testopia
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
This enhancement extends the 'AutoEmailOpacUser' feature to also send WELCOME notices to users who register via the opac self registration system.
Version(s) released in:
22.05.00,21.11.05
Bug Depends on: 17648    
Bug Blocks: 30237    
Attachments: Bug 30214: Add ACCTDETAILS notice to self registeration
Bug 30214: Add ACCTDETAILS notice to verified self registration
Bug 30214: Add ACCTDETAILS notice to self registeration
Bug 30214: Add ACCTDETAILS notice to verified self registration
Bug 30214: Add ACCTDETAILS notice to verified self registration
Bug 30214: (QA follow-up) Clarify code comment

Description Martin Renvoize 2022-03-02 15:06:27 UTC
It would be helpful to add automatic email to users on patron self-registration.
Comment 1 Andrew Fuerste-Henry 2022-03-02 15:36:22 UTC
+1
Comment 2 Martin Renvoize 2022-03-02 16:08:25 UTC Comment hidden (obsolete)
Comment 3 Martin Renvoize 2022-03-02 16:09:59 UTC
Still working here, I'll add NSO status once I've added the next patches (to work with the verification workflow)

The current patch also immediately sends the notice after adding it to the message queue.. I'm not sure if this is correct or whether we should wait for the normal process to send mail to run.
Comment 4 Martin Renvoize 2022-03-02 16:19:36 UTC Comment hidden (obsolete)
Comment 5 Barbara Johnson 2022-03-02 18:32:01 UTC
I completed steps 1-4. I set up two different accounts using two different email addresses but I never received the email confirmation listed in step 5. 

To see if email was working at all I enabled OpacPasswordChange and OpacResetPassword.  I edited an account by adding  my email address to it.  I then logged into the account on the OPAC and tried to reset my password but I didn't receive an email for that either.  Maybe email doesn't work in a sandbox?
Comment 6 Martin Renvoize 2022-03-03 10:46:07 UTC
I really must get better at writing test plans with the sandboxes in mind, my apologies Barbara.

External email is indeed disabled on the sandboxes to prevent them being hijacked by people wanting to use them to mass spam email.

But, you can still test email functionality.  Email sending isn't immediate, so it may take a few minutes to appear. To check the results, you'll need to look at the 'Koha Mail Log' under the 'Logs' select list in the sandbox management page. This will list all mail sent by the server, as it is sent (so it looks a bit funky with all the headers).

Hope that helps, 

Martin
Comment 7 Owen Leonard 2022-03-03 16:27:08 UTC
Created attachment 131337 [details] [review]
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.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 8 Owen Leonard 2022-03-03 16:27:12 UTC
Created attachment 131338 [details] [review]
Bug 30214: Add ACCTDETAILS notice to verified self registration

This patch adds the ACCTDETAILS notice trigger to the opac self
registration process. Allowing new users, with varification enabled,
to receive the ACCTDETAILS notice immediately after their account is
varified.

Test plan
1) Enable AutoEmailOpacUser system preference
2) Ensure the ACCTDETAILS notice is configured
3) Ensure `PatronSelfRegistrationVerifyByEmail` is enabled
4) Register a new user via the opac self registration process using an
   email address you have access to
5) Verify the user by following the link in the verification email you
   should have received.
6) The new user should have been created and you should be able to see
   the account details notice in their associated notices
7) Confirm that the email address used above has received the notice.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 9 Katrin Fischer 2022-03-06 12:28:11 UTC
Created attachment 131407 [details] [review]
Bug 30214: Add ACCTDETAILS notice to verified self registration

This patch adds the ACCTDETAILS notice trigger to the opac self
registration process. Allowing new users, with varification enabled,
to receive the ACCTDETAILS notice immediately after their account is
varified.

Test plan
1) Enable AutoEmailOpacUser system preference
2) Ensure the ACCTDETAILS notice is configured
3) Ensure `PatronSelfRegistrationVerifyByEmail` is enabled
4) Register a new user via the opac self registration process using an
   email address you have access to
5) Verify the user by following the link in the verification email you
   should have received.
6) The new user should have been created and you should be able to see
   the account details notice in their associated notices
7) Confirm that the email address used above has received the notice.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 10 Katrin Fischer 2022-03-06 12:28:17 UTC
Created attachment 131408 [details] [review]
Bug 30214: (QA follow-up) Clarify code comment

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 11 Fridolin Somers 2022-03-17 21:24:01 UTC
Pushed to master for 22.05, thanks to everybody involved 🦄
Comment 12 Kyle M Hall 2022-03-25 13:35:17 UTC
Pushed to 21.11.x for 21.11.05