Add a keep emails flag (default true), set to false to skip saving merged emails to sent folder

This commit is contained in:
nathangray 2018-10-01 11:16:17 -06:00
parent 20629e2a16
commit f2cfd94391

View File

@ -107,6 +107,14 @@ abstract class Merge
*/
public $report_memory_usage = false;
/**
* Save sent emails. Used when merge template is an email. Default is true,
* to save sent emails in your sent folder.
*
* @var boolean
*/
public $keep_emails = true;
/**
* Constructor
*/
@ -1656,7 +1664,7 @@ abstract class Merge
$mail_bo->openConnection();
try
{
$msgs = $mail_bo->importMessageToMergeAndSend($this, $content_url, $ids, $_folder='');
$msgs = $mail_bo->importMessageToMergeAndSend($this, $content_url, $ids, $_folder=($this->keep_emails ? '' : FALSE));
}
catch (Api\Exception\WrongUserinput $e)
{