Skip to content

Instantly share code, notes, and snippets.

@jasonong
Created June 6, 2009 05:40
Show Gist options
  • Save jasonong/124709 to your computer and use it in GitHub Desktop.
Save jasonong/124709 to your computer and use it in GitHub Desktop.
class TestMailer
def load_settings(site)
options = YAML.load_file("#{RAILS_ROOT}/config/test.yml")[RAILS_ENV][site]
@@smtp_settings = {
:address => options["address"],
:port => options["port"],
:domain => options["domain"],
:authentication => options["authentication"],
:user_name => options["user_name"],
:password => options["password"]
}
@template = site
end
def welcome_email(recipient, site, sent_at = Time.now)
load_settings(site)
@subject = "Thank you for visiting #{site}"
@recipients = RAILS_ENV == "production" ? recipient : "cavneb@gmail.com"
@from = 'gary@superfriends.com'
@sent_on = sent_at
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment