Commit aeec71898bd3ecb604030887a382bb409b632da2

Authored by Nathan Broadbent
1 parent ad31635e
Exists in master and in 1 other branch production

Added HTML email template for deployment notifications.

app/views/layouts/mailer.html.haml
... ... @@ -40,6 +40,7 @@
40 40 }
41 41  
42 42 a.bold, span.bold { font-weight: bold; }
  43 + span.revision { color: #3a8d3a; }
43 44  
44 45 p { margin: 0 0 15px 0; }
45 46 p.heading {
... ...
app/views/mailer/deploy_notification.html.haml 0 → 100644
... ... @@ -0,0 +1,30 @@
  1 +%tr
  2 + %td.section
  3 + %table(cellpadding="0" cellspacing="0" border="0" align="left")
  4 + %tbody
  5 + %tr
  6 + %td.content(valign="top")
  7 + %div
  8 + %p
  9 + = link_to(@app.name, app_url(@app), :class => "bold")
  10 + was just deployed to
  11 + %span.bold= @deploy.environment
  12 + by
  13 + %span.bold= @deploy.username + "."
  14 +
  15 +%tr
  16 + %td.section
  17 + %table(cellpadding="0" cellspacing="0" border="0" align="left")
  18 + %tbody
  19 + %tr
  20 + %td.content(valign="top")
  21 + %div
  22 + %p.heading WHAT:
  23 + %p
  24 + - revision = @deploy.revision.present? ? content_tag(:span, "@#{@deploy.revision}", :class => "revision") : ""
  25 + = (@app.name + revision).html_safe
  26 + %p.heading WHEN:
  27 + %p= @deploy.created_at.to_s(:rfc822)
  28 + %p.heading REPOSITORY:
  29 + %p= @deploy.repository.blank? ? 'n/a' : link_to(nil, @deploy.repository)
  30 +
... ...
app/views/mailer/deploy_notification.text.erb
... ... @@ -2,7 +2,7 @@
2 2  
3 3 Details:
4 4  
5   - What: <%= @app.name %><%= "@#{@deploy.revision}" unless @deploy.revision.blank? %>
6   - When: <%= @deploy.created_at.to_s %>
7   - From: <%= @deploy.repository.blank? ? 'n/a' : @deploy.repository %>
  5 + What: <%= @app.name %><%= "@#{@deploy.revision}" unless @deploy.revision.blank? %>
  6 + When: <%= @deploy.created_at.to_s(:rfc822) %>
  7 + Repository: <%= @deploy.repository.blank? ? 'n/a' : @deploy.repository %>
8 8  
... ...