Some libraries have a large amount of accounts and want to be able to limit how many email reminders they send - adding a where statement will allow for flexibility
Created attachment 121397 [details] [review] Bug 28456: Add WHERE option to membership_expiry cronjob Some libraries have a large amount of accounts and want to be able to limit how many email reminders they send. Adding a where statement will allow for flexibility To test: 1 - Set some borrowers to expire soon 2 - Set MembershipExpiryDaysNotice to 10 3 - perl misc/cronjobs/membership_expiry.pl -c -v -n --before 100 --after 100 4 - Note the patrons that yo uadjusted show up 5 - Limit by various patron fields, e.g. perl misc/cronjobs/membership_expiry.pl -c -v -n --before 100 --after 100 --where="lastseen IS NULL" perl misc/cronjobs/membership_expiry.pl -c -v -n --before 100 --after 100 --where="lastseen IS NOT NULL" perl misc/cronjobs/membership_expiry.pl -c -v -n --before 100 --after 100 --where="surname LIKE '%a%'" perl misc/cronjobs/membership_expiry.pl -c -v -n --before 100 --after 100 --where="surname NOT LIKE '%a%'" 6 - Confirm expected results 7 - perl misc/cronjobs/membership_expiry.pl 8 - Confirm the help message makes sense
Created attachment 121922 [details] [review] Bug 28456: Add WHERE option to membership_expiry cronjob Some libraries have a large amount of accounts and want to be able to limit how many email reminders they send. Adding a where statement will allow for flexibility To test: 1 - Set some borrowers to expire soon 2 - Set MembershipExpiryDaysNotice to 10 3 - perl misc/cronjobs/membership_expiry.pl -c -v -n --before 100 --after 100 4 - Note the patrons that yo uadjusted show up 5 - Limit by various patron fields, e.g. perl misc/cronjobs/membership_expiry.pl -c -v -n --before 100 --after 100 --where="lastseen IS NULL" perl misc/cronjobs/membership_expiry.pl -c -v -n --before 100 --after 100 --where="lastseen IS NOT NULL" perl misc/cronjobs/membership_expiry.pl -c -v -n --before 100 --after 100 --where="surname LIKE '%a%'" perl misc/cronjobs/membership_expiry.pl -c -v -n --before 100 --after 100 --where="surname NOT LIKE '%a%'" 6 - Confirm expected results 7 - perl misc/cronjobs/membership_expiry.pl 8 - Confirm the help message makes sense Signed-off-by: Azucena Aguayo <azucena.aguayo@gmail.com>
Created attachment 124133 [details] [review] Bug 28456: Add WHERE option to membership_expiry cronjob Some libraries have a large amount of accounts and want to be able to limit how many email reminders they send. Adding a where statement will allow for flexibility To test: 1 - Set some borrowers to expire soon 2 - Set MembershipExpiryDaysNotice to 10 3 - perl misc/cronjobs/membership_expiry.pl -c -v -n --before 100 --after 100 4 - Note the patrons that yo uadjusted show up 5 - Limit by various patron fields, e.g. perl misc/cronjobs/membership_expiry.pl -c -v -n --before 100 --after 100 --where="lastseen IS NULL" perl misc/cronjobs/membership_expiry.pl -c -v -n --before 100 --after 100 --where="lastseen IS NOT NULL" perl misc/cronjobs/membership_expiry.pl -c -v -n --before 100 --after 100 --where="surname LIKE '%a%'" perl misc/cronjobs/membership_expiry.pl -c -v -n --before 100 --after 100 --where="surname NOT LIKE '%a%'" 6 - Confirm expected results 7 - perl misc/cronjobs/membership_expiry.pl 8 - Confirm the help message makes sense Signed-off-by: Azucena Aguayo <azucena.aguayo@gmail.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> [EDIT] Replace two inclue by include.
Note: There is no checking on the $where values. Passing invalid columns will crash the script etc. No blocker to me for this cron job.
Pushed to master for 21.11, thanks to everybody involved!
Comment on attachment 124133 [details] [review] Bug 28456: Add WHERE option to membership_expiry cronjob I would like to be able to ensure students who are on short placement of 3 weeks do not get the expiry email at all. Excluding a specific university (UMED) would assist.