didn''t try this myself, but use open-uri?
attachment :content_type => "image/jpeg",
:body => open("http://site.com/an-image.jpg").read
On May 20, 8:47 pm, Stewart
<stewart.mathe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Hey Guys,
>
> I wish to generate a PDF on the fly to attach to an email. I am using
> action mailer and I want to tell the action mailer to attach a PDF
> from a URL not a file. All of the examples I have seen attach the
> file to the email like so...
>
> attachment :content_type => "image/jpeg",
> :body => File.read("an-image.jpg")
>
> Is there anyway I can make it so that "an-image.jpg" is called
from a
> url on the localhost so something like "localhost/invoice.pdf".
This
> will fit in to my rails app as it generates a PDF using prawn and
> prawnto from that url.
>
> Thanks for any help