From 164c9e0b750c129608c9a07ed6c9fdf89d5fa527 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 5 Aug 2014 09:28:58 +0200 Subject: [PATCH] New: Can defined a bcc for each email type. --- htdocs/comm/propal.php | 3 ++- htdocs/commande/fiche.php | 7 ++++--- htdocs/compta/facture.php | 7 ++++--- htdocs/compta/facture/impayees.php | 3 ++- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 486ca39c18e72..b1747ca066dad 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -565,6 +565,7 @@ $replyto = $_POST ['replytoname'] . ' <' . $_POST ['replytomail'] . '>'; $message = $_POST ['message']; $sendtocc = $_POST ['sendtocc']; + $sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO); $deliveryreceipt = $_POST ['deliveryreceipt']; if (dol_strlen($_POST ['subject'])) @@ -591,7 +592,7 @@ // Envoi de la propal require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; - $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, - 1); + $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, - 1); if ($mailfile->error) { setEventMessage($mailfile->error, 'errors'); } else { diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index a82eb5dda05f4..05429abbd7e1f 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -617,7 +617,7 @@ } } } - + // if price ht is forced (ie: calculated by margin rate and cost price) if (! empty($price_ht)) { $pu_ht = price2num($price_ht, 'MU'); @@ -1192,6 +1192,7 @@ $replyto = GETPOST('replytoname') . ' <' . GETPOST('replytomail') . '>'; $message = GETPOST('message'); $sendtocc = GETPOST('sendtocc'); + $sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO); $deliveryreceipt = GETPOST('deliveryreceipt'); if ($action == 'send') { @@ -1220,7 +1221,7 @@ // Send mail require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; - $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, - 1); + $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, - 1); if ($mailfile->error) { setEventMessage($mailfile->error, 'errors'); } else { @@ -2434,7 +2435,7 @@ include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; $fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref, preg_quote($ref, '/')); $file = $fileparams ['fullname']; - + // Define output language $outputlangs = $langs; $newlang = ''; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 056d51682344a..989f7f46abd2b 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1152,7 +1152,7 @@ $pu_ttc = $prod->price_ttc; $price_min = $prod->price_min; $price_base_type = $prod->price_base_type; - + // We define price for product if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->thirdparty->price_level)) { @@ -1181,7 +1181,7 @@ } } } - + // if price ht is forced (ie: calculated by margin rate and cost price) if (! empty($price_ht)) { $pu_ht = price2num($price_ht, 'MU'); @@ -1559,6 +1559,7 @@ $replyto = $_POST['replytoname'] . ' <' . $_POST['replytomail'] . '>'; $message = $_POST['message']; $sendtocc = $_POST['sendtocc']; + $sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO); $deliveryreceipt = $_POST['deliveryreceipt']; if ($action == 'send') { @@ -1601,7 +1602,7 @@ // Send mail require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; - $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, - 1); + $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, - 1); if ($mailfile->error) { setEventMessage($mailfile->error, 'errors'); } else { diff --git a/htdocs/compta/facture/impayees.php b/htdocs/compta/facture/impayees.php index b3d958708388f..99f3a0ba08230 100644 --- a/htdocs/compta/facture/impayees.php +++ b/htdocs/compta/facture/impayees.php @@ -121,6 +121,7 @@ $subject = GETPOST('subject'); $message = GETPOST('message'); $sendtocc = GETPOST('sentocc'); + $sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO); $substitutionarray=array( '__ID__' => $object->id, @@ -151,7 +152,7 @@ // Send mail require_once(DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'); - $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,'',$deliveryreceipt,-1); + $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1); if ($mailfile->error) { $resultmasssend.='
'.$mailfile->error.'
';