Bug 18532 - AUTO_RENEWALS should be a patron messaging preference
Summary: AUTO_RENEWALS should be a patron messaging preference
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement with 12 votes (vote)
Assignee: Agustín Moyano
QA Contact: Testopia
URL:
Keywords:
: 19736 23922 (view as bug list)
Depends on: 23787 15705
Blocks:
  Show dependency treegraph
 
Reported: 2017-05-03 16:35 UTC by Jonathan Druart
Modified: 2020-05-14 13:23 UTC (History)
22 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 18532: Add new letter AUTO_RENEWALS_DGST, new Auto_Renewals in message_attributes, and configured message_transports (7.50 KB, patch)
2019-11-04 18:59 UTC, Agustín Moyano
Details | Diff | Splinter Review
Bug 18532: set auto_renewals as patron messaging preference (10.41 KB, patch)
2019-11-04 18:59 UTC, Agustín Moyano
Details | Diff | Splinter Review
Bug 18532: Add new letter AUTO_RENEWALS_DGST, new Auto_Renewals in message_attributes, and configured message_transports (9.24 KB, patch)
2019-11-12 16:51 UTC, Agustín Moyano
Details | Diff | Splinter Review
Bug 18532: set auto_renewals as patron messaging preference (10.40 KB, patch)
2019-11-12 16:51 UTC, Agustín Moyano
Details | Diff | Splinter Review
Bug 18532: set auto_renewals as patron messaging preference (10.46 KB, patch)
2019-11-15 16:58 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 18532: set auto_renewals as patron messaging preference (10.52 KB, patch)
2019-12-05 17:46 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 18532: set auto_renewals as patron messaging preference (10.58 KB, patch)
2019-12-05 18:07 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 18532: set auto_renewals as patron messaging preference (10.63 KB, patch)
2019-12-19 14:48 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 18532: Add new letter AUTO_RENEWALS_DGST, new Auto_Renewals in message_attributes, and configured message_transports (9.38 KB, patch)
2019-12-19 17:26 UTC, Agustín Moyano
Details | Diff | Splinter Review
Bug 18532: set auto_renewals as patron messaging preference (10.62 KB, patch)
2019-12-19 17:26 UTC, Agustín Moyano
Details | Diff | Splinter Review
Bug 18532: Add new letter AUTO_RENEWALS_DGST, new Auto_Renewals in message_attributes, and configured message_transports (5.76 KB, patch)
2020-01-29 13:34 UTC, Agustín Moyano
Details | Diff | Splinter Review
Bug 18532: set auto_renewals as patron messaging preference (11.64 KB, patch)
2020-01-29 13:34 UTC, Agustín Moyano
Details | Diff | Splinter Review
Bug 18532: Add new letter AUTO_RENEWALS_DGST, new Auto_Renewals in message_attributes, and configured message_transports (7.12 KB, patch)
2020-02-18 17:40 UTC, Agustín Moyano
Details | Diff | Splinter Review
Bug 18532: set auto_renewals as patron messaging preference (14.84 KB, patch)
2020-02-18 17:40 UTC, Agustín Moyano
Details | Diff | Splinter Review
Bug 18532: Add new letter AUTO_RENEWALS_DGST, new Auto_Renewals in message_attributes, and configured message_transports (6.74 KB, patch)
2020-05-14 13:22 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 18532: set auto_renewals as patron messaging preference (14.90 KB, patch)
2020-05-14 13:23 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 18532: (follow-up) Remove digest switch and add preference (8.55 KB, patch)
2020-05-14 13:23 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 18532: (follow-up) UNTESTED add individual issues to digest notice (3.32 KB, patch)
2020-05-14 13:23 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2017-05-03 16:35:10 UTC
The AUTO_RENEWALS notices sent by the automatic_renewals.pl cronjob should be controlled and configurable at user level, like CHECKIN and CHECKOUT
That way digest will be supported as well.
Comment 1 Jonathan Druart 2017-12-13 17:40:07 UTC
*** Bug 19736 has been marked as a duplicate of this bug. ***
Comment 2 Catherine E. Ingram 2019-03-19 13:44:51 UTC
Please please please make it so patrons can Digest the auto renew emails.  When you get 30 or more emails in one day it is obnoxious.  I get MANY patron complaints about this. 

Is there any development on this?  We could maybe help out with that financially.  

Catherine Ingram
Cedar Park Public Library, TX
Comment 3 David Cook 2019-03-25 03:52:18 UTC
(In reply to Catherine E. Ingram from comment #2)
> Please please please make it so patrons can Digest the auto renew emails. 
> When you get 30 or more emails in one day it is obnoxious.  I get MANY
> patron complaints about this. 
> 
> Is there any development on this?  We could maybe help out with that
> financially.  
> 
> Catherine Ingram
> Cedar Park Public Library, TX

I get clients complaining about their patrons complaining about this as well.

I haven't done any development on this, but it's been more of a question of time than money, as I've been busy with other projects.

But there might be someone else able to do it for money.
Comment 4 Ray Delahunty 2019-05-31 10:42:14 UTC
UAL (along with I think 4 other Koha users) is part funding the turning of AUTO_RENEWALS into a digest email. My understanding of this is that Bywater Solutions hope to have the work completed for inclusion in 19.11 and we are right now in the process of sending the money through. This will be a great development as we have had to use the workaround of using RENEWAL (renewal success notification) & ODUE1 (renewal failure notification) in place of AUTO_RENEWALS.
Comment 5 Martha Fuerst 2019-10-30 13:56:44 UTC
*** Bug 23922 has been marked as a duplicate of this bug. ***
Comment 6 Agustín Moyano 2019-11-04 18:59:30 UTC
Created attachment 95030 [details] [review]
Bug 18532: Add new letter AUTO_RENEWALS_DGST, new Auto_Renewals in message_attributes, and configured message_transports
Comment 7 Agustín Moyano 2019-11-04 18:59:34 UTC
Created attachment 95031 [details] [review]
Bug 18532: set auto_renewals as patron messaging preference

This patch adds the "Auto renewals" messaging preference on intranet and OPAC, and adds digest feature to misc/cronjobs/automatic_renewals.pl script.

To test:
1. apply patches
2. perl installer/data/mysql/updatedatabase.pl
3. make sure renewals are allowed in circ rules
4. grab a patron and go to details page
CHECK => patron's messaging preferences has a "Auto renewals" row
Comment 8 Chris Cormack 2019-11-06 19:27:52 UTC
Comment on attachment 95031 [details] [review]
Bug 18532: set auto_renewals as patron messaging preference

Review of attachment 95031 [details] [review]:
-----------------------------------------------------------------

::: misc/cronjobs/automatic_renewals.pl
@@ +2,4 @@
>  
>  # This file is part of Koha.
>  #
> +# Copyright (C) 2014 Hochschule f�r Gesundheit (hsg), Germany

This looks like a typo, can you fix please?
Comment 9 Katrin Fischer 2019-11-06 19:41:36 UTC
Comment on attachment 95031 [details] [review]
Bug 18532: set auto_renewals as patron messaging preference

Review of attachment 95031 [details] [review]:
-----------------------------------------------------------------

::: misc/cronjobs/automatic_renewals.pl
@@ +2,4 @@
>  
>  # This file is part of Koha.
>  #
> +# Copyright (C) 2014 Hochschule f�r Gesundheit (hsg), Germany

It looks like maybe the encoding of the file was changed? it Should be reading "für".
Comment 10 Agustín Moyano 2019-11-12 16:51:02 UTC
Created attachment 95337 [details] [review]
Bug 18532: Add new letter AUTO_RENEWALS_DGST, new Auto_Renewals in message_attributes, and configured message_transports
Comment 11 Agustín Moyano 2019-11-12 16:51:09 UTC
Created attachment 95338 [details] [review]
Bug 18532: set auto_renewals as patron messaging preference

This patch adds the "Auto renewals" messaging preference on intranet and OPAC, and adds digest feature to misc/cronjobs/automatic_renewals.pl script.

To test:
1. apply patches
2. perl installer/data/mysql/updatedatabase.pl
3. make sure renewals are allowed in circ rules
4. grab a patron and go to details page
CHECK => patron's messaging preferences has a "Auto renewals" row
Comment 12 Agustín Moyano 2019-11-12 16:56:05 UTC
(In reply to Katrin Fischer from comment #9)
> Comment on attachment 95031 [details] [review] [review]
> Bug 18532: set auto_renewals as patron messaging preference
> 
> Review of attachment 95031 [details] [review] [review]:
> -----------------------------------------------------------------
> 
> ::: misc/cronjobs/automatic_renewals.pl
> @@ +2,4 @@
> >  
> >  # This file is part of Koha.
> >  #
> > +# Copyright (C) 2014 Hochschule f�r Gesundheit (hsg), Germany
> 
> It looks like maybe the encoding of the file was changed? it Should be
> reading "für".

I didn't realize, but seems my editor didn't recognize that character encoding. I saved it now as UTF-8
Comment 13 ByWater Sandboxes 2019-11-15 16:58:13 UTC
Created attachment 95456 [details] [review]
Bug 18532: set auto_renewals as patron messaging preference

This patch adds the "Auto renewals" messaging preference on intranet and OPAC, and adds digest feature to misc/cronjobs/automatic_renewals.pl script.

To test:
1. apply patches
2. perl installer/data/mysql/updatedatabase.pl
3. make sure renewals are allowed in circ rules
4. grab a patron and go to details page
CHECK => patron's messaging preferences has a "Auto renewals" row

Signed-off-by: tgoat <tgoatley@gmail.com>
Comment 14 ByWater Sandboxes 2019-12-05 17:46:36 UTC
Created attachment 96049 [details] [review]
Bug 18532: set auto_renewals as patron messaging preference

This patch adds the "Auto renewals" messaging preference on intranet and OPAC, and adds digest feature to misc/cronjobs/automatic_renewals.pl script.

To test:
1. apply patches
2. perl installer/data/mysql/updatedatabase.pl
3. make sure renewals are allowed in circ rules
4. grab a patron and go to details page
CHECK => patron's messaging preferences has a "Auto renewals" row

Signed-off-by: tgoat <tgoatley@gmail.com>

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Comment 15 ByWater Sandboxes 2019-12-05 18:07:43 UTC
Created attachment 96050 [details] [review]
Bug 18532: set auto_renewals as patron messaging preference

This patch adds the "Auto renewals" messaging preference on intranet and OPAC, and adds digest feature to misc/cronjobs/automatic_renewals.pl script.

To test:
1. apply patches
2. perl installer/data/mysql/updatedatabase.pl
3. make sure renewals are allowed in circ rules
4. grab a patron and go to details page
CHECK => patron's messaging preferences has a "Auto renewals" row

Signed-off-by: tgoat <tgoatley@gmail.com>

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Comment 16 David Murguia 2019-12-18 22:31:33 UTC
We have recently started receiving complaints about the individual emails for auto-renewals.  It would be great to see this development happen.
Comment 17 Tomás Cohen Arazi 2019-12-18 23:34:50 UTC
(In reply to David Murguia from comment #16)
> We have recently started receiving complaints about the individual emails
> for auto-renewals.  It would be great to see this development happen.

It would help if you tested it
Comment 18 ByWater Sandboxes 2019-12-19 14:48:40 UTC
Created attachment 96487 [details] [review]
Bug 18532: set auto_renewals as patron messaging preference

This patch adds the "Auto renewals" messaging preference on intranet and OPAC, and adds digest feature to misc/cronjobs/automatic_renewals.pl script.

To test:
1. apply patches
2. perl installer/data/mysql/updatedatabase.pl
3. make sure renewals are allowed in circ rules
4. grab a patron and go to details page
CHECK => patron's messaging preferences has a "Auto renewals" row

Signed-off-by: tgoat <tgoatley@gmail.com>

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>

Signed-off-by: Marti Fuerst <mfuerst@hmcpl.org>
Comment 19 Agustín Moyano 2019-12-19 17:26:28 UTC
Created attachment 96494 [details] [review]
Bug 18532: Add new letter AUTO_RENEWALS_DGST, new Auto_Renewals in message_attributes, and configured message_transports

Signed-off-by: tgoat <tgoatley@gmail.com>

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>

Signed-off-by: Marti Fuerst <mfuerst@hmcpl.org>
Comment 20 Agustín Moyano 2019-12-19 17:26:34 UTC
Created attachment 96495 [details] [review]
Bug 18532: set auto_renewals as patron messaging preference

This patch adds the "Auto renewals" messaging preference on intranet and OPAC, and adds digest feature to misc/cronjobs/automatic_renewals.pl script.

To test:
1. apply patches
2. perl installer/data/mysql/updatedatabase.pl
3. make sure renewals are allowed in circ rules
4. grab a patron and go to details page
CHECK => patron's messaging preferences has a "Auto renewals" row

Signed-off-by: tgoat <tgoatley@gmail.com>

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>

Signed-off-by: Marti Fuerst <mfuerst@hmcpl.org>
Comment 21 Catherine E. Ingram 2019-12-27 20:43:08 UTC
We were playing around with it this morning and wondered about roll out.  The way it looked in the sandbox was that it would default to all existing patrons getting NO notices (with both email and digest un-checked). Did anyone else encounter this?  
~Catherine
Comment 22 Katrin Fischer 2019-12-29 13:39:51 UTC
(In reply to Catherine E. Ingram from comment #21)
> We were playing around with it this morning and wondered about roll out. 
> The way it looked in the sandbox was that it would default to all existing
> patrons getting NO notices (with both email and digest un-checked). Did
> anyone else encounter this?  
> ~Catherine

Setting to FQA to get Augustin to take a look here.
Comment 23 Catherine E. Ingram 2020-01-22 22:50:28 UTC
Did anyone have a chance to look at this?  Did you have questions for me?

---------------------------------
Catherine E. Ingram, MLS
Assistant Library Director
Cedar Park Public Library
Office: 512-401-5640
Catherine.Ingram@cedarparktexas.gov
550 Discovery Boulevard
Cedar Park, TX  78613
www.cedarparktexas.gov/library
Comment 24 Agustín Moyano 2020-01-27 19:03:52 UTC
Sorry, I was almost abducted by another (evil) bug.

I'll remove those lines from atomicupdate ASAP, so this can move forward.
Comment 25 Agustín Moyano 2020-01-29 13:34:48 UTC
Created attachment 98078 [details] [review]
Bug 18532: Add new letter AUTO_RENEWALS_DGST, new Auto_Renewals in message_attributes, and configured message_transports

Signed-off-by: tgoat <tgoatley@gmail.com>

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>

Signed-off-by: Marti Fuerst <mfuerst@hmcpl.org>
Comment 26 Agustín Moyano 2020-01-29 13:34:53 UTC
Created attachment 98079 [details] [review]
Bug 18532: set auto_renewals as patron messaging preference

This patch adds the "Auto renewals" messaging preference on intranet and OPAC, and adds digest feature to misc/cronjobs/automatic_renewals.pl script.

To test:
1. apply patches
2. perl installer/data/mysql/updatedatabase.pl
3. make sure automatic renewals are allowed in circ rules
4. grab a patron and go to details page
CHECK => patron's messaging preferences has a "Auto renewals" row
5. change autorenewals digest settings and save
6. go to opac with that same patron to "your messaging" option
CHECK => patron's messaging preferences has a "Auto renewals" row, and displays changes made in staff interface.
7. go to patron categories in administration of staff interface and choose a category.
CHECK => in "Default messaging preferences for this patron category" has a "Auto renewals" row
8. set "Auto renewals" messaging preference for a patron and check email and digest.
9. check out an item for that patron, and set it as automatic renewal and set due date as your current date and time
10. perl misc/cronjobs/automatic_renewals.pl --send-notices -v
SUCCESS => item was renewed, and in message_queue table there now should be message of type AUTO_RENEWALS_DGST for the patron
11. Sign off

Signed-off-by: tgoat <tgoatley@gmail.com>

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>

Signed-off-by: Marti Fuerst <mfuerst@hmcpl.org>
Comment 27 Agustín Moyano 2020-01-29 18:09:58 UTC
(In reply to Catherine E. Ingram from comment #21)
> We were playing around with it this morning and wondered about roll out. 
> The way it looked in the sandbox was that it would default to all existing
> patrons getting NO notices (with both email and digest un-checked). Did
> anyone else encounter this?  
> ~Catherine

Hi Catherine, you were right.. I believed that if I didn't add that preference on patrons that already had preferences setted, Koha would break, but it didn't happen at the end.

Thanks for spotting that out.

Can you please try it out again?

Thanks.
Comment 28 Catherine E. Ingram 2020-02-06 22:46:05 UTC
(In reply to Agustín Moyano from comment #27)
> (In reply to Catherine E. Ingram from comment #21)
> > We were playing around with it this morning and wondered about roll out. 
> > The way it looked in the sandbox was that it would default to all existing
> > patrons getting NO notices (with both email and digest un-checked). Did
> > anyone else encounter this?  
> > ~Catherine
> 
> Hi Catherine, you were right.. I believed that if I didn't add that
> preference on patrons that already had preferences setted, Koha would break,
> but it didn't happen at the end.
> 
> Thanks for spotting that out.
> 
> Can you please try it out again?
> 
> Thanks.

Hi Agustín,

We have tested the latest patch you have submitted.

After applying the patch, we notice that all patrons will have Auto Renewals UNCHECKED for both Email and Digest.  This means NO Auto Renewal communication after we apply the patch.

This is a problem, because patrons will suddenly stop receiving all Auto Renewal communication unless they re-configure their preferences individually.

Can we request that the patch updates ALL patrons to have both Email and Digest CHECKED for the Auto Renewal function?

Thank you!
Catherine
Comment 29 Agustín Moyano 2020-02-08 14:01:39 UTC
(In reply to Catherine E. Ingram from comment #28)
> (In reply to Agustín Moyano from comment #27)
> > (In reply to Catherine E. Ingram from comment #21)
> > > We were playing around with it this morning and wondered about roll out. 
> > > The way it looked in the sandbox was that it would default to all existing
> > > patrons getting NO notices (with both email and digest un-checked). Did
> > > anyone else encounter this?  
> > > ~Catherine
> > 
> > Hi Catherine, you were right.. I believed that if I didn't add that
> > preference on patrons that already had preferences setted, Koha would break,
> > but it didn't happen at the end.
> > 
> > Thanks for spotting that out.
> > 
> > Can you please try it out again?
> > 
> > Thanks.
> 
> Hi Agustín,
> 
> We have tested the latest patch you have submitted.
> 
> After applying the patch, we notice that all patrons will have Auto Renewals
> UNCHECKED for both Email and Digest.  This means NO Auto Renewal
> communication after we apply the patch.
> 
> This is a problem, because patrons will suddenly stop receiving all Auto
> Renewal communication unless they re-configure their preferences
> individually.
> 
> Can we request that the patch updates ALL patrons to have both Email and
> Digest CHECKED for the Auto Renewal function?
> 
> Thank you!
> Catherine

Hi Catherine, I'm afraid that setting email and digest checked for all patrons would break the rule of keeping behavior as it is when upgrading..

Current behavior would match by making email checked and digest unchecked, but if I set that in every patron's preference that would mean that to get digest messages every patron should set that up individually.

So, what I propose is not to set any preference in patron, but set email checked and digest unchecked for every patron category. 

That way, I believe behavior whould be the same after update, and if a library wants digest messages for there patrons, they only have to set that once in patrons categories.

What do you think?

Regards
Agustín.
Comment 30 Catherine E. Ingram 2020-02-11 21:15:23 UTC
OK... But having NEITHER checked also breaks the rule of keeping behavior as it is when upgrading. That has been my whole point. 

To your point the email box SHOULD be default checked. (so they keep getting the auto renew emails)
The digest box should NOT be checked.

If both are not checked they will go from getting way too much email to getting NO emails about automatic renewals.

Catherine
Comment 31 Barbara Johnson 2020-02-13 00:11:55 UTC
I agree with Catherine that it would be preferable to have the patch update ALL patrons to have both Email and Digest CHECKED for the Auto Renewal function.  If our patrons stop receiving any renewal notices it will cause a big customer service issue for us. 

During our preparation for Go Live, we had some default messaging preferences put in place.  New patrons, whether created via self-registration or by staff, all get specific messaging options checked which they can later change if they want.  Perhaps adding Email and Digest Auto Renewal default messaging preferences would make sure that existing patrons don't lose anything.

Does this sound like it would work?
Barbara
Comment 32 Agustín Moyano 2020-02-18 17:40:17 UTC
Created attachment 99193 [details] [review]
Bug 18532: Add new letter AUTO_RENEWALS_DGST, new Auto_Renewals in message_attributes, and configured message_transports

Signed-off-by: tgoat <tgoatley@gmail.com>

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>

Signed-off-by: Marti Fuerst <mfuerst@hmcpl.org>
Comment 33 Agustín Moyano 2020-02-18 17:40:23 UTC
Created attachment 99194 [details] [review]
Bug 18532: set auto_renewals as patron messaging preference

This patch adds the "Auto renewals" messaging preference on intranet and OPAC, and adds digest feature to misc/cronjobs/automatic_renewals.pl script.

To test:
1. apply patches
2. perl installer/data/mysql/updatedatabase.pl
3. make sure automatic renewals are allowed in circ rules, have a positive number of allowed renewals and a positive number for renewal period
4. go to patron categories in administration of staff interface and choose a category.
CHECK => in "Default messaging preferences for this patron category" has a "Auto renewals" row and has email and digest options checked
5. grab a patron and go to details page
CHECK => patron's messaging preferences has a "Auto renewals" row with email and digest options checked
6. some settings and save
7. go to opac with that same patron to "your messaging" option
CHECK => patron's messaging preferences has a "Auto renewals" row, and displays changes made in staff interface.
8. uncheck email and digest from "Auto renewals" row and save
9. check out an item for that patron, and set it as automatic renewal and set due date as your current yesterday
10. perl misc/cronjobs/automatic_renewals.pl -c --send-notices -v
SUCCESS => item was renewed, and in message_queue table there is no new message for the patron
11. update patrons messaging preferences and set email option of "Auto renewals" row as checked
12. repeat steps 9 and 10
SUCCESS => item was renewed, but in message_queue table there is a new message of type AUTO_RENEWALS
13. update patrons messaging preferences and set email and digest options of "Auto renewals" row as checked
14. repeat steps 9 and 10
CHECK => item was not renewed
15. run step 10 again, but add -d flag, like this:
    perl misc/cronjobs/automatic_renewals.pl -c --send-notices -v -d
SUCCESS => item was renewed, and in message_queue table there is a new message of type AUTO_RENEWALS_DGST
16. Sign off

Signed-off-by: tgoat <tgoatley@gmail.com>

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>

Signed-off-by: Marti Fuerst <mfuerst@hmcpl.org>
Comment 34 Agustín Moyano 2020-02-18 17:45:29 UTC
(In reply to Barbara Johnson from comment #31)
> I agree with Catherine that it would be preferable to have the patch update
> ALL patrons to have both Email and Digest CHECKED for the Auto Renewal
> function.  If our patrons stop receiving any renewal notices it will cause a
> big customer service issue for us. 
> 
> During our preparation for Go Live, we had some default messaging
> preferences put in place.  New patrons, whether created via
> self-registration or by staff, all get specific messaging options checked
> which they can later change if they want.  Perhaps adding Email and Digest
> Auto Renewal default messaging preferences would make sure that existing
> patrons don't lose anything.
> 
> Does this sound like it would work?
> Barbara

Hi Barbara and Catherine,

Both of you were right.. Category messaging preferences didn't work as I expected.. I thought that it would be a default value when a patron didn't set his/hers own preference, but it was more like a template when you create a new patron.

So, in the update script I set email and digest options to checked.

Could you please test this again?

Thanks.
Comment 35 Barbara Johnson 2020-02-18 17:55:04 UTC
Hi Agustín,

Thanks for the new test plan.  I'm new at testing bugs.  I'm not sure what I'm supposed to do for step 10 (perl misc/cronjobs/automatic_renewals.pl -c --send-notices -v) or 15 (add -d flag)

Thanks.
Comment 36 Agustín Moyano 2020-02-18 22:45:04 UTC
(In reply to Barbara Johnson from comment #35)
> Hi Agustín,
> 
> Thanks for the new test plan.  I'm new at testing bugs.  I'm not sure what
> I'm supposed to do for step 10 (perl misc/cronjobs/automatic_renewals.pl -c
> --send-notices -v) or 15 (add -d flag)
> 
> Thanks.

Hi Barbara, that step executes what a cronjob would do.

You should copy that line and paste it in a console, un the root of Koha project.

To get a console:
* if you are using koha-testing-docker in your linux console you should:
  1. docker exec -ti koha_koha_1 bash
  2. cd koha
  3. perl misc/cronjobs/automatic_renewals.pl -c --send-notices -v

* If you use vagrant, in your linux console, in the root of your vagrant project execute:
  1. vagrant ssh
  2. perl misc/cronjobs/automatic_renewals.pl -c --send-notices -v

* If you've got a testing server you should:
  1. ssh youruser@kohatestingserver
  2. cd /koha/project/path
  3. perl misc/cronjobs/automatic_renewals.pl -c --send-notices -v

I'm assuming in all cases that you are using any distribution of Linux to develop.

If you're using windows I don't know.

Hope it helps!
Comment 37 Agustín Moyano 2020-02-18 22:47:51 UTC
(In reply to Agustín Moyano from comment #36)
> (In reply to Barbara Johnson from comment #35)
> > Hi Agustín,
> > 
> > Thanks for the new test plan.  I'm new at testing bugs.  I'm not sure what
> > I'm supposed to do for step 10 (perl misc/cronjobs/automatic_renewals.pl -c
> > --send-notices -v) or 15 (add -d flag)
> > 
> > Thanks.
> 
> Hi Barbara, that step executes what a cronjob would do.
> 
> You should copy that line and paste it in a console, un the root of Koha
> project.
> 
> To get a console:
> * if you are using koha-testing-docker in your linux console you should:
>   1. docker exec -ti koha_koha_1 bash
>   2. cd koha
>   3. perl misc/cronjobs/automatic_renewals.pl -c --send-notices -v
> 
> * If you use vagrant, in your linux console, in the root of your vagrant
> project execute:
>   1. vagrant ssh
>   2. perl misc/cronjobs/automatic_renewals.pl -c --send-notices -v
> 
> * If you've got a testing server you should:
>   1. ssh youruser@kohatestingserver
>   2. cd /koha/project/path
>   3. perl misc/cronjobs/automatic_renewals.pl -c --send-notices -v
> 
> I'm assuming in all cases that you are using any distribution of Linux to
> develop.
> 
> If you're using windows I don't know.
> 
> Hope it helps!

Sorry, just crossed my mind.. if you're not a developer, then you should ask the help of a technician
Comment 38 Nick Clemens 2020-03-26 13:11:36 UTC
This causes a behaviour change
 1 - This sets all patrons to want auto_renewal notices in digest form
 2 - The script requires '--digest' if the borrower wants digest or nothing is sent
We should default to all patrons want auto_renewals but not digest
This could be combined too with bug 23787 where we add the 'AUTO_RENEWAL' notice - if combined we could update borrowers to receive the notice if it already exists, and insert it but do not set borrowers to receive the notice if it does not exist

When running with the default notice the content is wrong, I think you want:
Dear [% borrower.firstname %] [% borrower.surname %],

        [% IF error %]
        There were [% error %] items that were not correctly renewed.
        [% END %]
        [% IF success %]
        There were [% success %] items that were correctly renewed.
        [% END %]


Additionally - the current code does not seem to allow for the inclusion of item specific information in the notices, I would say this is a blocker.

Copyright line in auto-renewals is malformed in these patches
Comment 39 Nick Clemens 2020-03-28 22:37:11 UTC
We talked this one over this morning, we think the idea of setting  preferences by default is problematic, we would propose a workaround:
1 - Add a new system preference "SendAutoRenewalNotices"
2 - This syspref would replace the 'send-notices' switch on the cron, and would be marked with deprecation
3 - It would allow libraries to review their messaging settings for auto-renewal
4 - It should default to 'off' with a warning in the DB upgrade and release notes and in the cron if set but the cron could enable the syspref if the option is passed - to highlight the chnage
5 - the --digest option in the cron should be removed as the control should rely on patron settings
Comment 40 Nick Clemens 2020-05-14 13:22:59 UTC
Created attachment 104880 [details] [review]
Bug 18532: Add new letter AUTO_RENEWALS_DGST, new Auto_Renewals in message_attributes, and configured message_transports

Signed-off-by: tgoat <tgoatley@gmail.com>

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>

Signed-off-by: Marti Fuerst <mfuerst@hmcpl.org>
Comment 41 Nick Clemens 2020-05-14 13:23:04 UTC
Created attachment 104881 [details] [review]
Bug 18532: set auto_renewals as patron messaging preference

This patch adds the "Auto renewals" messaging preference on intranet and OPAC, and adds digest feature to misc/cronjobs/automatic_renewals.pl script.

To test:
1. apply patches
2. perl installer/data/mysql/updatedatabase.pl
3. make sure automatic renewals are allowed in circ rules, have a positive number of allowed renewals and a positive number for renewal period
4. go to patron categories in administration of staff interface and choose a category.
CHECK => in "Default messaging preferences for this patron category" has a "Auto renewals" row and has email and digest options checked
5. grab a patron and go to details page
CHECK => patron's messaging preferences has a "Auto renewals" row with email and digest options checked
6. some settings and save
7. go to opac with that same patron to "your messaging" option
CHECK => patron's messaging preferences has a "Auto renewals" row, and displays changes made in staff interface.
8. uncheck email and digest from "Auto renewals" row and save
9. check out an item for that patron, and set it as automatic renewal and set due date as your current yesterday
10. perl misc/cronjobs/automatic_renewals.pl -c --send-notices -v
SUCCESS => item was renewed, and in message_queue table there is no new message for the patron
11. update patrons messaging preferences and set email option of "Auto renewals" row as checked
12. repeat steps 9 and 10
SUCCESS => item was renewed, but in message_queue table there is a new message of type AUTO_RENEWALS
13. update patrons messaging preferences and set email and digest options of "Auto renewals" row as checked
14. repeat steps 9 and 10
CHECK => item was not renewed
15. run step 10 again, but add -d flag, like this:
    perl misc/cronjobs/automatic_renewals.pl -c --send-notices -v -d
SUCCESS => item was renewed, and in message_queue table there is a new message of type AUTO_RENEWALS_DGST
16. Sign off

Signed-off-by: tgoat <tgoatley@gmail.com>

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>

Signed-off-by: Marti Fuerst <mfuerst@hmcpl.org>
Comment 42 Nick Clemens 2020-05-14 13:23:08 UTC
Created attachment 104882 [details] [review]
Bug 18532: (follow-up) Remove digest switch and add preference
Comment 43 Nick Clemens 2020-05-14 13:23:13 UTC
Created attachment 104883 [details] [review]
Bug 18532: (follow-up) UNTESTED add individual issues to digest notice

This is how I think this works, I did not test this code