|
Lines 612-618
subtest 'EmailPurchaseSuggestions' => sub {
Link Here
|
| 612 |
# EmailPurchaseSuggestions set to disabled |
612 |
# EmailPurchaseSuggestions set to disabled |
| 613 |
t::lib::Mocks::mock_preference( "EmailPurchaseSuggestions", "0" ); |
613 |
t::lib::Mocks::mock_preference( "EmailPurchaseSuggestions", "0" ); |
| 614 |
Koha::Suggestion->new($my_suggestion)->store; |
614 |
Koha::Suggestion->new($my_suggestion)->store; |
| 615 |
my $newsuggestions_messages = C4::Letters::GetQueuedMessages( { borrowernumber => $borrowernumber } ); |
615 |
my $newsuggestions_messages = C4::Letters::GetQueuedMessages( { letter_code => 'NEW_SUGGESTION' } ); |
| 616 |
is( |
616 |
is( |
| 617 |
@$newsuggestions_messages, 0, |
617 |
@$newsuggestions_messages, 0, |
| 618 |
'New suggestion does not send an email when EmailPurchaseSuggestions disabled' |
618 |
'New suggestion does not send an email when EmailPurchaseSuggestions disabled' |
|
Lines 634-640
subtest 'EmailPurchaseSuggestions' => sub {
Link Here
|
| 634 |
Koha::Libraries->find('CPL')->update( { branchreplyto => 'branchemail@b.c' } ); |
634 |
Koha::Libraries->find('CPL')->update( { branchreplyto => 'branchemail@b.c' } ); |
| 635 |
Koha::Suggestion->new($my_suggestion)->store; |
635 |
Koha::Suggestion->new($my_suggestion)->store; |
| 636 |
|
636 |
|
| 637 |
$newsuggestions_messages = C4::Letters::GetQueuedMessages( { borrowernumber => $borrowernumber } ); |
637 |
$newsuggestions_messages = C4::Letters::GetQueuedMessages( { letter_code => 'NEW_SUGGESTION' } ); |
| 638 |
isnt( @$newsuggestions_messages, 0, 'New suggestions sends an email wne EmailPurchaseSuggestions enabled' ); |
638 |
isnt( @$newsuggestions_messages, 0, 'New suggestions sends an email wne EmailPurchaseSuggestions enabled' ); |
| 639 |
my $message1 = |
639 |
my $message1 = |
| 640 |
C4::Letters::GetMessage( $newsuggestions_messages->[0]->{message_id} ); |
640 |
C4::Letters::GetMessage( $newsuggestions_messages->[0]->{message_id} ); |
|
Lines 673-679
subtest 'EmailPurchaseSuggestions' => sub {
Link Here
|
| 673 |
t::lib::Mocks::mock_preference( "ReplytoDefault", 'library@b.c' ); |
673 |
t::lib::Mocks::mock_preference( "ReplytoDefault", 'library@b.c' ); |
| 674 |
Koha::Suggestion->new($my_suggestion)->store; |
674 |
Koha::Suggestion->new($my_suggestion)->store; |
| 675 |
|
675 |
|
| 676 |
$newsuggestions_messages = C4::Letters::GetQueuedMessages( { borrowernumber => $borrowernumber } ); |
676 |
$newsuggestions_messages = C4::Letters::GetQueuedMessages( { letter_code => 'NEW_SUGGESTION' } ); |
| 677 |
my $message5 = |
677 |
my $message5 = |
| 678 |
C4::Letters::GetMessage( $newsuggestions_messages->[4]->{message_id} ); |
678 |
C4::Letters::GetMessage( $newsuggestions_messages->[4]->{message_id} ); |
| 679 |
is( |
679 |
is( |
|
Lines 705-711
subtest 'EmailPurchaseSuggestions' => sub {
Link Here
|
| 705 |
); |
705 |
); |
| 706 |
Koha::Suggestion->new($my_suggestion)->store; |
706 |
Koha::Suggestion->new($my_suggestion)->store; |
| 707 |
|
707 |
|
| 708 |
$newsuggestions_messages = C4::Letters::GetQueuedMessages( { borrowernumber => $borrowernumber } ); |
708 |
$newsuggestions_messages = C4::Letters::GetQueuedMessages( { letter_code => 'NEW_SUGGESTION' } ); |
| 709 |
my $message7 = |
709 |
my $message7 = |
| 710 |
C4::Letters::GetMessage( $newsuggestions_messages->[6]->{message_id} ); |
710 |
C4::Letters::GetMessage( $newsuggestions_messages->[6]->{message_id} ); |
| 711 |
is( |
711 |
is( |
| 712 |
- |
|
|