Lines 953-958
sub EnqueueLetter {
Link Here
|
953 |
return; |
953 |
return; |
954 |
} |
954 |
} |
955 |
|
955 |
|
|
|
956 |
my $branchcode = $params->{borrowernumber} ? Koha::Patrons->find( $params->{borrowernumber} )->branchcode : undef; |
957 |
|
956 |
# If we have any attachments we should encode then into the body. |
958 |
# If we have any attachments we should encode then into the body. |
957 |
if ( $params->{'attachments'} ) { |
959 |
if ( $params->{'attachments'} ) { |
958 |
$params->{'letter'} = _add_attachments( |
960 |
$params->{'letter'} = _add_attachments( |
Lines 984-989
sub EnqueueLetter {
Link Here
|
984 |
reply_address => $params->{reply_address}, |
986 |
reply_address => $params->{reply_address}, |
985 |
content_type => $params->{letter}->{'content-type'}, |
987 |
content_type => $params->{letter}->{'content-type'}, |
986 |
failure_code => $params->{failure_code} || q{}, |
988 |
failure_code => $params->{failure_code} || q{}, |
|
|
989 |
branchcode => $params->{branchcode}, |
987 |
} |
990 |
} |
988 |
)->store(); |
991 |
)->store(); |
989 |
return $message->id; |
992 |
return $message->id; |
Lines 1017-1022
sub SendQueuedMessages {
Link Here
|
1017 |
my $params = shift; |
1020 |
my $params = shift; |
1018 |
my $limit = $params->{limit}; |
1021 |
my $limit = $params->{limit}; |
1019 |
my $where = $params->{where}; |
1022 |
my $where = $params->{where}; |
|
|
1023 |
my $branchcode = $params->{branchcode}; |
1020 |
|
1024 |
|
1021 |
Koha::Exceptions::BadParameter->throw("Parameter message_id cannot be empty if passed.") |
1025 |
Koha::Exceptions::BadParameter->throw("Parameter message_id cannot be empty if passed.") |
1022 |
if ( exists( $params->{message_id} ) && !$params->{message_id} ); |
1026 |
if ( exists( $params->{message_id} ) && !$params->{message_id} ); |
Lines 1025-1030
sub SendQueuedMessages {
Link Here
|
1025 |
|
1029 |
|
1026 |
my $count_messages = 0; |
1030 |
my $count_messages = 0; |
1027 |
my $unsent_messages = Koha::Notice::Messages->search({ |
1031 |
my $unsent_messages = Koha::Notice::Messages->search({ |
|
|
1032 |
$params->{branchcode} ? ( branchcode => $params->{branchcode} ) : (), |
1028 |
status => 'pending', |
1033 |
status => 'pending', |
1029 |
$params->{message_id} ? ( message_id => $params->{message_id} ) : (), |
1034 |
$params->{message_id} ? ( message_id => $params->{message_id} ) : (), |
1030 |
$params->{borrowernumber} ? ( borrowernumber => $params->{borrowernumber} ) : (), |
1035 |
$params->{borrowernumber} ? ( borrowernumber => $params->{borrowernumber} ) : (), |