Index: branches/5.2.x/core/units/helpers/email_message_helper.php =================================================================== diff -u -N -r15222 -r15225 --- branches/5.2.x/core/units/helpers/email_message_helper.php (.../email_message_helper.php) (revision 15222) +++ branches/5.2.x/core/units/helpers/email_message_helper.php (.../email_message_helper.php) (revision 15225) @@ -1,6 +1,6 @@ Application->InitParser(); - $ret = array_key_exists('Headers', $fields_hash) ? $fields_hash['Headers'] : ''; - if ($ret) { - $ret .= "\n"; + try { + $this->Application->Parser->CompileRaw($object->GetField($field), 'email_template'); } + catch (ParserException $e) { + if ( $this->Application->isDebugMode() ) { + $this->Application->Debugger->appendHTML('Error in Email Template: ' . $e->getMessage() . ' (line: ' . $e->getLine() . ')'); + } - $ret = $this->_removeTrailingCRLF($ret); - $ret .= 'Subject: ' . $fields_hash['Subject'] . "\n\n"; - $ret .= $fields_hash['Body']; - - return $ret; + $object->SetError($field, 'parsing_error'); + } } - - /** - * Remove trailing CR/LF chars from string - * - * @param string $string - * @return string - */ - function _removeTrailingCRLF($string) - { - return preg_replace('/(\n|\r)+/',"\\1",$string); - } } \ No newline at end of file