Commit 9bd9476b authored by Marcel de Rooy's avatar Marcel de Rooy Committed by Brendan A Gallagher

Bug 12426: [QA Follow-up] Clear to_address to force update

When resending an email from the Notices tab in Patrons, we would like
to use the recent email address.

Test plan:
[1] Look up a patron with some notices sent.
[2] Adjust the patron email address (watch AutoEmailPrimaryAddress).
[3] Resend the notice. Verify if the new address was used.
Signed-off-by: default avatarMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: default avatarBrendan A Gallagher <brendan@bywatersolutions.com>
parent fbb7097b
......@@ -1120,7 +1120,7 @@ sub GetMessage {
Updates the message to 'pending' status so that
it will be resent later on.
returns 1 on success, 0 on failure
returns 1 on success, 0 on failure, undef if no message was found
=cut
......@@ -1130,13 +1130,18 @@ sub ResendMessage {
my $message = GetMessage( $message_id );
return unless $message;
my $rv = 0;
if ( $message->{status} ne 'pending' ) {
return ((C4::Letters::_set_message_status( {
message_id => $message_id,
status => 'pending',
} ) > 0) ? 1:0);
$rv = C4::Letters::_set_message_status({
message_id => $message_id,
status => 'pending',
});
$rv = $rv > 0? 1: 0;
# Clear destination email address to force address update
_update_message_to_address( $message_id, undef ) if $rv &&
$message->{message_transport_type} eq 'email';
}
return 0;
return $rv;
}
=head2 _add_attachements
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment