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

(-)a/C4/Letters.pm (-4 / +10 lines)
Lines 1262-1269 sub _add_attachments { Link Here
1262
  This function's parameter hash reference takes the following
1262
  This function's parameter hash reference takes the following
1263
  optional named parameters:
1263
  optional named parameters:
1264
   message_transport_type: method of message sending (e.g. email, sms, etc.)
1264
   message_transport_type: method of message sending (e.g. email, sms, etc.)
1265
                           Can be a single string, or an arrayref of strings
1265
   borrowernumber        : who the message is to be sent
1266
   borrowernumber        : who the message is to be sent
1266
   letter_code           : type of message being sent (e.g. PASSWORD_RESET)
1267
   letter_code           : type of message being sent (e.g. PASSWORD_RESET)
1268
                           Can be a single string, or an arrayref of strings
1267
   limit                 : maximum number of messages to send
1269
   limit                 : maximum number of messages to send
1268
1270
1269
  This function returns an array of matching hash referenced rows from
1271
  This function returns an array of matching hash referenced rows from
Lines 1293-1304 sub _get_unsent_messages { Link Here
1293
            push @query_params, $params->{'borrowernumber'};
1295
            push @query_params, $params->{'borrowernumber'};
1294
        }
1296
        }
1295
        if ( $params->{'letter_code'} ) {
1297
        if ( $params->{'letter_code'} ) {
1296
            $statement .= ' AND mq.letter_code = ? ';
1298
            my @letter_codes = ref $params->{'letter_code'} eq "ARRAY" ? @{$params->{'letter_code'}} : $params->{'letter_code'};
1297
            push @query_params, $params->{'letter_code'};
1299
            my $q = join(",", "?" x @letter_codes );
1300
            $statement .= " AND mq.letter_code IN ( $q ) ";
1301
            push @query_params, @letter_codes;
1298
        }
1302
        }
1299
        if ( $params->{'type'} ) {
1303
        if ( $params->{'type'} ) {
1300
            $statement .= ' AND message_transport_type = ? ';
1304
            my @types = ref $params->{'type'} eq "ARRAY" ? @{$params->{'type'}} : $params->{'type'};
1301
            push @query_params, $params->{'type'};
1305
            my $q = join(",", "?" x @types );
1306
            $statement .= " AND message_transport_type IN ($q) ";
1307
            push @query_params, @types;
1302
        }
1308
        }
1303
        if ( $params->{'limit'} ) {
1309
        if ( $params->{'limit'} ) {
1304
            $statement .= ' limit ? ';
1310
            $statement .= ' limit ? ';
(-)a/misc/cronjobs/process_message_queue.pl (-6 / +5 lines)
Lines 38-44 my $method = 'LOGIN'; Link Here
38
my $help = 0;
38
my $help = 0;
39
my $verbose = 0;
39
my $verbose = 0;
40
my $type = q{};
40
my $type = q{};
41
my $letter_code;
41
my @letter_code;
42
42
43
GetOptions(
43
GetOptions(
44
    'u|username:s'      => \$username,
44
    'u|username:s'      => \$username,
Lines 47-54 GetOptions( Link Here
47
    'm|method:s'        => \$method,
47
    'm|method:s'        => \$method,
48
    'h|help|?'          => \$help,
48
    'h|help|?'          => \$help,
49
    'v|verbose'         => \$verbose,
49
    'v|verbose'         => \$verbose,
50
    't|type:s'          => \$type,
50
    't|type:s'          => \@type,
51
    'c|code:s'          => \$letter_code,
51
    'c|code:s'          => \@letter_code,
52
);
52
);
53
my $usage = << 'ENDUSAGE';
53
my $usage = << 'ENDUSAGE';
54
54
Lines 97-104 C4::Letters::SendQueuedMessages( Link Here
97
        password    => $password,
97
        password    => $password,
98
        method      => $method,
98
        method      => $method,
99
        limit       => $limit,
99
        limit       => $limit,
100
        type        => $type,
100
        type        => \@type,
101
        letter_code => $letter_code,
101
        letter_code => \@letter_code,
102
    }
102
    }
103
);
103
);
104
104
105
- 

Return to bug 27265