Lines 57-62
Verbose. Without this flag set, only fatal errors are reported.
Link Here
|
57 |
Do not send any email. Membership expire notices that would have been sent to |
57 |
Do not send any email. Membership expire notices that would have been sent to |
58 |
the patrons are printed to standard out. |
58 |
the patrons are printed to standard out. |
59 |
|
59 |
|
|
|
60 |
|
61 |
=item B<-p> |
62 |
|
63 |
Force the generation of print notices, even if the borrower has an email address. |
64 |
Note that this flag cannot be used in combination with -n |
65 |
|
60 |
=item B<-c> |
66 |
=item B<-c> |
61 |
|
67 |
|
62 |
Confirm flag: Add this option. The script will only print a usage |
68 |
Confirm flag: Add this option. The script will only print a usage |
Lines 132-137
In the event that the C<-n> flag is passed to this program, no emails
Link Here
|
132 |
are sent. Instead, messages are sent on standard output from this |
138 |
are sent. Instead, messages are sent on standard output from this |
133 |
program. |
139 |
program. |
134 |
|
140 |
|
|
|
141 |
When using the C<-p> flag, print notices are generated regardless of whether or |
142 |
not the borrower has an email address. This can be useful for libraries that |
143 |
prefer to deal with print notices. |
144 |
|
135 |
Notices can contain variables enclosed in double angle brackets like |
145 |
Notices can contain variables enclosed in double angle brackets like |
136 |
<<this>>. Those variables will be replaced with values |
146 |
<<this>>. Those variables will be replaced with values |
137 |
specific to the soon expiring members. |
147 |
specific to the soon expiring members. |
Lines 165-170
use Koha::Patrons;
Link Here
|
165 |
# These are defaults for command line options. |
175 |
# These are defaults for command line options. |
166 |
my $confirm; # -c: Confirm that the user has read and configured this script. |
176 |
my $confirm; # -c: Confirm that the user has read and configured this script. |
167 |
my $nomail; # -n: No mail. Will not send any emails. |
177 |
my $nomail; # -n: No mail. Will not send any emails. |
|
|
178 |
my $forceprint; # -p: Force print notices, even if email is found |
168 |
my $verbose = 0; # -v: verbose |
179 |
my $verbose = 0; # -v: verbose |
169 |
my $help = 0; |
180 |
my $help = 0; |
170 |
my $man = 0; |
181 |
my $man = 0; |
Lines 186-191
GetOptions(
Link Here
|
186 |
'man' => \$man, |
197 |
'man' => \$man, |
187 |
'c' => \$confirm, |
198 |
'c' => \$confirm, |
188 |
'n' => \$nomail, |
199 |
'n' => \$nomail, |
|
|
200 |
'p' => \$forceprint, |
189 |
'v' => \$verbose, |
201 |
'v' => \$verbose, |
190 |
'branch:s' => \$branch, |
202 |
'branch:s' => \$branch, |
191 |
'before:i' => \$before, |
203 |
'before:i' => \$before, |
Lines 289-300
while ( my $expiring_patron = $upcoming_mem_expires->next ) {
Link Here
|
289 |
my $sending_params = { |
301 |
my $sending_params = { |
290 |
letter_params => $letter_params, |
302 |
letter_params => $letter_params, |
291 |
message_name => 'Patron_Expiry', |
303 |
message_name => 'Patron_Expiry', |
|
|
304 |
forceprint => $forceprint |
292 |
}; |
305 |
}; |
293 |
|
306 |
|
294 |
my $is_notice_mandatory = grep( $expiring_patron->categorycode, @mandatory_expiry_notice_categories ); |
307 |
my $is_notice_mandatory = grep( $expiring_patron->categorycode, @mandatory_expiry_notice_categories ); |
295 |
if ($is_notice_mandatory) { |
308 |
if ($is_notice_mandatory) { |
296 |
$sending_params->{expiry_notice_mandatory} = 1; |
309 |
$sending_params->{expiry_notice_mandatory} = 1; |
297 |
$sending_params->{primary_contact_method} = $expiring_patron->primary_contact_method; |
310 |
$sending_params->{primary_contact_method} = $forceprint ? 'print' : $expiring_patron->primary_contact_method; |
298 |
} |
311 |
} |
299 |
|
312 |
|
300 |
my $result = $expiring_patron->queue_notice($sending_params); |
313 |
my $result = $expiring_patron->queue_notice($sending_params); |
301 |
- |
|
|