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') |