From aeec71898bd3ecb604030887a382bb409b632da2 Mon Sep 17 00:00:00 2001 From: Nathan Broadbent Date: Sun, 4 Sep 2011 02:02:27 +0800 Subject: [PATCH] Added HTML email template for deployment notifications. --- app/views/layouts/mailer.html.haml | 1 + app/views/mailer/deploy_notification.html.haml | 30 ++++++++++++++++++++++++++++++ app/views/mailer/deploy_notification.text.erb | 6 +++--- 3 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 app/views/mailer/deploy_notification.html.haml diff --git a/app/views/layouts/mailer.html.haml b/app/views/layouts/mailer.html.haml index ff010a8..dc4791e 100644 --- a/app/views/layouts/mailer.html.haml +++ b/app/views/layouts/mailer.html.haml @@ -40,6 +40,7 @@ } a.bold, span.bold { font-weight: bold; } + span.revision { color: #3a8d3a; } p { margin: 0 0 15px 0; } p.heading { diff --git a/app/views/mailer/deploy_notification.html.haml b/app/views/mailer/deploy_notification.html.haml new file mode 100644 index 0000000..59795e8 --- /dev/null +++ b/app/views/mailer/deploy_notification.html.haml @@ -0,0 +1,30 @@ +%tr + %td.section + %table(cellpadding="0" cellspacing="0" border="0" align="left") + %tbody + %tr + %td.content(valign="top") + %div + %p + = link_to(@app.name, app_url(@app), :class => "bold") + was just deployed to + %span.bold= @deploy.environment + by + %span.bold= @deploy.username + "." + +%tr + %td.section + %table(cellpadding="0" cellspacing="0" border="0" align="left") + %tbody + %tr + %td.content(valign="top") + %div + %p.heading WHAT: + %p + - revision = @deploy.revision.present? ? content_tag(:span, "@#{@deploy.revision}", :class => "revision") : "" + = (@app.name + revision).html_safe + %p.heading WHEN: + %p= @deploy.created_at.to_s(:rfc822) + %p.heading REPOSITORY: + %p= @deploy.repository.blank? ? 'n/a' : link_to(nil, @deploy.repository) + diff --git a/app/views/mailer/deploy_notification.text.erb b/app/views/mailer/deploy_notification.text.erb index 3cf93a0..fc75387 100644 --- a/app/views/mailer/deploy_notification.text.erb +++ b/app/views/mailer/deploy_notification.text.erb @@ -2,7 +2,7 @@ Details: - What: <%= @app.name %><%= "@#{@deploy.revision}" unless @deploy.revision.blank? %> - When: <%= @deploy.created_at.to_s %> - From: <%= @deploy.repository.blank? ? 'n/a' : @deploy.repository %> + What: <%= @app.name %><%= "@#{@deploy.revision}" unless @deploy.revision.blank? %> + When: <%= @deploy.created_at.to_s(:rfc822) %> + Repository: <%= @deploy.repository.blank? ? 'n/a' : @deploy.repository %> -- libgit2 0.21.2