Hi Friends! I have a controller action that can render the response in pdf format as well as html format. Now, I need to attach a pdf file rendered by the above action to an email on the fly. How can I do this? What is the the best practice? Many thanks!!!!! -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Rails Learner wrote:> Hi Friends! > > I have a controller action that can render the response in pdf format as > well as html format. > > Now, I need to attach a pdf file rendered by the above action to an > email on the fly. > How can I do this? > What is the the best practice?Not everything has an official "best practice". But if I were you, I wouldn''t do this. I don''t like getting large attachments. What I recommend instead is to send an e-mail message with the URL for the generated PDF file.> > Many thanks!!!!!-- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Marnen Laibow-Koser wrote:> Rails Learner wrote: > > I have a controller action that can render the response in pdf format as > > well as html format. > > > > Now, I need to attach a pdf file rendered by the above action to an > > email on the fly. > > How can I do this? > > What is the the best practice? > > Not everything has an official "best practice". But if I were you, I > wouldn''t do this. I don''t like getting large attachments. What I > recommend instead is to send an e-mail message with the URL for the > generated PDF file.+1 for that idea from me too. Not everyone reads mail in a "webmail" environment. If you pull your email on a small phone this is especially painful. The URL scheme let''s the user choose. Bob -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Thanks Everybody! I have figure out myself how to do this. I just passed the binary data of the PDF to the mailer and then create the attachment. Thanks again! -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.