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