Skip to content

Commit

Permalink
New: Can defined a bcc for each email type.
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Aug 5, 2014
1 parent 17aed0f commit 164c9e0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
3 changes: 2 additions & 1 deletion htdocs/comm/propal.php
Expand Up @@ -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']))
Expand All @@ -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 {
Expand Down
7 changes: 4 additions & 3 deletions htdocs/commande/fiche.php
Expand Up @@ -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');
Expand Down Expand Up @@ -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') {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 = '';
Expand Down
7 changes: 4 additions & 3 deletions htdocs/compta/facture.php
Expand Up @@ -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))
{
Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -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') {
Expand Down Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion htdocs/compta/facture/impayees.php
Expand Up @@ -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,
Expand Down Expand Up @@ -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.='<div class="error">'.$mailfile->error.'</div>';
Expand Down

0 comments on commit 164c9e0

Please sign in to comment.