Topic: PDF Attachments
Given this link :
<%= link_to "View PDF", agreement_path(:id => request, :format => "pdf") %>How would I link to the same within an email?
Last edited by CharlieB123 (2012-04-17 12:33:56)
You are not logged in. Please login or register.
Given this link :
<%= link_to "View PDF", agreement_path(:id => request, :format => "pdf") %>How would I link to the same within an email?
Last edited by CharlieB123 (2012-04-17 12:33:56)
First, you'd just have to go into whatever controller action agreement_path calls, and see where the actual file is that's getting sent back, say it's in public/a.pdf , then in a mailer:
def send_a_pdf
attachments['a.pdf'] = File.read('public/a.pdf')
mail(:to=>'customer@theirco.com',:from=>'someone@yourco.com',:subject=>"Here's your PDF")
endThis assumes your on Rails 3
Hosting provided by aTech Media