Skip to content

Instantly share code, notes, and snippets.

@ryenski
Created January 7, 2010 16:23
Show Gist options
  • Save ryenski/271338 to your computer and use it in GitHub Desktop.
Save ryenski/271338 to your computer and use it in GitHub Desktop.
SystemNotifier.deliver_notification "My subject", "My optional message"
# app/mailers/system_mailer.rb
def notification(subject, message=nil)
@recipients = "sysadmin@example.com"
@from = "sysadmin@example.com"
@sent_on = Time.now
@subject = subject
@body[:message] = message
end
# app/mailers/system_mailer/notification.html.erb
<%= @message %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment