Remove preferred_mail_format handling from legacy mailing
authorEileen McNaughton <emcnaughton@wikimedia.org>
Tue, 24 May 2022 22:07:28 +0000 (10:07 +1200)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Wed, 25 May 2022 01:37:22 +0000 (13:37 +1200)
CRM/Mailing/BAO/Mailing.php

index 83ddc6dad59b48c9958eecef7970609df8416c4e..ef136a218b9c4bb7aef70dd41f5f74c5942d482f 100644 (file)
@@ -1163,11 +1163,7 @@ ORDER BY   civicrm_email.is_bulkmail DESC
     }
 
     $mailParams = $headers;
-    if ($text && ($test || $contact['preferred_mail_format'] == 'Text' ||
-        $contact['preferred_mail_format'] == 'Both' ||
-        ($contact['preferred_mail_format'] == 'HTML' && !array_key_exists('html', $pEmails))
-      )
-    ) {
+    if ($text) {
       $textBody = implode('', $text);
       if ($useSmarty) {
         $textBody = $smarty->fetch("string:$textBody");
@@ -1175,10 +1171,7 @@ ORDER BY   civicrm_email.is_bulkmail DESC
       $mailParams['text'] = $textBody;
     }
 
-    if ($html && ($test || ($contact['preferred_mail_format'] == 'HTML' ||
-          $contact['preferred_mail_format'] == 'Both'
-        ))
-    ) {
+    if ($html) {
       $htmlBody = implode('', $html);
       if ($useSmarty) {
         $htmlBody = $smarty->fetch("string:$htmlBody");