You don't need paperclip to simply send an attachment with an email.
For example, I have a simple 'get appointed link' on my site, meaning a user wants to become appointed as an agent for our insurance wholesale operation. They fill out a simple form (contact name, agency name, email), and I send them an application form (pdf), to fill out. Here is what it looks like:
app/mailers/employee_mailer.rb:
def broker_apply(email,agency,contact)
attachments['NEEIS Broker Agreement.pdf'] = File.read('public/pdf/BrokerContract.pdf')
mail(:to=>email,:from=>'andee@neeis.com',:subject=>"NEEIS Broker Agreement")
end
Antibot is just what I call the email param, because spammers will look for a param named email and try and spam your site, so renaming email to antibot will help prevent bots from scanning your site, and trying to send your site bogus email.
Then in app/views/employee_mailer/broker_apply.html.erb:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Broker Appointment Application</title>
</head>
<body>
<p>
Thanks for your interest, attached is your application
</p>
</body>
To kick this all off, in the controller:
EmployeeMailer.broker_apply(params[:antibot],params[:agency],params[:contact]).deliver
I use antibot instead of email as a form name to prevent bots from scanning the site and sending spam.
Joe got a job, on the day shift, at the Utility Muffin Research Kitchen, arrogantly twisting the sterile canvas snout of a fully charged icing anointment utensil.