CRM-14049 allow on-hold email when retrieving details and pass contactId if exists
authorBrian Shaughnessy <brian@lcdservices.biz>
Mon, 6 Jan 2014 21:32:27 +0000 (16:32 -0500)
committerBrian Shaughnessy <brian@lcdservices.biz>
Mon, 6 Jan 2014 21:32:27 +0000 (16:32 -0500)
CRM/Mailing/Page/View.php

index 3581427a0661106bbeaa4b59f50e636a0407e51d..42cb594f20606b35ae414bcf035a4de95834d24e 100644 (file)
@@ -117,19 +117,21 @@ class CRM_Mailing_Page_View extends CRM_Core_Page {
     if (isset($this->_contactID)) {
       //get details of contact with token value including Custom Field Token Values.CRM-3734
       $returnProperties = $this->_mailing->getReturnProperties();
-      $params           = array('contact_id' => $this->_contactID);
-      $details          = CRM_Utils_Token::getTokenDetails($params,
+      $params = array('contact_id' => $this->_contactID);
+      $details = CRM_Utils_Token::getTokenDetails($params,
         $returnProperties,
-        TRUE, TRUE, NULL,
+        FALSE, TRUE, NULL,
         $this->_mailing->getFlattenedTokens(),
         get_class($this)
       );
       $details = $details[0][$this->_contactID];
+      $contactId = $this->_contactID;
     }
     else {
       $details = array('test');
+      $contactId = 0;
     }
-    $mime = &$this->_mailing->compose(NULL, NULL, NULL, 0,
+    $mime = &$this->_mailing->compose(NULL, NULL, NULL, $contactId,
       $this->_mailing->from_email,
       $this->_mailing->from_email,
       TRUE, $details, $attachments