Feature #8462 ยป email.patch
| app/models/mail_handler.new.rb 2014-06-16 08:27:02.067372711 +0200 | ||
|---|---|---|
|
:content_type => attachment.mime_type)
|
||
|
end
|
||
|
end
|
||
|
if (parts = email.all_parts.select {|p| p.mime_type == 'text/html'}).present?
|
||
|
html_parts = parts.map do |p|
|
||
|
body_charset = p.charset.respond_to?(:force_encoding) ?
|
||
|
Mail::RubyVer.pick_encoding(p.charset).to_s : p.charset
|
||
|
Redmine::CodesetUtil.to_utf8(p.body.decoded, body_charset)
|
||
|
end.join("</hr>")
|
||
|
obj.attachments << Attachment.create(:container => obj,
|
||
|
:file => html_parts,
|
||
|
:filename => 'HTML version',
|
||
|
:author => user,
|
||
|
:content_type => 'text/html')
|
||
|
end
|
||
|
end
|
||
|
# Returns false if the +attachment+ of the incoming email should be ignored
|
||