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

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

Return to bug 5544