Open LetThereBeDwight opened 2 hours ago
The correct code should be:
message
|> Mail.Message.put_content_type(["text/html", {"charset", "UTF-8"}])
The correct code should be:
message |> Mail.Message.put_content_type(["text/html", {"charset", "UTF-8"}])
That results in a different content-type spec for the Mail object - my example is mimicking an RFC2822 email that comes in with a specification like this:
To: user@example.com
From: me@example.com
Reply-To: otherme@example.com
Subject: Test Email
Content-Type: text/html; charset=UTF-8;
<h1>SOME HTML</h1>
The fact that it's coming via RFC2822 isn't actually relevant(the parser is working fine) so I boiled it down to a totally possible and valid content-type and found the issue in the underlying with undermatching valid specs on get_html
-> this also aligns the get_text
matches on content-type as an added bonus as they should be the same outside of the actual content-type part.
Version
0.4.0
Test Case
Steps to reproduce
Run the test
Expected Behavior
That mail.get_html returns the message in the above case
Actual Behavior
Nil because no match