From 38d1c211186999127131c38666437353a6d7e074 Mon Sep 17 00:00:00 2001 From: Yuki Date: Thu, 23 Jul 2015 11:50:21 +0530 Subject: [PATCH 1/2] Someone wanted even paddings, here you go. also made the support more wide. --- .../confirmation_instructions.html.haml | 6 +-- .../reset_password_instructions.html.haml | 10 ++--- .../mailer/unlock_instructions.html.haml | 8 ++-- app/views/layouts/mail.html.haml | 37 +++++++++++++++---- 4 files changed, 41 insertions(+), 20 deletions(-) diff --git a/app/views/devise/mailer/confirmation_instructions.html.haml b/app/views/devise/mailer/confirmation_instructions.html.haml index 00035a8f..c6632c65 100644 --- a/app/views/devise/mailer/confirmation_instructions.html.haml +++ b/app/views/devise/mailer/confirmation_instructions.html.haml @@ -1,8 +1,8 @@ -%p +%p{style: "margin:0px;padding:0px"} Welcome to = succeed ',' do = APP_CONFIG['site_name'] = succeed '!' do = @resource.screen_name -%p You can confirm your account email through the link below: -%p= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token, protocol: (APP_CONFIG['https'] ? :https : :http)) +%p{style: "margin:0px;padding:0px"} You can confirm your account email through the link below: +%p{style: "margin:0px;padding:0px"}= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token, protocol: (APP_CONFIG['https'] ? :https : :http)) diff --git a/app/views/devise/mailer/reset_password_instructions.html.haml b/app/views/devise/mailer/reset_password_instructions.html.haml index 39515aab..9013ea51 100644 --- a/app/views/devise/mailer/reset_password_instructions.html.haml +++ b/app/views/devise/mailer/reset_password_instructions.html.haml @@ -1,8 +1,8 @@ -%p +%p{style: "margin:0px;padding:0px"} Hello = succeed '!' = @resource.screen_name -%p Someone (hopefully you) has requested a link to change your password. You can do this through the link below. -%p= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token, protocol: (APP_CONFIG['https'] ? :https : :http)) -%p If you didn't request this, please ignore this email. -%p Your password won't change until you access the link above and create a new one. +%p{style: "margin:0px;padding:0px"} Someone (hopefully you) has requested a link to change your password. You can do this through the link below. +%p{style: "margin:0px;padding:0px"}= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token, protocol: (APP_CONFIG['https'] ? :https : :http)) +%p{style: "margin:0px;padding:0px"} If you didn't request this, please ignore this email. +%p{style: "margin:0px;padding:0px"} Your password won't change until you access the link above and create a new one. diff --git a/app/views/devise/mailer/unlock_instructions.html.haml b/app/views/devise/mailer/unlock_instructions.html.haml index 6c326a98..490cf346 100644 --- a/app/views/devise/mailer/unlock_instructions.html.haml +++ b/app/views/devise/mailer/unlock_instructions.html.haml @@ -1,7 +1,7 @@ -%p +%p{style: "margin:0px;padding:0px"} Hello = succeed '!' = @resource.screen_name -%p Your account has been locked due to an excessive number of unsuccessful sign in attempts. -%p Click the link below to unlock your account: -%p= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token, protocol: (APP_CONFIG['https'] ? :https : :http)) +%p{style: "margin:0px;padding:0px"} Your account has been locked due to an excessive number of unsuccessful sign in attempts. +%p{style: "margin:0px;padding:0px"} Click the link below to unlock your account: +%p{style: "margin:0px;padding:0px"}= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token, protocol: (APP_CONFIG['https'] ? :https : :http)) diff --git a/app/views/layouts/mail.html.haml b/app/views/layouts/mail.html.haml index 19e0b9e5..7ab7c138 100644 --- a/app/views/layouts/mail.html.haml +++ b/app/views/layouts/mail.html.haml @@ -1,8 +1,29 @@ -%style{type: "text/css"} p{margin:0;padding:0;}*,div,small,span,body{font-family:Arial;} -%div{style: 'background: #5e35b1; padding: 5px; padding-left: 10px; font-size: 25px; color: white; font-family: Arial; width: 800px; margin: 0;'}= APP_CONFIG['site_name'] -%div{style: 'border: #5e35b1 5px solid; padding: 5px; border-top: none; background: white; color: black; font-family: Arial; width: 795px; margin: 0;'} - = yield -%small{style: 'color: grey; display: block; width: 800px; text-align: center;'} - © - = Time.zone.now.year - = APP_CONFIG['site_name'] +%html + %head + %style{type: "text/css"} + :css + body { + font-size: 16px; + margin-top: 0px; + margin-bottom: 0px; + font-family: Arial, sans-serif; + } + p { + margin: 0px; + padding: 0px; + } + %body + %table{cellpadding: 0, cellspacing: 0, border: 5, bordercolor: "#5e35b1", bgcolor: "#5e35b1", style: "font-size:0px;", align: "center", width: "630"} + %tbody + %tr + %td{style: "padding:5px 10px;", align: "center"} + %p{style: "margin:0px;padding:0px"} + %font{color: "#ffffff", size: 6, face: "Arial, sans-serif"}= APP_CONFIG['site_name'] + %tr + %td{bgcolor: "#ffffff", style: "padding:10px"} + %font{color: "#000000", size: 4, face: "Arial, sans-serif"}= yield + %p{style:"margin:0px;padding:5px;", align: "center"} + %font{size: 2, color: "#797979", face: "Arial, sans-serif"} + © + = Time.zone.now.year + = APP_CONFIG['site_name'] From 5c868336017aa3d99329f3ef0d7ffdbbc59a1b2a Mon Sep 17 00:00:00 2001 From: Yuki Date: Thu, 23 Jul 2015 12:12:36 +0530 Subject: [PATCH 2/2] Fix emails --- .../confirmation_instructions.html.haml | 1 + .../reset_password_instructions.html.haml | 6 +++-- .../reset_password_instructions.text.erb | 4 ++-- .../mailer/unlock_instructions.html.haml | 5 ++-- .../mailer/unlock_instructions.text.erb | 2 +- app/views/layouts/mail.html.haml | 23 +++++++++---------- 6 files changed, 22 insertions(+), 19 deletions(-) diff --git a/app/views/devise/mailer/confirmation_instructions.html.haml b/app/views/devise/mailer/confirmation_instructions.html.haml index c6632c65..ae56f4eb 100644 --- a/app/views/devise/mailer/confirmation_instructions.html.haml +++ b/app/views/devise/mailer/confirmation_instructions.html.haml @@ -4,5 +4,6 @@ = APP_CONFIG['site_name'] = succeed '!' do = @resource.screen_name +%p   %p{style: "margin:0px;padding:0px"} You can confirm your account email through the link below: %p{style: "margin:0px;padding:0px"}= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token, protocol: (APP_CONFIG['https'] ? :https : :http)) diff --git a/app/views/devise/mailer/reset_password_instructions.html.haml b/app/views/devise/mailer/reset_password_instructions.html.haml index 9013ea51..00c50a44 100644 --- a/app/views/devise/mailer/reset_password_instructions.html.haml +++ b/app/views/devise/mailer/reset_password_instructions.html.haml @@ -1,8 +1,10 @@ %p{style: "margin:0px;padding:0px"} Hello - = succeed '!' - = @resource.screen_name + = succeed '!' do + = @resource.screen_name +%p   %p{style: "margin:0px;padding:0px"} Someone (hopefully you) has requested a link to change your password. You can do this through the link below. %p{style: "margin:0px;padding:0px"}= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token, protocol: (APP_CONFIG['https'] ? :https : :http)) +%p   %p{style: "margin:0px;padding:0px"} If you didn't request this, please ignore this email. %p{style: "margin:0px;padding:0px"} Your password won't change until you access the link above and create a new one. diff --git a/app/views/devise/mailer/reset_password_instructions.text.erb b/app/views/devise/mailer/reset_password_instructions.text.erb index 695942fb..2cf6e7fa 100644 --- a/app/views/devise/mailer/reset_password_instructions.text.erb +++ b/app/views/devise/mailer/reset_password_instructions.text.erb @@ -1,9 +1,9 @@ -Hello <%= @resource.screen_name %> +Hello <%= @resource.screen_name %>! Someone (hopefully you) has requested a link to change your password. You can do this by copying the link below and entering it into your browser. -<%= edit_password_url(@resource, reset_password_token: @token, protocol: (APP_CONFIG['https'] ? :https : :http) %> +<%= edit_password_url(@resource, reset_password_token: @token, protocol: (APP_CONFIG['https'] ? :https : :http)) %> If you didn't request this, please ignore this email. Your password won't change until you access the link above and create a new one. diff --git a/app/views/devise/mailer/unlock_instructions.html.haml b/app/views/devise/mailer/unlock_instructions.html.haml index 490cf346..eb427845 100644 --- a/app/views/devise/mailer/unlock_instructions.html.haml +++ b/app/views/devise/mailer/unlock_instructions.html.haml @@ -1,7 +1,8 @@ %p{style: "margin:0px;padding:0px"} Hello - = succeed '!' - = @resource.screen_name + = succeed '!' do + = @resource.screen_name +%p   %p{style: "margin:0px;padding:0px"} Your account has been locked due to an excessive number of unsuccessful sign in attempts. %p{style: "margin:0px;padding:0px"} Click the link below to unlock your account: %p{style: "margin:0px;padding:0px"}= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token, protocol: (APP_CONFIG['https'] ? :https : :http)) diff --git a/app/views/devise/mailer/unlock_instructions.text.erb b/app/views/devise/mailer/unlock_instructions.text.erb index 73356bfd..e19494f0 100644 --- a/app/views/devise/mailer/unlock_instructions.text.erb +++ b/app/views/devise/mailer/unlock_instructions.text.erb @@ -1,4 +1,4 @@ -Hello <%= @resource.screen_name %> +Hello <%= @resource.screen_name %>! Your account has been locked due to an excessive number of unsuccessful sign in attempts. You can unlock your account by copying the link below diff --git a/app/views/layouts/mail.html.haml b/app/views/layouts/mail.html.haml index 7ab7c138..3b06a584 100644 --- a/app/views/layouts/mail.html.haml +++ b/app/views/layouts/mail.html.haml @@ -1,17 +1,16 @@ %html %head - %style{type: "text/css"} - :css - body { - font-size: 16px; - margin-top: 0px; - margin-bottom: 0px; - font-family: Arial, sans-serif; - } - p { - margin: 0px; - padding: 0px; - } + :css + body { + font-size: 16px; + margin-top: 0px; + margin-bottom: 0px; + font-family: Arial, sans-serif; + } + p { + margin: 0px; + padding: 0px; + } %body %table{cellpadding: 0, cellspacing: 0, border: 5, bordercolor: "#5e35b1", bgcolor: "#5e35b1", style: "font-size:0px;", align: "center", width: "630"} %tbody