Class: MailToHipChat::MessageChutes::TestEmail

Inherits:
Object
  • Object
show all
Includes:
MailToHipChat::MessageChute
Defined in:
lib/mail_to_hip_chat/message_chutes/test_email.rb

Overview

Takes a test email and sends it to the configured HipChat rooms, to verify a deployment based on this library is working.

Instance Method Summary collapse

Methods included from MailToHipChat::MessageChute

#initialize_hipchat_opts

Constructor Details

#initialize(opts) ⇒ TestEmail

Returns a new instance of TestEmail.



11
12
13
# File 'lib/mail_to_hip_chat/message_chutes/test_email.rb', line 11

def initialize(opts)
  initialize_hipchat_opts(opts)
end

Instance Method Details

#call(params) ⇒ Object



15
16
17
18
19
20
# File 'lib/mail_to_hip_chat/message_chutes/test_email.rb', line 15

def call(params)
  return false unless params["subject"] =~ /testing setup/i
  message = Mustache.render("Message:<br />{{message}}", :message => params["plain"])
  message_rooms("Testing", message)
  true
end