Rafael
2010-Aug-30  14:19 UTC
prawnto question: how to attach a pdf (from a show action) in the mailer
Hi
I have vacancies, I want to recommend, and if wanted directly attache
as pdf.
You get the PDF with e.g. /vacancies/9887.pdf
How can I attach some thing in a mail?
Whats the best pratice here?
Sending through Rack?
Streaming / self calling HTTP URI and attach it?
I tried even to do something like this:
  # Forward via Email
  def forward
    render_to_string :action => "show"
    pdf = response.body
    @vacancy = Vacancy.find_by_vacancy_number(params[:vacancy_number])
    if NotificationMailer.recommendation(@vacancy, params[:email],
(params[:pdf] == ''true''), params).deliver
      flash[:notice] = ''The Job offer has been sent.''
    else
      flash[:notice] = ''The Job offer could not be sent''
    end
    redirect_to :action => :show, :id => params[:vacancy_number]
  end
Thanks for any clue!
-- 
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.