Skip to content

Instantly share code, notes, and snippets.

@queso
Created November 4, 2008 05:53
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 queso/22088 to your computer and use it in GitHub Desktop.
Save queso/22088 to your computer and use it in GitHub Desktop.
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