I''m trying to use the new attachments feature in ActionMailer. It
works fine, but when I have attachments on a message it doesn''t add
the plain text message from my view. If I comment out my attachment
lines, the plain text appears.
Any ideas?
Here is the method in my ActionMailier class:
def trainer(class_session, list_pdf, handouts_pdf)
@subject = ''Upcoming Class''
@body = {:location => class_session.location, :date =>
class_session.date, :time => class_session.time}
@recipients = class_session.trainer.u_username
@from = ''webmaster-J0of1frlU80@public.gmane.org''
@sent_on = Time.now
@headers = {}
ActionMailer::Base.delivery_method = :sendmail
attachment :content_type => "application/pdf", :body =>
list_pdf.render, :filename => "Class_List.pdf"
attachment :content_type => "application/pdf", :body =>
handouts_pdf.render, :filename => "Handouts.pdf"
end
--
Ben Sinclair
ben-bgLzOLc97kcYkl5+HhvCNA@public.gmane.org
On Jul 8, 2005, at 10:42 AM, Ben Sinclair wrote:> I''m trying to use the new attachments feature in ActionMailer. It > works fine, but when I have attachments on a message it doesn''t add > the plain text message from my view. If I comment out my attachment > lines, the plain text appears. > > Any ideas?Sounds like a bug. Could you please submit a ticket to dev.rubyonrails.com about this? Thanks, Jamis
I''ll submit a ticket. Can you suggest any workarounds though? Before .13 I was creating my own TMail object and adding attachments manually. I then sent it using the deliver method. The deliver method doesn''t seem to exist in .13, so that no longer works. On 7/8/05, Jamis Buck <jamis-uHoyYlH2B+GakBO8gow8eQ@public.gmane.org> wrote:> On Jul 8, 2005, at 10:42 AM, Ben Sinclair wrote: > > > I''m trying to use the new attachments feature in ActionMailer. It > > works fine, but when I have attachments on a message it doesn''t add > > the plain text message from my view. If I comment out my attachment > > lines, the plain text appears. > > > > Any ideas? > > Sounds like a bug. Could you please submit a ticket to > dev.rubyonrails.com about this? > > Thanks, > > Jamis > >-- Ben Sinclair ben-bgLzOLc97kcYkl5+HhvCNA@public.gmane.org
I''m having the same problem, I was able to work around it by adding the
plain text message as a part
eg
part :content_type => "text/plain",
:body => render_message("bla")
Ben Sinclair wrote:
>I''ll submit a ticket. Can you suggest any workarounds though?
>
>Before .13 I was creating my own TMail object and adding attachments
>manually. I then sent it using the deliver method. The deliver method
>doesn''t seem to exist in .13, so that no longer works.
>
>
>
Ben Sinclair wrote:> Before .13 I was creating my own TMail object and adding attachments > manually. I then sent it using the deliver method. The deliver method > doesn''t seem to exist in .13, so that no longer works.That''s bad - 0.13 is supposed to be backwards compatible. Also, the deliver method is used in the Agile Web Development with Rails book (p406), and (as I understand it) everything shown there is supposed to still be valid in Rails 1.0. Justin