From 3f32bb8bc4ecd09d607ecbeca05314577290a276 Mon Sep 17 00:00:00 2001 From: Dave Greenberg Date: Mon, 16 Sep 2013 14:35:03 -0700 Subject: [PATCH] CRM-13407 - Conditionally add HTML markup for HEAD and TITLE if not present, using mailing subject ---------------------------------------- * CRM-13407: View CiviMail Mailings - page should include an HTML title if one isn't provided in the message body http://issues.civicrm.org/jira/browse/CRM-13407 --- CRM/Mailing/Page/View.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CRM/Mailing/Page/View.php b/CRM/Mailing/Page/View.php index 59305426d2..352304f3ea 100644 --- a/CRM/Mailing/Page/View.php +++ b/CRM/Mailing/Page/View.php @@ -135,9 +135,14 @@ class CRM_Mailing_Page_View extends CRM_Core_Page { TRUE, $details, $attachments ); + $title = NULL; if (isset($this->_mailing->body_html)) { + $header = 'Content-Type: text/html; charset=utf-8'; $content = $mime->getHTMLBody(); + if (strpos($content, '') === FALSE && strpos($content, '') === FALSE) { + $title = '<head><title>' . $this->_mailing->subject . ''; + } } else { $header = 'Content-Type: text/plain; charset=utf-8'; @@ -146,6 +151,7 @@ class CRM_Mailing_Page_View extends CRM_Core_Page { if ($print) { header($header); + print $title; print $content; CRM_Utils_System::civiExit(); } -- 2.25.1