Skip to content

Instantly share code, notes, and snippets.

@house9
Created December 16, 2012 16:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save house9/4309219 to your computer and use it in GitHub Desktop.
Save house9/4309219 to your computer and use it in GitHub Desktop.
class ExampleMailer < ActionMailer::Base
default from: "from@example.com"
# default layout for ExampleMailer
layout "customer_email"
# the order ready is sent to the customer and uses the default layout - customer_email
def order_ready
@greeting = "Hi"
mail to: "to@example.org"
end
# the ready to ship email is internal only - use the internal layout
def ready_to_ship
@greeting = "Hi Hi"
mail(to: "internal@example.org") do |format|
format.html { render :layout => "internal_email" }
format.text { render :layout => "internal_email" }
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment