only create 'template' for plain text version if plain text has been submitted
authorMichael McAndrew <michaelmcandrew@thirdsectordesign.org>
Fri, 8 Dec 2017 11:54:31 +0000 (11:54 +0000)
committerMichael McAndrew <michaelmcandrew@thirdsectordesign.org>
Fri, 8 Dec 2017 11:54:31 +0000 (11:54 +0000)
CRM/Mailing/BAO/Mailing.php

index 27ca60dda604275aa07cdd6e33a0ed673f1e8a1b..361b7690c07e359c7446f5fa0ad930241612b6f0 100644 (file)
@@ -767,7 +767,7 @@ ORDER BY   {$orderBy}
     if (!$this->templates) {
       $this->getHeaderFooter();
       $this->templates = array();
-      if ($this->body_text || !empty($this->header)) {
+      if ($this->body_text) {
         $template = array();
         if (!empty($this->header->body_text)) {
           $template[] = $this->header->body_text;
@@ -776,12 +776,7 @@ ORDER BY   {$orderBy}
           $template[] = CRM_Utils_String::htmlToText($this->header->body_html);
         }
 
-        if ($this->body_text) {
-          $template[] = $this->body_text;
-        }
-        else {
-          $template[] = CRM_Utils_String::htmlToText($this->body_html);
-        }
+        $template[] = $this->body_text;
 
         if (!empty($this->footer->body_text)) {
           $template[] = $this->footer->body_text;