Commit eac38096ee7342a7863f0b97703718f035d70c14
1 parent
46aadb58
Exists in
master
and in
1 other branch
NotificationServices: adding a few newlines
Showing
3 changed files
with
26 additions
and
4 deletions
Show diff stats
app/models/notification_services/flowdock_service.rb
| ... | ... | @@ -21,10 +21,22 @@ if defined? Flowdock |
| 21 | 21 | end |
| 22 | 22 | |
| 23 | 23 | def create_notification(problem) |
| 24 | - flow = Flowdock::Flow.new(api_token: api_token, source: "Errbit", from: { name: "Errbit", address: ENV['ERRBIT_EMAIL_FROM'] || 'support@flowdock.com' }) | |
| 24 | + flow = Flowdock::Flow.new( | |
| 25 | + api_token: api_token, | |
| 26 | + source: "Errbit", | |
| 27 | + from: { | |
| 28 | + name: "Errbit", | |
| 29 | + address: ENV['ERRBIT_EMAIL_FROM'] || 'support@flowdock.com' | |
| 30 | + } | |
| 31 | + ) | |
| 25 | 32 | subject = "[#{problem.environment}] #{problem.message.to_s.truncate(100)}" |
| 26 | 33 | url = app_problem_url problem.app, problem |
| 27 | - flow.push_to_team_inbox(subject: subject, content: content(problem, url), project: project_name(problem), link: url) | |
| 34 | + flow.push_to_team_inbox( | |
| 35 | + subject: subject, | |
| 36 | + content: content(problem, url), | |
| 37 | + project: project_name(problem), | |
| 38 | + link: url | |
| 39 | + ) | |
| 28 | 40 | end |
| 29 | 41 | |
| 30 | 42 | private | ... | ... |
app/models/notification_services/slack_service.rb
| ... | ... | @@ -62,7 +62,13 @@ class NotificationServices::SlackService < NotificationService |
| 62 | 62 | end |
| 63 | 63 | |
| 64 | 64 | def create_notification(problem) |
| 65 | - HTTParty.post(service_url, body: post_payload(problem), headers: { 'Content-Type' => 'application/json' }) | |
| 65 | + HTTParty.post( | |
| 66 | + service_url, | |
| 67 | + body: post_payload(problem), | |
| 68 | + headers: { | |
| 69 | + 'Content-Type' => 'application/json' | |
| 70 | + } | |
| 71 | + ) | |
| 66 | 72 | end |
| 67 | 73 | |
| 68 | 74 | def configured? | ... | ... |
app/models/notification_services/webhook_service.rb
| ... | ... | @@ -14,7 +14,11 @@ class NotificationServices::WebhookService < NotificationService |
| 14 | 14 | end |
| 15 | 15 | |
| 16 | 16 | def message_for_webhook(problem) |
| 17 | - { problem: { url: problem_url(problem) }.merge(problem.as_json).to_json } | |
| 17 | + { | |
| 18 | + problem: { | |
| 19 | + url: problem_url(problem) | |
| 20 | + }.merge(problem.as_json).to_json | |
| 21 | + } | |
| 18 | 22 | end |
| 19 | 23 | |
| 20 | 24 | def create_notification(problem) | ... | ... |