Fixed adding of html attachment.
This commit is contained in:
parent
19488186f3
commit
e77034c177
1 changed files with 5 additions and 3 deletions
|
@ -41,12 +41,14 @@ class Channel::EmailParser
|
||||||
# html_part = message.html_part ? message.html_part.body.decoded : nil
|
# html_part = message.html_part ? message.html_part.body.decoded : nil
|
||||||
data[:attachments] = []
|
data[:attachments] = []
|
||||||
if mail.multipart?
|
if mail.multipart?
|
||||||
|
|
||||||
|
# text attachment
|
||||||
if mail.text_part
|
if mail.text_part
|
||||||
data[:plain_part] = mail.text_part.body.decoded
|
data[:plain_part] = mail.text_part.body.decoded
|
||||||
data[:plain_part] = conv( mail.text_part.charset, data[:plain_part] )
|
data[:plain_part] = conv( mail.text_part.charset, data[:plain_part] )
|
||||||
else
|
|
||||||
|
|
||||||
# html part
|
# html attachment
|
||||||
|
else
|
||||||
filename = '-no name-'
|
filename = '-no name-'
|
||||||
if mail.html_part.body
|
if mail.html_part.body
|
||||||
filename = 'html-email'
|
filename = 'html-email'
|
||||||
|
@ -68,7 +70,7 @@ class Channel::EmailParser
|
||||||
headers_store['Charset'] = mail.html_part.charset
|
headers_store['Charset'] = mail.html_part.charset
|
||||||
end
|
end
|
||||||
attachment = {
|
attachment = {
|
||||||
:data => mail.html_part.body,
|
:data => mail.html_part.body.to_s,
|
||||||
:filename => mail.html_part.filename || filename,
|
:filename => mail.html_part.filename || filename,
|
||||||
:preferences => headers_store
|
:preferences => headers_store
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue