Skip to content

Commit

Permalink
New: Prepare to be able to defined a bcc for each type of email sent
Browse files Browse the repository at this point in the history
from dolibarr.
  • Loading branch information
eldy committed Aug 5, 2014
1 parent c2be336 commit 9436b1d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
10 changes: 8 additions & 2 deletions htdocs/core/actions_sendmails.inc.php
Expand Up @@ -26,7 +26,8 @@

// $id must be defined
// $actiontypecode must be defined

// $paramname must be defined
// $mode must be defined

/*
* Add file in email form
Expand Down Expand Up @@ -115,6 +116,11 @@
$replyto = $_POST['replytoname']. ' <' . $_POST['replytomail'].'>';
$message = $_POST['message'];
$sendtocc = $_POST['sendtocc'];
$sendtobcc='';
if ($mode == 'emailfromproposal') $sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO);
if ($mode == 'emailfromorder') $sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO);
if ($mode == 'emailfrominvoice') $sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO);

$deliveryreceipt = $_POST['deliveryreceipt'];

if ($action == 'send' || $action == 'relance')
Expand All @@ -141,7 +147,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)
{
$mesgs[]='<div class="error">'.$mailfile->error.'</div>';
Expand Down
1 change: 1 addition & 0 deletions htdocs/societe/soc.php
Expand Up @@ -513,6 +513,7 @@
$id=$socid;
$actiontypecode='AC_OTH_AUTO';
$paramname='socid';
$mode='emailfromthirdparty';
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';


Expand Down

0 comments on commit 9436b1d

Please sign in to comment.