We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3f3d3e7 commit a6bbb1eCopy full SHA for a6bbb1e
app/mailboxes/newsletter_mailbox.rb
@@ -23,12 +23,10 @@ def process
23
private
24
def extract_content
25
html_part = mail.parts.find { |part| part.content_type.include?("text/html") }
26
+ body = html_part.present? ? html_part.body.decoded : mail.body.decoded
27
+ encoded_body = body.force_encoding("UTF-8")
28
- if html_part.present?
- format_html(html_part.body&.decoded)
29
- else
30
- mail.body.decoded
31
- end
+ html_part.present? ? format_html(encoded_body) : encoded_body
32
end
33
34
def format_html(html)
0 commit comments