Merge pull request #23172 from eileenmcnaughton/import_most
[civicrm-core.git] / CRM / Mailing / Page / Preview.php
index 4d7981481d4032ffd36b89b1ef16fde5afd0616a..565388b0231c3aa2f118b9b09503ca697f57ae32 100644 (file)
@@ -60,15 +60,15 @@ class CRM_Mailing_Page_Preview extends CRM_Core_Page {
     $returnProperties = $mailing->getReturnProperties();
     $params = ['contact_id' => $session->get('userID')];
 
-    $details = CRM_Utils_Token::getTokenDetails($params,
+    [$details] = CRM_Utils_Token::getTokenDetails($params,
       $returnProperties,
       TRUE, TRUE, NULL,
       $mailing->getFlattenedTokens(),
       get_class($this)
     );
-    // $details[0] is an array of [ contactID => contactDetails ]
+    // $details is an array of [ contactID => contactDetails ]
     $mime = &$mailing->compose(NULL, NULL, NULL, $session->get('userID'), $fromEmail, $fromEmail,
-      TRUE, $details[0][$session->get('userID')], $attachments
+      TRUE, $details[$session->get('userID')], $attachments
     );
 
     if ($type == 'html') {