-INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('MembershipExpiryDaysNotice',14,'Send an account expiration notice that a patron''s card is about to expire after',NULL,'Integer')
\ No newline at end of file
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('MembershipExpiryDaysNotice',NULL,'Send an account expiration notice that a patron''s card is about to expire after',NULL,'Integer')
('maxoutstanding','5','','maximum amount withstanding to be able make holds','Integer'),
('maxRecordsForFacets','20',NULL,NULL,'Integer'),
('maxreserves','50','','Define maximum number of holds a patron can place','Integer'),
-('MembershipExpiryDaysNotice','14','Send an account expiration notice that a patron\'s card is about to expire after',NULL,'Integer'),
+('MembershipExpiryDaysNotice',NULL,'Send an account expiration notice that a patron\'s card is about to expire after',NULL,'Integer'),
('minPasswordLength','3',NULL,'Specify the minimum length of a patron/staff password','free'),
('NewItemsDefaultLocation','','','If set, all new items will have a location of the given Location Code ( Authorized Value type LOC )',''),
('noissuescharge','5','','Define maximum amount withstanding before check outs are blocked','Integer'),
cronlogaction();
+my $expdays = C4::Context->preference('MembershipExpiryDaysNotice');
+if( !$expdays ) {
+ #If the pref is not set, we will exit
+ warn 'Exiting membership_expiry.pl: MembershipExpiryDaysNotice not set'
+ if $verbose;
+ exit;
+}
+
my $admin_adress = C4::Context->preference('KohaAdminEmailAddress');
warn 'getting upcoming membership expires' if $verbose;
my $upcoming_mem_expires = C4::Members::GetUpcomingMembershipExpires();