my $existing_contact = '';
my @contact_emails = ();
my %contact_nums = ();
- $contact_nums{$self->contactnum} = '1' if $self->contactnum;
if ( $self->get('emailaddress') =~ /\S/ ) {
return $error;
}
+ $contact_nums{$self->contactnum} = '1' if $self->contactnum;
+
my $cust_contact = '';
# if $self->custnum was set, then the customer-specific properties
# (custnum, classnum, invoice_dest, selfservice_access, comment) are in
}
+ ## were all emails duplicates? if so reset original emails
+ if (scalar @contact_emails < 1 && scalar (keys %contact_nums) > 1) {
+ foreach (qsearch('contact_email', {'contactnum' => $self->contactnum})) {
+ push @contact_emails, $_->emailaddress;
+ }
+ }
+
my $emails = join(' , ', @contact_emails);
$self->emailaddress($emails);