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 ? '; |