Lines 1232-1239
sub _add_attachments {
Link Here
|
1232 |
This function's parameter hash reference takes the following |
1232 |
This function's parameter hash reference takes the following |
1233 |
optional named parameters: |
1233 |
optional named parameters: |
1234 |
message_transport_type: method of message sending (e.g. email, sms, etc.) |
1234 |
message_transport_type: method of message sending (e.g. email, sms, etc.) |
|
|
1235 |
Can be a single string, or an arrayref of strings |
1235 |
borrowernumber : who the message is to be sent |
1236 |
borrowernumber : who the message is to be sent |
1236 |
letter_code : type of message being sent (e.g. PASSWORD_RESET) |
1237 |
letter_code : type of message being sent (e.g. PASSWORD_RESET) |
|
|
1238 |
Can be a single string, or an arrayref of strings |
1237 |
message_id : the message_id of the message. In that case the sub will return only 1 result |
1239 |
message_id : the message_id of the message. In that case the sub will return only 1 result |
1238 |
limit : maximum number of messages to send |
1240 |
limit : maximum number of messages to send |
1239 |
|
1241 |
|
Lines 1264-1275
sub _get_unsent_messages {
Link Here
|
1264 |
push @query_params, $params->{'borrowernumber'}; |
1266 |
push @query_params, $params->{'borrowernumber'}; |
1265 |
} |
1267 |
} |
1266 |
if ( $params->{'letter_code'} ) { |
1268 |
if ( $params->{'letter_code'} ) { |
1267 |
$statement .= ' AND mq.letter_code = ? '; |
1269 |
my @letter_codes = ref $params->{'letter_code'} eq "ARRAY" ? @{$params->{'letter_code'}} : $params->{'letter_code'}; |
1268 |
push @query_params, $params->{'letter_code'}; |
1270 |
if ( @letter_codes ) { |
|
|
1271 |
my $q = join( ",", ("?") x @letter_codes ); |
1272 |
$statement .= " AND mq.letter_code IN ( $q ) "; |
1273 |
push @query_params, @letter_codes; |
1274 |
} |
1269 |
} |
1275 |
} |
1270 |
if ( $params->{'type'} ) { |
1276 |
if ( $params->{'type'} ) { |
1271 |
$statement .= ' AND message_transport_type = ? '; |
1277 |
my @types = ref $params->{'type'} eq "ARRAY" ? @{$params->{'type'}} : $params->{'type'}; |
1272 |
push @query_params, $params->{'type'}; |
1278 |
if ( @types ) { |
|
|
1279 |
my $q = join( ",", ("?") x @types ); |
1280 |
$statement .= " AND message_transport_type IN ( $q ) "; |
1281 |
push @query_params, @types; |
1282 |
} |
1273 |
} |
1283 |
} |
1274 |
if ( $params->{message_id} ) { |
1284 |
if ( $params->{message_id} ) { |
1275 |
$statement .= ' AND message_id = ?'; |
1285 |
$statement .= ' AND message_id = ?'; |