Commit e2da2728 authored by J. David Bavousett's avatar J. David Bavousett Committed by Galen Charlton

Bug 3619 - C4::Letters::_send_message_by_email does not obey AutoEmailPrimaryAddress

This enhancement would cause C4::Letters::_send_message_by_email to obey the
syspref.
Signed-off-by: Galen Charlton's avatarGalen Charlton <gmcharlt@gmail.com>
parent 04cafc14
......@@ -821,7 +821,9 @@ sub _send_message_by_email ($;$$$) {
status => 'failed' } );
return;
}
unless ($to_address = $member->{email}) { # assigment, not comparison
my $which_address = C4::Context->preference('AutoEmailPrimaryAddress');
$to_address = $member->{$which_address};
unless ($to_address) {
# warn "FAIL: No 'to_address' and no email for " . ($member->{surname} ||'') . ", borrowernumber ($message->{borrowernumber})";
# warning too verbose for this more common case?
_set_message_status( { message_id => $message->{'message_id'},
......
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