my $html = $::form->parse_html_template("common/_send_email_dialog", {
email_form => $email_form,
show_bcc => $::auth->assert('email_bcc', 'may fail'),
my $html = $::form->parse_html_template("common/_send_email_dialog", {
email_form => $email_form,
show_bcc => $::auth->assert('email_bcc', 'may fail'),
is_customer => $::form->{vc} eq 'customer',
is_invoice_mail => ($record_email && $::form->{type} eq 'invoice'),
ALL_EMPLOYEES => \@employees_with_email,
is_customer => $::form->{vc} eq 'customer',
is_invoice_mail => ($record_email && $::form->{type} eq 'invoice'),
ALL_EMPLOYEES => \@employees_with_email,
+
+ if ($email_form->{additional_to}) {
+ $email_form->{to} = join ', ', grep { $_ } $email_form->{to}, @{$email_form->{additional_to}};
+ delete $email_form->{additional_to};
+ }
+
my %field_names = (to => 'email');
$::form->{ $field_names{$_} // $_ } = $email_form->{$_} for keys %{ $email_form };
my %field_names = (to => 'email');
$::form->{ $field_names{$_} // $_ } = $email_form->{$_} for keys %{ $email_form };