Skip to content

Instantly share code, notes, and snippets.

@gertig
Created November 22, 2010 17:27
Show Gist options
  • Save gertig/710294 to your computer and use it in GitHub Desktop.
Save gertig/710294 to your computer and use it in GitHub Desktop.
class NewMailer < ActionMailer::Base
default :from => "sendersemail@gmail.com"
require "net/http"
def registration_confirmation(person, thepage, email)
@person = person #Mailers are similar to Controllers as instance variables are passed to the View layer
@thepage = thepage
attachments["rails.png"] = File.read("#{Rails.root}/public/images/rails.png") #Used to test attachments, remove in production
attachments["#{thepage.id}.pdf"] = {:content => email }
mail(:to => "#{person.name} <#{person.email}>", :subject => "You Are Registered")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment