Initial commit
This commit is contained in:
28
bin/mailer
Normal file
28
bin/mailer
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
require File.expand_path('../../config/environment', __FILE__)
|
||||
|
||||
class Mailer
|
||||
extend GLI::App
|
||||
|
||||
program_desc 'Notification Hub'
|
||||
|
||||
flag :config, desc: 'Path to mailer config file', default_value: 'config/mailer.yml'
|
||||
|
||||
command :stop do |c|
|
||||
c.action do
|
||||
end
|
||||
end
|
||||
|
||||
command :run do |c|
|
||||
c.desc 'Run processing email events'
|
||||
c.action do |global_options, _options, _args|
|
||||
config = YAML.load_file(global_options[:config]).deep_symbolize_keys
|
||||
EventMailer.call(config[:events], config[:exchanges], config[:keychain])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
exit Mailer.run(ARGV)
|
||||
Reference in New Issue
Block a user