Created
November 4, 2008 05:53
-
-
Save queso/22088 to your computer and use it in GitHub Desktop.
This file contains 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 Mailer < ActionMailer::ARMailer | |
def setup_template(name, email) | |
site = SiteSetting.find(:first) | |
from site.admin_email.to_s | |
self.mailer_name = 'shared' | |
self.template = 'email' | |
options = { 'site' => site } | |
yield options if block_given? | |
email_template = EmailTemplate.find_by_name(name) | |
recipients "#{email}" | |
sent_on Time.now | |
subject "[#{site.name}] #{email_template.render_subject(options)}" | |
body :content => email_template.render_body(options) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment