Impossible to send HTML with plain text email

Created on 24 November 2021, about 3 years ago
Updated 17 May 2024, 7 months ago

Looking at the code from PostmarkMail.php and then PostmarkHandler.php, I don't see how it is possible to send an HTML email unless $message['plain'] = '';

In PostmarkMail.php we have this:

    if (isset($message['plain'])) {
      $postmark_message['text'] = $message['plain'];
    }
    else {
      $converter = new Html2Text($message['body']);
      $postmark_message['text'] = $converter->getText();
    }

This results in $messages['text'] always being set.

And then in PostmarkHandler.php we have this:

      $html = !empty($params['html']) && empty($params['text']) ? $params['html'] : NULL;
      $text = !empty($params['text']) ? $params['text'] : NULL;

This results in $html always being NULL unless $params['text'] is an empty string. Is this the intended behavior?

πŸ› Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States JaceRider

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024