Class: Lazylead::Task::Alert

Inherits:
Object
  • Object
show all
Defined in:
lib/lazylead/task/alert.rb

Overview

Notify particular person about tickets based on pre-defined html template.

The task supports the following features:

- fetch issues from remote ticketing system by query
- prepare email based on predefined template (*.erb)
- send the required notifications pre-defined "addressee".

Instance Method Summary collapse

Constructor Details

#initialize(log = Log.new) ⇒ Alert

Returns a new instance of Alert.



47
48
49
# File 'lib/lazylead/task/alert.rb', line 47

def initialize(log = Log.new)
  @log = log
end

Instance Method Details

#run(sys, postman, opts) ⇒ Object



51
52
53
54
# File 'lib/lazylead/task/alert.rb', line 51

def run(sys, postman, opts)
  tickets = sys.issues(opts["sql"], opts.jira_defaults)
  postman.send opts.merge(tickets: tickets) unless tickets.empty?
end