I have seen a lot of questions floating around on SO detailing how to display a PDF in the browser using prawn, but I want to create a PDF file to use as an attachment in an email.
Currently I am sending HTML formatted invoices to our merchants using the Rails ActionMailer. We have been requested to instead generate a PDF of the invoice and send that as an attachment so they can keep the files for their internal records.
I want to be able to use the same erb template I was using for sending emails (this is the crucial part) but instead output a PDF. Is this possible using Prawn (or anything else)?