New: Can defined a bcc for each email type.

This commit is contained in:
Laurent Destailleur 2014-08-05 09:28:58 +02:00
parent 17aed0f360
commit 164c9e0b75
4 changed files with 12 additions and 8 deletions

View File

@ -565,6 +565,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
$replyto = $_POST ['replytoname'] . ' <' . $_POST ['replytomail'] . '>'; $replyto = $_POST ['replytoname'] . ' <' . $_POST ['replytomail'] . '>';
$message = $_POST ['message']; $message = $_POST ['message'];
$sendtocc = $_POST ['sendtocc']; $sendtocc = $_POST ['sendtocc'];
$sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO);
$deliveryreceipt = $_POST ['deliveryreceipt']; $deliveryreceipt = $_POST ['deliveryreceipt'];
if (dol_strlen($_POST ['subject'])) if (dol_strlen($_POST ['subject']))
@ -591,7 +592,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
// Envoi de la propal // Envoi de la propal
require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; 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) { if ($mailfile->error) {
setEventMessage($mailfile->error, 'errors'); setEventMessage($mailfile->error, 'errors');
} else { } else {

View File

@ -617,7 +617,7 @@ else if ($action == 'addline' && $user->rights->commande->creer) {
} }
} }
} }
// if price ht is forced (ie: calculated by margin rate and cost price) // if price ht is forced (ie: calculated by margin rate and cost price)
if (! empty($price_ht)) { if (! empty($price_ht)) {
$pu_ht = price2num($price_ht, 'MU'); $pu_ht = price2num($price_ht, 'MU');
@ -1192,6 +1192,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
$replyto = GETPOST('replytoname') . ' <' . GETPOST('replytomail') . '>'; $replyto = GETPOST('replytoname') . ' <' . GETPOST('replytomail') . '>';
$message = GETPOST('message'); $message = GETPOST('message');
$sendtocc = GETPOST('sendtocc'); $sendtocc = GETPOST('sendtocc');
$sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO);
$deliveryreceipt = GETPOST('deliveryreceipt'); $deliveryreceipt = GETPOST('deliveryreceipt');
if ($action == 'send') { if ($action == 'send') {
@ -1220,7 +1221,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
// Send mail // Send mail
require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; 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) { if ($mailfile->error) {
setEventMessage($mailfile->error, 'errors'); setEventMessage($mailfile->error, 'errors');
} else { } else {
@ -2434,7 +2435,7 @@ if ($action == 'create' && $user->rights->commande->creer) {
include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
$fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref, preg_quote($ref, '/')); $fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref, preg_quote($ref, '/'));
$file = $fileparams ['fullname']; $file = $fileparams ['fullname'];
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';

View File

@ -1152,7 +1152,7 @@ else if ($action == 'addline' && $user->rights->facture->creer)
$pu_ttc = $prod->price_ttc; $pu_ttc = $prod->price_ttc;
$price_min = $prod->price_min; $price_min = $prod->price_min;
$price_base_type = $prod->price_base_type; $price_base_type = $prod->price_base_type;
// We define price for product // We define price for product
if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->thirdparty->price_level)) if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->thirdparty->price_level))
{ {
@ -1181,7 +1181,7 @@ else if ($action == 'addline' && $user->rights->facture->creer)
} }
} }
} }
// if price ht is forced (ie: calculated by margin rate and cost price) // if price ht is forced (ie: calculated by margin rate and cost price)
if (! empty($price_ht)) { if (! empty($price_ht)) {
$pu_ht = price2num($price_ht, 'MU'); $pu_ht = price2num($price_ht, 'MU');
@ -1559,6 +1559,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
$replyto = $_POST['replytoname'] . ' <' . $_POST['replytomail'] . '>'; $replyto = $_POST['replytoname'] . ' <' . $_POST['replytomail'] . '>';
$message = $_POST['message']; $message = $_POST['message'];
$sendtocc = $_POST['sendtocc']; $sendtocc = $_POST['sendtocc'];
$sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO);
$deliveryreceipt = $_POST['deliveryreceipt']; $deliveryreceipt = $_POST['deliveryreceipt'];
if ($action == 'send') { if ($action == 'send') {
@ -1601,7 +1602,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
// Send mail // Send mail
require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; 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) { if ($mailfile->error) {
setEventMessage($mailfile->error, 'errors'); setEventMessage($mailfile->error, 'errors');
} else { } else {

View File

@ -121,6 +121,7 @@ if ($action == 'presend' && GETPOST('sendmail'))
$subject = GETPOST('subject'); $subject = GETPOST('subject');
$message = GETPOST('message'); $message = GETPOST('message');
$sendtocc = GETPOST('sentocc'); $sendtocc = GETPOST('sentocc');
$sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO);
$substitutionarray=array( $substitutionarray=array(
'__ID__' => $object->id, '__ID__' => $object->id,
@ -151,7 +152,7 @@ if ($action == 'presend' && GETPOST('sendmail'))
// Send mail // Send mail
require_once(DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'); 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) if ($mailfile->error)
{ {
$resultmasssend.='<div class="error">'.$mailfile->error.'</div>'; $resultmasssend.='<div class="error">'.$mailfile->error.'</div>';