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

(-)a/C4/Letters.pm (+5 lines)
Lines 1447-1452 sub _send_message_by_email { Link Here
1447
      if !$message->{to_address}
1447
      if !$message->{to_address}
1448
      || $message->{to_address} ne $email->email->header('To');
1448
      || $message->{to_address} ne $email->email->header('To');
1449
1449
1450
    _update_message_from_address($message->{'message_id'},$email->email->header('From') )
1451
      if !$message->{from_address}
1452
      || $message->{from_address} ne $email->email->header('From');
1453
1454
1450
    try {
1455
    try {
1451
        $email->send_or_die({ transport => $smtp_server->transport });
1456
        $email->send_or_die({ transport => $smtp_server->transport });
1452
1457
(-)a/Koha/Email.pm (-5 / +12 lines)
Lines 118-128 sub create { Link Here
118
        $args->{to} = $params->{to};
118
        $args->{to} = $params->{to};
119
    }
119
    }
120
120
121
    Koha::Exceptions::BadParameter->throw(
121
    #    Koha::Exceptions::BadParameter->throw(
122
        error     => "Invalid 'to' parameter: " . $args->{to},
122
    #        error     => "Invalid 'to' parameter: " . $args->{to},
123
        parameter => 'to'
123
    #        parameter => 'to'
124
    ) unless Koha::Email->is_valid( $args->{to} );    # to is mandatory
124
    #    ) unless Koha::Email->is_valid( $args->{to} );    # to is mandatory
125
125
    my @emails = split(',', $args->{to});
126
    foreach my $email (@emails) {
127
       $email =~ s/ //g;
128
       Koha::Exceptions::BadParameter->throw(
129
           error     => "Invalid 'to' parameter: ".$email,
130
	   parameter => 'to'
131
       ) unless Koha::Email->is_valid($email);
132
    }
126
    my $addresses = {};
133
    my $addresses = {};
127
    $addresses->{reply_to} = $params->{reply_to};
134
    $addresses->{reply_to} = $params->{reply_to};
128
    $addresses->{reply_to} ||= C4::Context->preference('ReplytoDefault')
135
    $addresses->{reply_to} ||= C4::Context->preference('ReplytoDefault')
(-)a/Koha/Patron.pm (-11 / +12 lines)
Lines 1412-1428 sub notice_email_address{ Link Here
1412
1412
1413
    my $use_guarantor = C4::Context->preference('RedirectGuaranteeEmail');
1413
    my $use_guarantor = C4::Context->preference('RedirectGuaranteeEmail');
1414
    if ($use_guarantor) {
1414
    if ($use_guarantor) {
1415
        my $guarantor = $self->guarantor;
1415
        my @guarantors = map { $_->guarantors->as_list } $self->guarantor_relationships();
1416
        if ($guarantor) {
1416
        if (@guarantors) {
1417
            if ( $which_address eq 'OFF' ) {
1417
            foreach my $guarantor (@guarantors) {
1418
                $guarantor_address = $guarantor->first_valid_email_address;
1418
                if ( $which_address eq 'OFF' ) {
1419
            } else {
1419
                    $guarantor_address = $guarantor->first_valid_email_address;
1420
                $guarantor_address = $guarantor->$which_address || '';
1420
                } else {
1421
            }
1421
                    $guarantor_address = $guarantor->$which_address || '';
1422
            if ($address){
1422
                }
1423
                $address .= ', ';
1423
                if ($address){
1424
            }
1424
                    $address .= ', ';
1425
                }
1425
                $address .=  $guarantor_address if $guarantor_address;
1426
                $address .=  $guarantor_address if $guarantor_address;
1427
            }
1426
        }
1428
        }
1427
    }
1429
    }
1428
    return $address;
1430
    return $address;
1429
- 

Return to bug 12532