diff --git a/library/NotificationCenter/Gateway/Email.php b/library/NotificationCenter/Gateway/Email.php index 52632d69..a2c17203 100644 --- a/library/NotificationCenter/Gateway/Email.php +++ b/library/NotificationCenter/Gateway/Email.php @@ -91,7 +91,12 @@ public function sendDraft(EmailMessageDraft $objDraft) // Set reply-to address if ($strReplyTo = $objDraft->getReplyToEmail()) { - $objEmail->replyTo($strReplyTo); + try { + $objEmail->replyTo($strReplyTo); + } catch (\Exception $e) { + \System::log(sprintf('Could not send email for message ID %s: %s', $objDraft->getMessage()->id, $e->getMessage()), __METHOD__, TL_ERROR); + return false; + } } // Set email subject diff --git a/library/NotificationCenter/Util/StringUtil.php b/library/NotificationCenter/Util/StringUtil.php index a7a565e7..972e7a15 100644 --- a/library/NotificationCenter/Util/StringUtil.php +++ b/library/NotificationCenter/Util/StringUtil.php @@ -73,11 +73,7 @@ public static function getTokenAttachments($strAttachmentTokens, array $arrToken } foreach (trimsplit(',', $strAttachmentTokens) as $strToken) { - if (version_compare(VERSION . '.' . BUILD, '3.5.1', '<')) { - $strParsedToken = \String::parseSimpleTokens($strToken, $arrTokens); - } else { - $strParsedToken = \StringUtil::parseSimpleTokens($strToken, $arrTokens); - } + $strParsedToken = \Haste\Util\StringUtil::recursiveReplaceTokensAndTags($strToken, $arrTokens); foreach (trimsplit(',', $strParsedToken) as $strFile) { $strFileFull = TL_ROOT . '/' . $strFile;