mirror of
https://github.com/moparisthebest/mailcatcher
synced 2024-10-31 23:45:06 -04:00
17 lines
426 B
Ruby
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
|