# Prawnto question: how to attach a pdf (from a show action) in the mailer

**URL:** <https://www.ruby-forum.com/t/prawnto-question-how-to-attach-a-pdf-from-a-show-action-in-the-mailer/194108>\
**Category:** Rails\
**Created:** [August 30, 2010, 4:21pm UTC](https://www.ruby-forum.com/t/prawnto-question-how-to-attach-a-pdf-from-a-show-action-in-the-mailer/194108 "2010-08-30T16:21:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rafael](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/4da419/32.png) [@rafael](https://www.ruby-forum.com/u/rafael)\
**Post date:** [August 30, 2010, 4:21pm UTC](https://www.ruby-forum.com/t/prawnto-question-how-to-attach-a-pdf-from-a-show-action-in-the-mailer/194108/1 "2010-08-30T16:21:24Z")

</div>

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!
