Commit d8be9605 authored by totten's avatar totten
Browse files

Cleanup extracted function

parent 9ea36c74
......@@ -64,21 +64,23 @@ function civicrm_api3_job_mosaico_msg_sync($params) {
}
/**
* @param $html
* @return mixed
* Filter the HTML content.
*
* @param string $html
* Template HTML, as generated by Mosaico.
* @return string
* Template HTML, as appropriate for MessageTemplates.
*/
function _civicrm_api3_job_mosaico_msg_filter($html) {
if (defined('CIVICRM_MAIL_SMARTY') && CIVICRM_MAIL_SMARTY == 1) {
// keep head section in literal to avoid smarty errors. Specially when CIVICRM_MAIL_SMARTY is turned on.
$html = str_ireplace(array('<head>', '</head>'),
array('{literal}<head>', '</head>{/literal}'), $html);
return $html;
}
elseif (defined('CIVICRM_MAIL_SMARTY') && CIVICRM_MAIL_SMARTY == 0) {
// get rid of any injected literal tags to avoid them appearing in emails
$html = str_ireplace(array('{literal}<head>', '</head>{/literal}'),
array('<head>', '</head>'), $html);
return $html;
}
return $html;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment