Class: Ring::SQA::Alarm::Email

Inherits:
Object
  • Object
show all
Defined in:
lib/ring/sqa/alarm/email.rb

Constant Summary collapse

SERVER =
'localhost'

Instance Method Summary collapse

Instance Method Details

#send(opts) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/ring/sqa/alarm/email.rb', line 10

def send opts
  short, long = opts[:short], opts[:long]
  @from     = CFG.email.from
  @to       = [CFG.email.to].flatten
  prefix    = CFG.email.prefix? ? CFG.email.prefix : ''
  @subject  = prefix + short
  @reply_to = CFG.email.reply_to? ? CFG.email.reply_to : @from
  @body     = long
  send_email compose_email
rescue => error
  Log.error "Email raised '#{error.class}' with message '#{error.message}'"
end