View | Details | Raw Unified | Return to bug 5544
Collapse All | Expand All

(-)a/C4/Letters.pm (-4 / +3 lines)
Lines 918-926 sub _send_message_by_email { Link Here
918
    my $message = shift or return;
918
    my $message = shift or return;
919
    my ($username, $password, $method) = @_;
919
    my ($username, $password, $method) = @_;
920
920
921
    my $to_address = $message->{to_address};
921
    my $member = C4::Members::GetMember( 'borrowernumber' => $message->{'borrowernumber'} );
922
    my $to_address = $message->{'to_address'};
922
    unless ($to_address) {
923
    unless ($to_address) {
923
        my $member = C4::Members::GetMember( 'borrowernumber' => $message->{'borrowernumber'} );
924
        unless ($member) {
924
        unless ($member) {
925
            warn "FAIL: No 'to_address' and INVALID borrowernumber ($message->{borrowernumber})";
925
            warn "FAIL: No 'to_address' and INVALID borrowernumber ($message->{borrowernumber})";
926
            _set_message_status( { message_id => $message->{'message_id'},
926
            _set_message_status( { message_id => $message->{'message_id'},
Lines 945-951 sub _send_message_by_email { Link Here
945
    my $is_html = $content_type =~ m/html/io;
945
    my $is_html = $content_type =~ m/html/io;
946
    my %sendmail_params = (
946
    my %sendmail_params = (
947
        To   => $to_address,
947
        To   => $to_address,
948
        From => $message->{'from_address'} || C4::Context->preference('KohaAdminEmailAddress'),
948
        From => $message->{'from_address'} || GetBranchDetail( $member->{'branchcode'} )->{'branchemail'} || C4::Context->preference('KohaAdminEmailAddress'),
949
        Subject => $subject,
949
        Subject => $subject,
950
        charset => 'utf8',
950
        charset => 'utf8',
951
        Message => $is_html ? _wrap_html($content, $subject) : $content,
951
        Message => $is_html ? _wrap_html($content, $subject) : $content,
952
- 

Return to bug 5544