Created
June 6, 2009 05:40
-
-
Save jasonong/124709 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 : "[email protected]" | |
@from = '[email protected]' | |
@sent_on = sent_at | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment