Fix mail merge into mail template excluded BCC

This commit is contained in:
nathangray 2018-04-20 12:00:30 -06:00
parent fa2403f905
commit 48239f3506
2 changed files with 6 additions and 1 deletions

View File

@ -7011,10 +7011,14 @@ class Mail
// Parse destinations for placeholders
foreach(Mailer::$type2header as $type => $h)
{
$merged = $bo_merge->merge_string($mailObject->getHeader(Mailer::$type2header[$type]),$val,$e,'text/plain',array(),self::$displayCharset);
$header = $mailObject->getHeader(Mailer::$type2header[$type]);
if(is_array($header)) $header = implode(', ',$header);
$mailObject->clearAddresses($type);
$merged = $bo_merge->merge_string($header,$val,$e,'text/plain',array(),self::$displayCharset);
//error_log($type . ': ' . $mailObject->getHeader(Mailer::$type2header[$type]) . ' -> ' .$merged);
$mailObject->addAddress(trim($merged,'"'),'',$type);
}
$mailObject->forceBccHeader();
// No addresses from placeholders? Treat it as just a contact ID
if (count($mailObject->getAddresses('to',true)) == 0 &&

View File

@ -763,6 +763,7 @@ class Mailer extends Horde_Mime_Mail
*/
function getHeader($header)
{
if(strtolower($header) === 'bcc') return $this->bcc->addresses;
return $this->_headers ? $this->_headers->getValue($header) : null;
}