Active
Project:
Postmark
Version:
8.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 May 2018 at 15:16 UTC
Updated:
6 Feb 2019 at 15:18 UTC
Jump to comment: Most recent
Problem/Motivation
Postmarks sends out the mails, but without respecting the line-breaks.
Line-breaks are automatically added after some signs (I think from postmark itself, because postmark gets no line-breaks delivered?)
Proposed resolution
I think there is some problem how postmarks gets the text it should send.
--
Also used mimemail https://www.drupal.org/project/mimemail in between (drupal > mimemail > postmark) but then extra header informations are also visible in the sent mail…
I use the latest d8 dev version installed via composer.
Any postmark setting I have missed?
thx
Nico
Comments
Comment #2
john.oltman commentedSee if setting $message['headers']['Content-Type'] to 'text/plain' helps.
Comment #3
vierlexI figured out a bit:
postmark/src/Plugin/Mail/PostmarkMail.php::118
If the $message already is formatted as plain/text,
this Html2Text will effectively destroy any "\n" line breaks.
I dont see how $message['plain'] is filled anywhere, except doing it manually in a hook_mail_alter()
(This is our Quickfix for now since we only need to send plain/text mails)
Also in the same class inside the format function at ::89
There is no format_filter inside the postmark.settings.yml nor is there a Interface for it.
I guess this is a good place to check if this email is html or plain/text and set the
$message['body'] and $message['plain'] accordingly. Either using that format_filter config setting
or using the $message['headers']['Content-Type']?
Question is where it is set anyway..
Also setting anything inside $message['headers'] are not passed along to the postmark client library.
Comment #4
steffenrMaybe we should add an alteration hook to the module. In this case, we can control the $postmark_message variable / mail created for Postmark service.