From 289a4cefe3426c63169ff341935c05c01383e3cd Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Wed, 3 Feb 2016 14:12:13 -0700 Subject: [PATCH] =?utf8?q?Revert=20"CRM-17908:=20text=20version=20of=20hea?= =?utf8?q?der/footer=20not=20used=20when=20auto-generatin=E2=80=A6"?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- CRM/Mailing/BAO/Mailing.php | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/CRM/Mailing/BAO/Mailing.php b/CRM/Mailing/BAO/Mailing.php index 607ef31f12..330bb9c8d9 100644 --- a/CRM/Mailing/BAO/Mailing.php +++ b/CRM/Mailing/BAO/Mailing.php @@ -758,28 +758,18 @@ ORDER BY i.contact_id, i.{$tempColumn} if (!$this->templates) { $this->getHeaderFooter(); $this->templates = array(); - if ($this->body_text || $this->header->body_text || $this->footer->body_text) { + + if ($this->body_text) { $template = array(); - if ($this->header->body_text) { + if ($this->header) { $template[] = $this->header->body_text; } - else { - $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 ($this->footer->body_text) { + if ($this->footer) { $template[] = $this->footer->body_text; } - else { - $template[] = CRM_Utils_String::htmlToText($this->footer->body_html); - } $this->templates['text'] = implode("\n", $template); } @@ -802,7 +792,7 @@ ORDER BY i.contact_id, i.{$tempColumn} // this is where we create a text template from the html template if the text template did not exist // this way we ensure that every recipient will receive an email even if the pref is set to text and the // user uploads an html email only - if (empty($this->templates['text'])) { + if (!$this->body_text) { $this->templates['text'] = CRM_Utils_String::htmlToText($this->templates['html']); } } -- 2.25.1