|
Lines 1269-1276
sub _add_attachments {
Link Here
|
| 1269 |
This function's parameter hash reference takes the following |
1269 |
This function's parameter hash reference takes the following |
| 1270 |
optional named parameters: |
1270 |
optional named parameters: |
| 1271 |
message_transport_type: method of message sending (e.g. email, sms, etc.) |
1271 |
message_transport_type: method of message sending (e.g. email, sms, etc.) |
|
|
1272 |
Can be a single string, or an arrayref of strings |
| 1272 |
borrowernumber : who the message is to be sent |
1273 |
borrowernumber : who the message is to be sent |
| 1273 |
letter_code : type of message being sent (e.g. PASSWORD_RESET) |
1274 |
letter_code : type of message being sent (e.g. PASSWORD_RESET) |
|
|
1275 |
Can be a single string, or an arrayref of strings |
| 1274 |
message_id : the message_id of the message. In that case the sub will return only 1 result |
1276 |
message_id : the message_id of the message. In that case the sub will return only 1 result |
| 1275 |
limit : maximum number of messages to send |
1277 |
limit : maximum number of messages to send |
| 1276 |
|
1278 |
|
|
Lines 1301-1312
sub _get_unsent_messages {
Link Here
|
| 1301 |
push @query_params, $params->{'borrowernumber'}; |
1303 |
push @query_params, $params->{'borrowernumber'}; |
| 1302 |
} |
1304 |
} |
| 1303 |
if ( $params->{'letter_code'} ) { |
1305 |
if ( $params->{'letter_code'} ) { |
| 1304 |
$statement .= ' AND mq.letter_code = ? '; |
1306 |
my @letter_codes = ref $params->{'letter_code'} eq "ARRAY" ? @{$params->{'letter_code'}} : $params->{'letter_code'}; |
| 1305 |
push @query_params, $params->{'letter_code'}; |
1307 |
if ( @letter_codes ) { |
|
|
1308 |
my $q = join( ",", ("?") x @letter_codes ); |
| 1309 |
$statement .= " AND mq.letter_code IN ( $q ) "; |
| 1310 |
push @query_params, @letter_codes; |
| 1311 |
} |
| 1306 |
} |
1312 |
} |
| 1307 |
if ( $params->{'type'} ) { |
1313 |
if ( $params->{'type'} ) { |
| 1308 |
$statement .= ' AND message_transport_type = ? '; |
1314 |
my @types = ref $params->{'type'} eq "ARRAY" ? @{$params->{'type'}} : $params->{'type'}; |
| 1309 |
push @query_params, $params->{'type'}; |
1315 |
if ( @types ) { |
|
|
1316 |
my $q = join( ",", ("?") x @types ); |
| 1317 |
$statement .= " AND message_transport_type IN ( $q ) "; |
| 1318 |
push @query_params, @types; |
| 1319 |
} |
| 1310 |
} |
1320 |
} |
| 1311 |
if ( $params->{message_id} ) { |
1321 |
if ( $params->{message_id} ) { |
| 1312 |
$statement .= ' AND message_id = ?'; |
1322 |
$statement .= ' AND message_id = ?'; |