View | Details | Raw Unified | Return to bug 6810
Collapse All | Expand All

(-)a/C4/Members.pm (-2 / +4 lines)
Lines 42-47 use Text::Unaccent qw( unac_string ); Link Here
42
use Koha::AuthUtils qw(hash_password);
42
use Koha::AuthUtils qw(hash_password);
43
use Koha::Database;
43
use Koha::Database;
44
use Module::Load;
44
use Module::Load;
45
use DateTime::Duration;
46
45
if ( C4::Context->preference('NorwegianPatronDBEnable') && C4::Context->preference('NorwegianPatronDBEnable') == 1 ) {
47
if ( C4::Context->preference('NorwegianPatronDBEnable') && C4::Context->preference('NorwegianPatronDBEnable') == 1 ) {
46
    load Koha::NorwegianPatronDB, qw( NLUpdateHashedPIN NLEncryptPIN NLSync );
48
    load Koha::NorwegianPatronDB, qw( NLUpdateHashedPIN NLEncryptPIN NLSync );
47
}
49
}
Lines 1489-1496 sub GetExpiryDate { Link Here
1489
1491
1490
sub GetUpcomingMembershipExpires {
1492
sub GetUpcomingMembershipExpires {
1491
    my $dbh = C4::Context->dbh;
1493
    my $dbh = C4::Context->dbh;
1492
    my $days = C4::Context->preference("MembershipExpiryDaysNotice") || 0;
1494
    my $days = DateTime::Duration->new(days => C4::Context->preference("MembershipExpiryDaysNotice") || 0);
1493
    my $dateexpiry = DateTime->now()->add(days => $days)->ymd();
1495
    my $dateexpiry = output_pref({ dt => (dt_from_string() + $days), dateformat => 'iso', dateonly => 1 });
1494
1496
1495
    my $query = "
1497
    my $query = "
1496
        SELECT borrowers.*, categories.description,
1498
        SELECT borrowers.*, categories.description,
(-)a/installer/data/mysql/atomicupdate/bug_6810-add_membershipexpiry_notification.sql (+1 lines)
Line 0 Link Here
1
INSERT IGNORE INTO letter (module, code, name, title,content) VALUES('members','MEMBERSHIP_EXPIRY','Account expiration','Account expiration','Dear <<borrowers.title>> <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nYour library card will expire soon, on:\r\n\r\n<<borrowers.dateexpiry>>\r\n\r\nThank you,\r\n\r\nLibrarian\r\n\r\n<<branches.branchname>>');
(-)a/installer/data/mysql/de-DE/mandatory/sample_notices.sql (-1 / +4 lines)
Lines 135-138 Ihr Biblioheksteam' Link Here
135
);
135
);
136
136
137
INSERT INTO letter(module, code, branchcode, name, title, content, message_transport_type)
137
INSERT INTO letter(module, code, branchcode, name, title, content, message_transport_type)
138
VALUES ('acquisition', 'ACQ_NOTIF_ON_RECEIV', '', 'Benachrichtigung bei Zugang', 'Bestelltes Medium ist eingetroffen', 'Liebe/r <<borrowers.firstname>> <<borrowers.surname>>,\n\nDie Bestellung <<aqorders.ordernumber>> (<<biblio.title>>) ist eingetroffen und wird bearbeitet.\n\nIhr Bibliotheksteam', 'email')
138
VALUES ('acquisition', 'ACQ_NOTIF_ON_RECEIV', '', 'Benachrichtigung bei Zugang', 'Bestelltes Medium ist eingetroffen', 'Liebe/r <<borrowers.firstname>> <<borrowers.surname>>,\n\nDie Bestellung <<aqorders.ordernumber>> (<<biblio.title>>) ist eingetroffen und wird bearbeitet.\n\nIhr Bibliotheksteam', 'email');
139
140
INSERT INTO letter(module, code, branchcode, name, title, is_html, content)
141
VALUES ('members','MEMBERSHIP_EXPIRY','','Account expiration','Account expiration', '0', 'Dear <<borrowers.title>> <<borrowers.firstname>> <<borrowers.surname>>,.\r\n\r\nYour library card will expire soon, on:\r\n\r\n<<borrowers.dateexpiry>>\r\n\r\nThank you,\r\n\r\nLibrarian\r\n\r\n<<branches.branchname>>');
(-)a/installer/data/mysql/en/mandatory/sample_notices.sql (+3 lines)
Lines 155-157 Your library.' Link Here
155
155
156
INSERT INTO letter(module, code, branchcode, name, title, content, message_transport_type)
156
INSERT INTO letter(module, code, branchcode, name, title, content, message_transport_type)
157
VALUES ('acquisition', 'ACQ_NOTIF_ON_RECEIV', '', 'Notification on receiving', 'Order received', 'Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\n The order <<aqorders.ordernumber>> (<<biblio.title>>) has been received.\n\nYour library.', 'email')
157
VALUES ('acquisition', 'ACQ_NOTIF_ON_RECEIV', '', 'Notification on receiving', 'Order received', 'Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\n The order <<aqorders.ordernumber>> (<<biblio.title>>) has been received.\n\nYour library.', 'email')
158
159
INSERT INTO letter(module, code, branchcode, name, title, is_html, content)
160
VALUES ('members','MEMBERSHIP_EXPIRY','','Account expiration','Account expiration', '0', 'Dear <<borrowers.title>> <<borrowers.firstname>> <<borrowers.surname>>,.\r\n\r\nYour library card will expire soon, on:\r\n\r\n<<borrowers.dateexpiry>>\r\n\r\nThank you,\r\n\r\nLibrarian\r\n\r\n<<branches.branchname>>');
(-)a/installer/data/mysql/es-ES/mandatory/sample_notices.sql (-1 / +4 lines)
Lines 149-152 Your library.' Link Here
149
149
150
150
151
INSERT INTO letter(module, code, branchcode, name, title, content, message_transport_type)
151
INSERT INTO letter(module, code, branchcode, name, title, content, message_transport_type)
152
VALUES ('acquisition', 'ACQ_NOTIF_ON_RECEIV', '', 'Notification on receiving', 'Order received', 'Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\n The order <<aqorders.ordernumber>> (<<biblio.title>>) has been received.\n\nYour library.', 'email')
152
VALUES ('acquisition', 'ACQ_NOTIF_ON_RECEIV', '', 'Notification on receiving', 'Order received', 'Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\n The order <<aqorders.ordernumber>> (<<biblio.title>>) has been received.\n\nYour library.', 'email');
153
154
INSERT INTO letter(module, code, branchcode, name, title, is_html, content)
155
VALUES ('members','MEMBERSHIP_EXPIRY','','Account expiration','Account expiration', '0', 'Dear <<borrowers.title>> <<borrowers.firstname>> <<borrowers.surname>>,.\r\n\r\nYour library card will expire soon, on:\r\n\r\n<<borrowers.dateexpiry>>\r\n\r\nThank you,\r\n\r\nLibrarian\r\n\r\n<<branches.branchname>>');
(-)a/installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql (-1 / +4 lines)
Lines 150-153 Your library.' Link Here
150
);
150
);
151
151
152
INSERT INTO letter(module, code, branchcode, name, title, content, message_transport_type)
152
INSERT INTO letter(module, code, branchcode, name, title, content, message_transport_type)
153
VALUES ('acquisition', 'ACQ_NOTIF_ON_RECEIV', '', 'Notification on receiving', 'Order received', 'Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\n The order <<aqorders.ordernumber>> (<<biblio.title>>) has been received.\n\nYour library.', 'email')
153
VALUES ('acquisition', 'ACQ_NOTIF_ON_RECEIV', '', 'Notification on receiving', 'Order received', 'Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\n The order <<aqorders.ordernumber>> (<<biblio.title>>) has been received.\n\nYour library.', 'email');
154
155
INSERT INTO letter(module, code, branchcode, name, title, is_html, content)
156
VALUES ('members','MEMBERSHIP_EXPIRY','','Account expiration','Account expiration', '0', 'Dear <<borrowers.title>> <<borrowers.firstname>> <<borrowers.surname>>,.\r\n\r\nYour library card will expire soon, on:\r\n\r\n<<borrowers.dateexpiry>>\r\n\r\nThank you,\r\n\r\nLibrarian\r\n\r\n<<branches.branchname>>');
(-)a/installer/data/mysql/it-IT/necessari/notices.sql (-1 / +4 lines)
Lines 147-150 Lo staff della biblioteca.' Link Here
147
);
147
);
148
148
149
INSERT INTO letter(module, code, branchcode, name, title, content, message_transport_type)
149
INSERT INTO letter(module, code, branchcode, name, title, content, message_transport_type)
150
VALUES ('acquisition', 'ACQ_NOTIF_ON_RECEIV', '', 'Notification on receiving', 'Order received', 'Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\n The order <<aqorders.ordernumber>> (<<biblio.title>>) has been received.\n\nYour library.', 'email')
150
VALUES ('acquisition', 'ACQ_NOTIF_ON_RECEIV', '', 'Notification on receiving', 'Order received', 'Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\n The order <<aqorders.ordernumber>> (<<biblio.title>>) has been received.\n\nYour library.', 'email');
151
152
INSERT INTO letter(module, code, branchcode, name, title, is_html, content)
153
VALUES ('members','MEMBERSHIP_EXPIRY','','Account expiration','Account expiration', '0', 'Dear <<borrowers.title>> <<borrowers.firstname>> <<borrowers.surname>>,.\r\n\r\nYour library card will expire soon, on:\r\n\r\n<<borrowers.dateexpiry>>\r\n\r\nThank you,\r\n\r\nLibrarian\r\n\r\n<<branches.branchname>>');
(-)a/installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql (-1 / +4 lines)
Lines 169-172 Your library.' Link Here
169
);
169
);
170
170
171
INSERT INTO letter(module, code, branchcode, name, title, content, message_transport_type)
171
INSERT INTO letter(module, code, branchcode, name, title, content, message_transport_type)
172
VALUES ('acquisition', 'ACQ_NOTIF_ON_RECEIV', '', 'Notification on receiving', 'Order received', 'Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\n The order <<aqorders.ordernumber>> (<<biblio.title>>) has been received.\n\nYour library.', 'email')
172
VALUES ('acquisition', 'ACQ_NOTIF_ON_RECEIV', '', 'Notification on receiving', 'Order received', 'Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\n The order <<aqorders.ordernumber>> (<<biblio.title>>) has been received.\n\nYour library.', 'email');
173
174
INSERT INTO letter(module, code, branchcode, name, title, is_html, content)
175
VALUES ('members','MEMBERSHIP_EXPIRY','','Account expiration','Account expiration', '0', 'Dear <<borrowers.title>> <<borrowers.firstname>> <<borrowers.surname>>,.\r\n\r\nYour library card will expire soon, on:\r\n\r\n<<borrowers.dateexpiry>>\r\n\r\nThank you,\r\n\r\nLibrarian\r\n\r\n<<branches.branchname>>');
(-)a/installer/data/mysql/pl-PL/mandatory/sample_notices.sql (-1 / +4 lines)
Lines 147-150 Your library.' Link Here
147
);
147
);
148
148
149
INSERT INTO letter(module, code, branchcode, name, title, content, message_transport_type)
149
INSERT INTO letter(module, code, branchcode, name, title, content, message_transport_type)
150
VALUES ('acquisition', 'ACQ_NOTIF_ON_RECEIV', '', 'Notification on receiving', 'Order received', 'Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\n The order <<aqorders.ordernumber>> (<<biblio.title>>) has been received.\n\nYour library.', 'email')
150
VALUES ('acquisition', 'ACQ_NOTIF_ON_RECEIV', '', 'Notification on receiving', 'Order received', 'Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\n The order <<aqorders.ordernumber>> (<<biblio.title>>) has been received.\n\nYour library.', 'email');
151
152
INSERT INTO letter(module, code, branchcode, name, title, is_html, content)
153
VALUES ('members','MEMBERSHIP_EXPIRY','','Account expiration','Account expiration', '0', 'Dear <<borrowers.title>> <<borrowers.firstname>> <<borrowers.surname>>,.\r\n\r\nYour library card will expire soon, on:\r\n\r\n<<borrowers.dateexpiry>>\r\n\r\nThank you,\r\n\r\nLibrarian\r\n\r\n<<branches.branchname>>');
(-)a/installer/data/mysql/ru-RU/mandatory/sample_notices.sql (-1 / +4 lines)
Lines 149-152 Your library.' Link Here
149
);
149
);
150
150
151
INSERT INTO letter(module, code, branchcode, name, title, content, message_transport_type)
151
INSERT INTO letter(module, code, branchcode, name, title, content, message_transport_type)
152
VALUES ('acquisition', 'ACQ_NOTIF_ON_RECEIV', '', 'Notification on receiving', 'Order received', 'Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\n The order <<aqorders.ordernumber>> (<<biblio.title>>) has been received.\n\nYour library.', 'email')
152
VALUES ('acquisition', 'ACQ_NOTIF_ON_RECEIV', '', 'Notification on receiving', 'Order received', 'Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\n The order <<aqorders.ordernumber>> (<<biblio.title>>) has been received.\n\nYour library.', 'email');
153
154
INSERT INTO letter(module, code, branchcode, name, title, is_html, content)
155
VALUES ('members','MEMBERSHIP_EXPIRY','','Account expiration','Account expiration', '0', 'Dear <<borrowers.title>> <<borrowers.firstname>> <<borrowers.surname>>,.\r\n\r\nYour library card will expire soon, on:\r\n\r\n<<borrowers.dateexpiry>>\r\n\r\nThank you,\r\n\r\nLibrarian\r\n\r\n<<branches.branchname>>');
(-)a/installer/data/mysql/sysprefs.sql (-2 / +2 lines)
Lines 207-212 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
207
('maxoutstanding','5','','maximum amount withstanding to be able make holds','Integer'),
207
('maxoutstanding','5','','maximum amount withstanding to be able make holds','Integer'),
208
('maxRecordsForFacets','20',NULL,NULL,'Integer'),
208
('maxRecordsForFacets','20',NULL,NULL,'Integer'),
209
('maxreserves','50','','Define maximum number of holds a patron can place','Integer'),
209
('maxreserves','50','','Define maximum number of holds a patron can place','Integer'),
210
('MembershipExpiryDaysNotice','14','Send an account expiration notice that a patron\'s card is about to expire after',NULL,'Integer'),
210
('minPasswordLength','3',NULL,'Specify the minimum length of a patron/staff password','free'),
211
('minPasswordLength','3',NULL,'Specify the minimum length of a patron/staff password','free'),
211
('NewItemsDefaultLocation','','','If set, all new items will have a location of the given Location Code ( Authorized Value type LOC )',''),
212
('NewItemsDefaultLocation','','','If set, all new items will have a location of the given Location Code ( Authorized Value type LOC )',''),
212
('noissuescharge','5','','Define maximum amount withstanding before check outs are blocked','Integer'),
213
('noissuescharge','5','','Define maximum amount withstanding before check outs are blocked','Integer'),
Lines 480-485 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
480
('XSLTDetailsDisplay','default','','Enable XSL stylesheet control over details page display on intranet','Free'),
481
('XSLTDetailsDisplay','default','','Enable XSL stylesheet control over details page display on intranet','Free'),
481
('XSLTResultsDisplay','default','','Enable XSL stylesheet control over results page display on intranet','Free'),
482
('XSLTResultsDisplay','default','','Enable XSL stylesheet control over results page display on intranet','Free'),
482
('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'),
483
('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'),
483
('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo'),
484
('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo')
484
('MembershipExpiryDaysNotice' ,14,'Send an account expiration notice that a patron\'s card is about to expire after',NULL,'Integer')
485
;
485
;
(-)a/installer/data/mysql/uk-UA/mandatory/sample_notices.sql (-1 / +4 lines)
Lines 148-151 Your library.' Link Here
148
);
148
);
149
149
150
INSERT INTO letter(module, code, branchcode, name, title, content, message_transport_type)
150
INSERT INTO letter(module, code, branchcode, name, title, content, message_transport_type)
151
VALUES ('acquisition', 'ACQ_NOTIF_ON_RECEIV', '', 'Notification on receiving', 'Order received', 'Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\n The order <<aqorders.ordernumber>> (<<biblio.title>>) has been received.\n\nYour library.', 'email')
151
VALUES ('acquisition', 'ACQ_NOTIF_ON_RECEIV', '', 'Notification on receiving', 'Order received', 'Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\n The order <<aqorders.ordernumber>> (<<biblio.title>>) has been received.\n\nYour library.', 'email');
152
153
INSERT INTO letter(module, code, branchcode, name, title, is_html, content)
154
VALUES ('members','MEMBERSHIP_EXPIRY','','Account expiration','Account expiration', '0', 'Dear <<borrowers.title>> <<borrowers.firstname>> <<borrowers.surname>>,.\r\n\r\nYour library card will expire soon, on:\r\n\r\n<<borrowers.dateexpiry>>\r\n\r\nThank you,\r\n\r\nLibrarian\r\n\r\n<<branches.branchname>>');
(-)a/misc/cronjobs/membership_expiry.pl (-15 / +113 lines)
Lines 2-8 Link Here
2
2
3
# This file is part of Koha.
3
# This file is part of Koha.
4
#
4
#
5
# Copyright (C) 2013 Amit Gupta (amitddng135@gmail.com)
5
# Copyright (C) 2015 Amit Gupta (amitddng135@gmail.com)
6
#
6
#
7
# Koha is free software; you can redistribute it and/or modify it
7
# Koha is free software; you can redistribute it and/or modify it
8
# under the terms of the GNU General Public License as published by
8
# under the terms of the GNU General Public License as published by
Lines 19-39 Link Here
19
19
20
=head1 NAME
20
=head1 NAME
21
21
22
membership_expires.pl - cron script to put membership expiry reminders into message queue
22
membership_expiry.pl - cron script to put memberships expires reminders into message queue
23
23
24
=head1 SYNOPSIS
24
=head1 SYNOPSIS
25
25
26
./membership_expires.pl -c
26
./membership_expiry.pl -c
27
27
28
or, in crontab:
28
or, in crontab:
29
29
30
0 1 * * * membership_expires.pl -c
30
0 1 * * * membership_expiry.pl -c
31
32
=head1 DESCRIPTION
33
34
This script send memberships expires reminder notices to be sent to
35
patrons. It queues them in the message queue, which is processed by
36
the process_message_queue.pl cronjob.
31
37
32
=cut
38
=cut
33
39
34
use strict;
40
35
use warnings;
41
use Modern::Perl;
36
use Getopt::Long;
42
use Getopt::Long;
43
use Pod::Usage;
37
use Data::Dumper;
44
use Data::Dumper;
38
BEGIN {
45
BEGIN {
39
    # find Koha's Perl modules
46
    # find Koha's Perl modules
Lines 47-64 use C4::Letters; Link Here
47
use C4::Dates qw/format_date/;
54
use C4::Dates qw/format_date/;
48
use C4::Log;
55
use C4::Log;
49
56
50
cronlogaction();
57
58
=head1 NAME
59
60
membership_expiry.pl - prepare messages to be sent to patrons for nearly memberships are going expires
61
62
=head1 SYNOPSIS
63
64
membership_expiry.pl [-c]
65
66
=head1 OPTIONS
67
68
=over 8
69
70
=item B<--help>
71
72
Print a brief help message and exits.
73
74
=item B<--man>
75
76
Prints the manual page and exits.
77
78
=item B<-v>
79
80
Verbose. Without this flag set, only fatal errors are reported.
81
82
=item B<-n>
83
84
Do not send any email. Memberships expires notices that would have been sent to
85
the patrons are printed to standard out.
86
87
=item B<-c>
88
89
Confirm flag: Add this option. The script will only print a usage
90
statement otherwise.
91
92
=back
93
94
=head1 DESCRIPTION
95
96
This script is designed to alert send memberships expires notice
97
98
=head2 Configuration
99
100
This script pays attention to send the memberships expires notice
101
The content of the messages is configured in Tools -> Notices and slips. Use the MEMBERSHIP_EXPIRY template
102
103
=head2 Outgoing emails
104
105
Typically, messages are prepared for each patron when the memberships are going to expires
106
107
108
These emails are staged in the outgoing message queue, as are messages
109
produced by other features of Koha. This message queue must be
110
processed regularly by the
111
F<misc/cronjobs/process_message_queue.pl> program.
112
113
In the event that the C<-n> flag is passed to this program, no emails
114
are sent. Instead, messages are sent on standard output from this
115
program.
116
117
=head2 Templates
118
119
Templates can contain variables enclosed in double angle brackets like
120
E<lt>E<lt>thisE<gt>E<gt>. Those variables will be replaced with values
121
specific to the members there membership expiry date is coming.
122
Available variables are:
123
124
=over
125
126
=item E<lt>E<lt>borrowers.*E<gt>E<gt>
127
128
any field from the borrowers table
129
130
=item E<lt>E<lt>branches.*E<gt>E<gt>
131
132
any field from the branches table
133
134
=back
135
136
=head1 SEE ALSO
137
138
The F<misc/cronjobs/membership_expiry.pl> program allows you to send
139
messages to patrons when the memberships are going to expires.
140
=cut
51
141
52
# These are defaults for command line options.
142
# These are defaults for command line options.
143
53
my $confirm;                              # -c: Confirm that the user has read and configured this script.
144
my $confirm;                              # -c: Confirm that the user has read and configured this script.
54
my $nomail;                               # -n: No mail. Will not send any emails.
145
my $nomail;                               # -n: No mail. Will not send any emails.
55
my $verbose= 0;                           # -v: verbose
146
my $verbose= 0;                           # -v: verbose
56
147
57
GetOptions( 'c'              => \$confirm,
148
my $help    = 0;
149
my $man     = 0;
150
151
GetOptions(
152
            'help|?'         => \$help,
153
            'man'            => \$man,
154
            'c'              => \$confirm,
58
            'n'              => \$nomail,
155
            'n'              => \$nomail,
59
            'v'              => \$verbose,
156
            'v'              => \$verbose,
60
       );
157
       ) or pod2usage(2);
61
158
pod2usage(1) if $help;
159
pod2usage( -verbose => 2 ) if $man;;
62
160
63
my $usage = << 'ENDUSAGE';
161
my $usage = << 'ENDUSAGE';
64
This script prepares for membership expiry reminders to be sent to
162
This script prepares for membership expiry reminders to be sent to
Lines 78-83 unless ($confirm) { Link Here
78
    exit unless (/^y/i);
176
    exit unless (/^y/i);
79
}
177
}
80
178
179
cronlogaction();
180
81
my $admin_adress = C4::Context->preference('KohaAdminEmailAddress');
181
my $admin_adress = C4::Context->preference('KohaAdminEmailAddress');
82
warn 'getting upcoming membership expires' if $verbose;
182
warn 'getting upcoming membership expires' if $verbose;
83
my $upcoming_mem_expires = C4::Members::GetUpcomingMembershipExpires();
183
my $upcoming_mem_expires = C4::Members::GetUpcomingMembershipExpires();
Lines 86-92 warn 'found ' . scalar( @$upcoming_mem_expires ) . ' issues' if $verbose; Link Here
86
186
87
UPCOMINGMEMEXP: foreach my $recent ( @$upcoming_mem_expires ) {
187
UPCOMINGMEMEXP: foreach my $recent ( @$upcoming_mem_expires ) {
88
    my $from_address = $recent->{'branchemail'} || $admin_adress;
188
    my $from_address = $recent->{'branchemail'} || $admin_adress;
89
    my $letter_type = 'MEMEXP';
189
    my $letter_type = 'MEMBERSHIP_EXPIRY';
90
    my $letter = C4::Letters::getletter( 'members', $letter_type, $recent->{'branchcode'} );
190
    my $letter = C4::Letters::getletter( 'members', $letter_type, $recent->{'branchcode'} );
91
    die "no letter of type '$letter_type' found. Please see sample_notices.sql" unless $letter;
191
    die "no letter of type '$letter_type' found. Please see sample_notices.sql" unless $letter;
92
192
Lines 123-131 sub parse_letter { Link Here
123
    }
223
    }
124
    my $letter =  C4::Letters::GetPreparedLetter (
224
    my $letter =  C4::Letters::GetPreparedLetter (
125
            module => 'members',
225
            module => 'members',
126
            letter_code => 'MEMEXP',
226
            letter_code => 'MEMBERSHIP_EXPIRY',
127
            branchcode => $params->{'branchcode'},
227
            tables => {'borrowers', $params->{'borrowernumber'}, 'branches', $params->{'branchcode'}},
128
            tables => {'borrowers', $params->{'borrowernumber'},},
129
    );
228
    );
130
}
229
}
131
230
132
- 

Return to bug 6810