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

(-)a/C4/Letters.pm (+5 lines)
Lines 1471-1476 sub _send_message_by_email { Link Here
1471
      if !$message->{to_address}
1471
      if !$message->{to_address}
1472
      || $message->{to_address} ne $email->email->header('To');
1472
      || $message->{to_address} ne $email->email->header('To');
1473
1473
1474
    _update_message_from_address($message->{'message_id'},$email->email->header('From') )
1475
      if !$message->{from_address}
1476
      || $message->{from_address} ne $email->email->header('From');
1477
1478
1474
    try {
1479
    try {
1475
        $email->send_or_die({ transport => $smtp_server->transport });
1480
        $email->send_or_die({ transport => $smtp_server->transport });
1476
1481
(-)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 1425-1441 sub notice_email_address{ Link Here
1425
1425
1426
    my $use_guarantor = C4::Context->preference('RedirectGuaranteeEmail');
1426
    my $use_guarantor = C4::Context->preference('RedirectGuaranteeEmail');
1427
    if ($use_guarantor) {
1427
    if ($use_guarantor) {
1428
        my $guarantor = $self->guarantor;
1428
        my @guarantors = map { $_->guarantors->as_list } $self->guarantor_relationships();
1429
        if ($guarantor) {
1429
        if (@guarantors) {
1430
            if ( $which_address eq 'OFF' ) {
1430
            foreach my $guarantor (@guarantors) {
1431
                $guarantor_address = $guarantor->first_valid_email_address;
1431
                if ( $which_address eq 'OFF' ) {
1432
            } else {
1432
                    $guarantor_address = $guarantor->first_valid_email_address;
1433
                $guarantor_address = $guarantor->$which_address || '';
1433
                } else {
1434
            }
1434
                    $guarantor_address = $guarantor->$which_address || '';
1435
            if ($address){
1435
                }
1436
                $address .= ', ';
1436
                if ($address){
1437
            }
1437
                    $address .= ', ';
1438
                }
1438
                $address .=  $guarantor_address if $guarantor_address;
1439
                $address .=  $guarantor_address if $guarantor_address;
1440
            }
1439
        }
1441
        }
1440
    }
1442
    }
1441
    return $address;
1443
    return $address;
1442
- 

Return to bug 12532