Skip to content

Instantly share code, notes, and snippets.

@djgraham
Created November 30, 2009 13:00
Show Gist options
  • Save djgraham/245431 to your computer and use it in GitHub Desktop.
Save djgraham/245431 to your computer and use it in GitHub Desktop.
class Notifier < ActionMailer::Base
def set_email_parameters(booking)
# set your global instance variables here that could be used in the email subject or body
end
def parse_subject(subject)
ERB.new(subject).result(binding)
end
def client_confirmation(booking, notes = nil, user = nil)
set_email_parameters(booking)
subject parse_subject( Settings.email_confirmation_to_client_subject + ' [Booking reference: ' + booking.reference.to_s + ']')
from Settings.client_email_from
(recipients booking.email) unless Settings.email_confirmation_to_client_to=="0"
(bcc admin_and_bc ) unless Settings.email_confirmation_to_client_cc == "0"
body :booking => booking, :notes=> notes, :property => booking.property, :current_user => user
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment