Class: Lazylead::Task::ReporterAlert
- Inherits:
-
Object
- Object
- Lazylead::Task::ReporterAlert
- Defined in:
- lib/lazylead/task/alert.rb
Overview
A task that sends notifications about issues to their reporters.
The task supports the following features:
- fetch issues from remote ticketing system by query
- group all issues by reporter
- prepare email based on predefined template (*.erb)
- send the required notifications to each reporter
The email message is sending to the assignee regarding all his/her issues,
not like one email per each issue.
Instance Method Summary collapse
-
#initialize(log = Log::NOTHING) ⇒ ReporterAlert
constructor
A new instance of ReporterAlert.
- #run(sys, postman, opts) ⇒ Object
Constructor Details
#initialize(log = Log::NOTHING) ⇒ ReporterAlert
Returns a new instance of ReporterAlert.
92 93 94 |
# File 'lib/lazylead/task/alert.rb', line 92 def initialize(log = Log::NOTHING) @log = log end |
Instance Method Details
#run(sys, postman, opts) ⇒ Object
96 97 98 99 100 101 102 |
# File 'lib/lazylead/task/alert.rb', line 96 def run(sys, postman, opts) sys.issues(opts["sql"]) .group_by(&:reporter) .each do |a, t| postman.send opts.merge(to: a.email, addressee: a.name, tickets: t) end end |