Sha256: ba2ad44b57f5b6d8630568f96efd82a548181b068edc2d1c9327dce282291d6f

Contents?: true

Size: 1.65 KB

Versions: 3

Compression:

Stored size: 1.65 KB

Contents

<style type="text/css" media="screen">
  #container {
    text-transform: uppercase;
  }
  table {
    border-collapse: collapse;
  }
  table, th, td {
    border: 1px solid #666;
    padding: 4px;
  }
</style>

<p>Hi <%= @alert.contact_first_name %></p>

<p>You have <%= @alert.rollup_alerts.length %> alerting check<%= @alert.rollup_alerts.length == 1 ? '' : 's' %> as follows:</p>

<table>
  <tbody>
    <tr>
      <th>Check</th>
      <th>Entity</th>
      <th>State</th>
      <th>Duration</th>
      <th>Summary</th>
    </tr>
<%  @alert.rollup_alerts.sort_by {|entity_check, details| details['duration'] }.each do |rollup_alert| -%>
<%    r_entity, r_check = rollup_alert[0].split(':', 2) -%>
<%    state    = rollup_alert[1]['state'] -%>
<%    duration = (ChronicDuration.output(rollup_alert[1]['duration'], :keep_zero => true) || '0 secs') -%>
<%    summary = rollup_alert[1]['summary'] -%>
      <tr>
        <td><%= r_check %></td>
        <td><%= r_entity %></td>
        <td><%= ['ok'].include?(state) ? state.upcase : state.titleize %></td>
        <td><%= duration %></td>
        <td><%= summary %></td>
      </tr>
<%    end %>
  </tbody>
</table>

<% if @alert.rollup == 'recovery' %>
  <p>As your email summary threshold is <%= @alert.rollup_threshold %>, we're taking your email alerts out of summary mode now. You'll now be emailed individually for each alerting check.</p>
<% else %>
  <p>Your email alerts are being summarised as your email summary threshold is set to <%= @alert.rollup_threshold %>. You'll receive summary emails like this one until your number of alerting checks falls below <%= @alert.rollup_threshold %>.</p>
<% end %>

<p>Cheers,<br/>
Flapjack</p>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
flapjack-1.6.0 lib/flapjack/gateways/email/rollup.html.erb
flapjack-1.6.0rc4 lib/flapjack/gateways/email/rollup.html.erb
flapjack-1.6.0rc3 lib/flapjack/gateways/email/rollup.html.erb