Skip to content

Commit

Permalink
Merge pull request #558 from hiroakis/enhanced_mailer_handler
Browse files Browse the repository at this point in the history
embed admin gui url into mail body
  • Loading branch information
kalabiyau committed Apr 23, 2014
2 parents 83d6d9f + 69b7d5b commit 25f9476
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions handlers/notification/mailer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"mailer": {
"admin_gui": "http://admin.example.com:8080/",
"mail_from": "[email protected]",
"mail_to": "[email protected]",
"smtp_address": "smtp.example.org",
Expand Down
2 changes: 2 additions & 0 deletions handlers/notification/mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def action_to_string
end

def handle
admin_gui = settings['mailer']['admin_gui'] || 'http://localhost:8080/'
mail_to = settings['mailer']['mail_to']
mail_from = settings['mailer']['mail_from']

Expand All @@ -53,6 +54,7 @@ def handle
playbook = "Playbook: #{@event['check']['playbook']}" if @event['check']['playbook']
body = <<-BODY.gsub(/^\s+/, '')
#{@event['check']['output']}
Admin GUI: #{admin_gui}
Host: #{@event['client']['name']}
Timestamp: #{Time.at(@event['check']['issued'])}
Address: #{@event['client']['address']}
Expand Down

0 comments on commit 25f9476

Please sign in to comment.