CRM-17548 - Thank-you e-mail fails to include message template subject
authorBarbara Miller <galgeek@users.noreply.github.com>
Thu, 12 Nov 2015 01:20:02 +0000 (17:20 -0800)
committerBarbara Miller <galgeek@users.noreply.github.com>
Thu, 12 Nov 2015 01:20:02 +0000 (17:20 -0800)
CRM-17548 - Thank-you e-mail fails to include message template subject, sends only default
https://issues.civicrm.org/jira/browse/CRM-17548

CRM/Contribute/Form/Task/PDFLetterCommon.php

index 9e36d0db2513fa96556fa4e286199c7a7217481a..69e252e733e1fc8d91c5f5273e208a1f27a6b1a2 100644 (file)
@@ -334,7 +334,6 @@ class CRM_Contribute_Form_Task_PDFLetterCommon extends CRM_Contact_Form_Task_PDF
       $defaults = array(
         'toName' => $contact['display_name'],
         'toEmail' => $contact['email'],
-        'subject' => ts('Thank you for your contribution/s'),
         'text' => '',
         'html' => $html,
       );
@@ -343,6 +342,12 @@ class CRM_Contribute_Form_Task_PDFLetterCommon extends CRM_Contact_Form_Task_PDF
         $emails = array_keys($emails);
         $defaults['from'] = array_pop($emails);
       }
+      if (!empty($params['subject'])) {
+        $defaults['subject'] => $params['subject'];
+      }
+      else {
+        $defaults['subject'] => ts('Thank you for your contribution/s');
+      }
       if ($is_pdf) {
         $defaults['html'] = ts('Please see attached');
         $defaults['attachments'] = array(CRM_Utils_Mail::appendPDF('ThankYou.pdf', $html, $format));