Invitations to share a list (SHARE_INVITE) are sent via the message_queue, so there can be a noticeable delay. It would be nice if we could use the same trick here as for password reset and self registration verification mails, that are sent through message_queue, but processed/sent immediately.
Created attachment 146520 [details] [review] Bug 32316: Send list share invites and accepts immediately For emails triggered manually it's save and helpful to send them immediately. This patch takes care of SHARE_INVITE and SHARE_ACCEPT. To test: * Enable OpacAllowSharingPrivateLists * Configure SMTP servers * Set KohaAdminEmailAddress and an email address in your user * Create a private list in the OPAC * Share the list with your email * Verify that you receive the email immediately (in the message_queue the status will be sent) * Create a second user to log into the OPAC with * Log out of the OPAC * Click on the link in the invite email or copy/paste it to the browser * Log in as your second user so the list is shared * Verify that the list acceptance email was sent immediately as well
Can't apply the patch: git bz apply 32316 Bug 32316 - Send invitations to share a list immediately 146520 - Bug 32316: Send list share invites and accepts immediately Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 32316: Send list share invites and accepts immediately error: mode change for installer/data/mysql/atomicupdate/bug_30642-add_renewal_type.pl, which is not in current HEAD error: could not build fake ancestor Patch failed at 0001 Bug 32316: Send list share invites and accepts immediately
Thanks David, not sure how that wrong file got in there, but I'll fix.
Created attachment 146942 [details] [review] Bug 32316: Send list share invites and accepts immediately For emails triggered manually it's save and helpful to send them immediately. This patch takes care of SHARE_INVITE and SHARE_ACCEPT. To test: * Enable OpacAllowSharingPrivateLists * Configure SMTP servers * Set KohaAdminEmailAddress and an email address in your user * Create a private list in the OPAC * Share the list with your email * Verify that you receive the email immediately (in the message_queue the status will be sent) * Create a second user to log into the OPAC with * Log out of the OPAC * Click on the link in the invite email or copy/paste it to the browser * Log in as your second user so the list is shared
Hi Katrin. Thanks for updating the patch! I didn't have much luck getting this to work after applying the patch: 1. The messages are generated, but show as pending in the database and aren't sent immediately. 2. They are sent if I process the message queue. 3. I think I set up everything correctly (SMPT configured [1], system preferences set, I also did koha-email-enable kohadev (not sure that was necessary)). David [1] Email setup: To test sending emails using a Google account, edit your /etc/koha/sites/kohadev/koha-conf.xml file and add this configuration near the end (where <user_name> = your Google email address; <password> = your APP password, not your Google account password): <smtp_server> <host>smtp.gmail.com</host> <port>587</port> <timeout>5</timeout> <ssl_mode>STARTTLS</ssl_mode> <user_name>GOOGLEACCOUNTUSER</user_name> <password>GOOGLEAPPPASSWORD</password> <debug>1</debug> </smtp_server>
Hmm, something is still not quite right, it looks like some lines got lost. I'll review, thanks for testing!
Created attachment 146971 [details] [review] Bug 32316: Send list share invites and accepts immediately For emails triggered manually it's save and helpful to send them immediately. This patch takes care of SHARE_INVITE and SHARE_ACCEPT. To test: * Enable OpacAllowSharingPrivateLists * Configure SMTP servers * Set KohaAdminEmailAddress and an email address in your user * Create a private list in the OPAC * Share the list with your email * Verify that you receive the email immediately (in the message_queue the status will be sent) * Create a second user to log into the OPAC with * Log out of the OPAC * Click on the link in the invite email or copy/paste it to the browser * Log in as your second user so the list is shared
The SHARE_INVITE could definitely not work, but the SHARE_ACCEPT should have. The messages in the message should show with 'sent' - not pending. If you try again, could you make sure to restart all the things? I didn't do the enable step when I tested, so I think that is not required in this case. If the mails arrive when processing the message_queue I would also say that your mail setup should be ok.
(In reply to Katrin Fischer from comment #8) > The SHARE_INVITE could definitely not work, but the SHARE_ACCEPT should > have. The messages in the message should show with 'sent' - not pending. > If you try again, could you make sure to restart all the things? > > I didn't do the enable step when I tested, so I think that is not required > in this case. If the mails arrive when processing the message_queue I would > also say that your mail setup should be ok. Thanks Katrin. The SHARE_INVITE message is now sent immediately, so that is working! However, for the SHARE_ACCEPT I am not seeing that in the message queue or receiving it: - The link in the SHARE_INVITE message is http://kohadev.myDNSname.org:8080/cgi-bin/koha/opac-shareshelf.pl?shelfnumber=1&op=accept&key=58102407571739090704 - I haven't configured my desk top so that http://kohadev.myDNSname.org works, I changed that to http://127.0.0.1.... David
Hi David, maybe this helps: The SHARE_ACCEPT will only be sent after you click on the link (accepting the invite) and will be sent to the inviting patron. * Did you make sure the inviting patron had an email set up in their account? * Did you log out of Koha before clicking the link? * Did you log in (accepting) with a different user (not the inviter)? If the accepting user has the email address the invite was sent to is not important.
(In reply to Katrin Fischer from comment #10) > Hi David, > > maybe this helps: > > The SHARE_ACCEPT will only be sent after you click on the link (accepting > the invite) and will be sent to the inviting patron. > > * Did you make sure the inviting patron had an email set up in their account? > * Did you log out of Koha before clicking the link? > * Did you log in (accepting) with a different user (not the inviter)? > > If the accepting user has the email address the invite was sent to is not > important. Hi Katrin. I've retested again, and everything is now working (not sure what I did previously now). Apologies for taking so long to retest. David
Created attachment 148104 [details] [review] Bug 32316: Send list share invites and accepts immediately For emails triggered manually it's save and helpful to send them immediately. This patch takes care of SHARE_INVITE and SHARE_ACCEPT. To test: * Enable OpacAllowSharingPrivateLists * Configure SMTP servers * Set KohaAdminEmailAddress and an email address in your user * Create a private list in the OPAC * Share the list with your email * Verify that you receive the email immediately (in the message_queue the status will be sent) * Create a second user to log into the OPAC with * Log out of the OPAC * Click on the link in the invite email or copy/paste it to the browser * Log in as your second user so the list is shared Signed-off-by: David Nind <david@davidnind.com>
No apologies please! Thanks for testing!
Without an SMTP server running: "An invitation to share list list name will be sent shortly to xxx@example.org." This is not true, it has not been sent. I think we should deal with errors here, like we do in other places.
(In reply to Jonathan Druart from comment #14) > Without an SMTP server running: "An invitation to share list list name will > be sent shortly to xxx@example.org." > > This is not true, it has not been sent. I think we should deal with errors > here, like we do in other places. I believe this is out of scope here. This only changes the when, nothing about how the mail is sent.
Talked to Jonathan, will check out the send list feature for error handling along the lines of "There was an error sending the list."