How do you do this?
Tried all the examples on the wiki, and unfortunately the trac is not
accessible right now to check the trouble tickets.
No matter what I do the mime structure seems to be incorrect.
It seems that adding an attachment to a html+plaintext message is not
possible using the standard methods. I have seen some old posting on the
mailing list about overriding the deliver method to add attachments
after creating the message.
Is this so? Does anyone have a working example?
Here is one of many contortions I have tried:
<pre>def answer(message, representative, sent_at = Time.now)
@subject = message.reply_subject
@recipients = message.sender.address
@from = message.team.reply_from_address
@sent_on = sent_at
@content_type = "multipart/alternative"
part "text/html" do |p|
p.body = render_message("answer_as_html", :message =>
message,
:signature => representative.signature)
end
part "text/plain" do |p|
p.body = render_message("answer_as_plain", :message =>
message,
:signature => representative.signature)
p.transfer_encoding = "base64"
end
attachment message.attachment.content_type do |a|
a.body = attachment.body
a.filename = attachment.filename
end
end</pre>
--
Posted via http://www.ruby-forum.com/.