Bug 3482 changed name of notices file
[koha.git] / misc / cronjobs / process_message_queue.pl
1 #!/usr/bin/perl -w
2
3 # Copyright 2008 LibLime
4 #
5 # This file is part of Koha.
6 #
7 # Koha is free software; you can redistribute it and/or modify it under the
8 # terms of the GNU General Public License as published by the Free Software
9 # Foundation; either version 2 of the License, or (at your option) any later
10 # version.
11 #
12 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14 # A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License along with
17 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
18 # Suite 330, Boston, MA  02111-1307 USA
19
20 use strict;
21 use warnings;
22 BEGIN {
23     # find Koha's Perl modules
24     # test carefully before changing this
25     use FindBin;
26     eval { require "$FindBin::Bin/../kohalib.pl" };
27 }
28 use C4::Letters;
29 use Getopt::Long;
30
31 my $help = 0;
32 my $verbose = 0;
33
34 GetOptions( 'h'    => \$help,
35             'v'    => \$verbose,
36        );
37 my $usage = << 'ENDUSAGE';
38
39 This script processes the message queue in the message_queue database
40 table. It sends out the messages in that queue and marks them
41 appropriately to indicate success or failure. It is recommended that
42 you run this regularly from cron, especially if you are using the
43 advance_notices.pl script.
44
45 This script has the following parameters :
46     -h help: this message
47     -v verbose
48
49 ENDUSAGE
50
51 die $usage if $help;
52
53 C4::Letters::SendQueuedMessages( { verbose => $verbose } );
54