diff --git a/erp/erp_add_customer.php b/erp/erp_add_customer.php index defe67a..fa0be57 100644 --- a/erp/erp_add_customer.php +++ b/erp/erp_add_customer.php @@ -183,20 +183,22 @@ foreach ($ids_customer as $id_customer) { $target_emails[] = $representant_email; } - $mail = Mail::Send( - 1, - 'account', - Mail::l('Welcome!'), - array( - '{firstname}' => $customer->firstname, - '{lastname}' => $customer->lastname, - '{email}' => $customer->email, - '{passwd}' => $password_generate - ), - $target_emails, - $customer->firstname.' '.$customer->lastname - ); - + if (!defined('ERP_PREPROD') || !ERP_PREPROD) { + $mail = Mail::Send( + 1, + 'account', + Mail::l('Welcome!'), + array( + '{firstname}' => $customer->firstname, + '{lastname}' => $customer->lastname, + '{email}' => $customer->email, + '{passwd}' => $password_generate + ), + $target_emails, + $customer->firstname.' '.$customer->lastname + ); + } + foreach ($other_addresses as $key => $other_address) { //$other_address['phone'] = ($other_address['phone']) ? $other_address['phone'] : $record['phone']; if (isset($other_address['phone']) && !empty($other_address['phone'])) {