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 |
if ( @letter_codes ) { |
|
|
1300 |
my $q = join( ",", "?" x @letter_codes ); |
1301 |
$statement .= " AND mq.letter_code IN ( $q ) "; |
1302 |
push @query_params, @letter_codes; |
1303 |
} |
1298 |
} |
1304 |
} |
1299 |
if ( $params->{'type'} ) { |
1305 |
if ( $params->{'type'} ) { |
1300 |
$statement .= ' AND message_transport_type = ? '; |
1306 |
my @types = ref $params->{'type'} eq "ARRAY" ? @{$params->{'type'}} : $params->{'type'}; |
1301 |
push @query_params, $params->{'type'}; |
1307 |
if ( @types ) { |
|
|
1308 |
my $q = join( ",", "?" x @types ); |
1309 |
$statement .= " AND message_transport_type IN ($q) "; |
1310 |
push @query_params, @types; |
1311 |
} |
1302 |
} |
1312 |
} |
1303 |
if ( $params->{'limit'} ) { |
1313 |
if ( $params->{'limit'} ) { |
1304 |
$statement .= ' limit ? '; |
1314 |
$statement .= ' limit ? '; |