mailcatcher/lib/mail_catcher/growl.rb
2014-03-17 16:31:05 +11:00

17 lines
426 B
Ruby

require "mail_catcher/events"
module MailCatcher
module Growl extend self
def start
MailCatcher::Events::MessageAdded.subscribe(method(:notify))
end
def notify message
system "growlnotify",
"--image", File.expand_path(File.join(__FILE__, "../public/images/logo_large.png")),
"--name", "MailCatcher",
"--message", "Message received:\n#{message["subject"]}"
end
end
end