From eb85f38220dc865ab073e99f4a0dea4156f85644 Mon Sep 17 00:00:00 2001 From: Yuki Date: Tue, 21 Jul 2015 23:50:54 +0530 Subject: [PATCH] Fix text, add more templates --- app/mailers/retromail.rb | 2 +- ...ctions.txt.erb => confirmation_instructions.text.erb} | 0 .../devise/mailer/reset_password_instructions.html.haml | 7 +++++-- .../devise/mailer/reset_password_instructions.text.erb | 9 +++++++++ app/views/devise/mailer/unlock_instructions.html.haml | 7 +++++-- app/views/devise/mailer/unlock_instructions.text.erb | 7 +++++++ app/views/layouts/mail.html.haml | 5 ++++- app/views/layouts/mail.text.erb | 3 +++ app/views/layouts/mail.txt.erb | 3 --- 9 files changed, 34 insertions(+), 9 deletions(-) rename app/views/devise/mailer/{confirmation_instructions.txt.erb => confirmation_instructions.text.erb} (100%) create mode 100644 app/views/devise/mailer/reset_password_instructions.text.erb create mode 100644 app/views/devise/mailer/unlock_instructions.text.erb create mode 100644 app/views/layouts/mail.text.erb delete mode 100644 app/views/layouts/mail.txt.erb diff --git a/app/mailers/retromail.rb b/app/mailers/retromail.rb index 8dc1c04f..0bd929a7 100644 --- a/app/mailers/retromail.rb +++ b/app/mailers/retromail.rb @@ -7,7 +7,7 @@ class Retromail < Devise::Mailer def devise_mail(record, action, opts={}) initialize_from_record(record) mail(headers_for(action, opts)) do |format| - format.txt + format.text format.html end end diff --git a/app/views/devise/mailer/confirmation_instructions.txt.erb b/app/views/devise/mailer/confirmation_instructions.text.erb similarity index 100% rename from app/views/devise/mailer/confirmation_instructions.txt.erb rename to app/views/devise/mailer/confirmation_instructions.text.erb diff --git a/app/views/devise/mailer/reset_password_instructions.html.haml b/app/views/devise/mailer/reset_password_instructions.html.haml index 007b4f54..39515aab 100644 --- a/app/views/devise/mailer/reset_password_instructions.html.haml +++ b/app/views/devise/mailer/reset_password_instructions.html.haml @@ -1,5 +1,8 @@ -%p Hello #{@resource.screen_name}! +%p + 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. \ No newline at end of file +%p 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 new file mode 100644 index 00000000..ab7cadb6 --- /dev/null +++ b/app/views/devise/mailer/reset_password_instructions.text.erb @@ -0,0 +1,9 @@ +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) %> + +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 df31b019..6c326a98 100644 --- a/app/views/devise/mailer/unlock_instructions.html.haml +++ b/app/views/devise/mailer/unlock_instructions.html.haml @@ -1,4 +1,7 @@ -%p Hello #{@resource.screen_name}! +%p + 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)) \ No newline at end of file +%p= 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 new file mode 100644 index 00000000..6cda15fe --- /dev/null +++ b/app/views/devise/mailer/unlock_instructions.text.erb @@ -0,0 +1,7 @@ +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 +and entering it into your browser. + +<%= 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 5d987e18..19e0b9e5 100644 --- a/app/views/layouts/mail.html.haml +++ b/app/views/layouts/mail.html.haml @@ -2,4 +2,7 @@ %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;'} © 2015 Retrospring +%small{style: 'color: grey; display: block; width: 800px; text-align: center;'} + © + = Time.zone.now.year + = APP_CONFIG['site_name'] diff --git a/app/views/layouts/mail.text.erb b/app/views/layouts/mail.text.erb new file mode 100644 index 00000000..1890f3ff --- /dev/null +++ b/app/views/layouts/mail.text.erb @@ -0,0 +1,3 @@ +<%= yield %> + +© <%= Time.zone.now.year %> <%= APP_CONFIG['site_name'] %> diff --git a/app/views/layouts/mail.txt.erb b/app/views/layouts/mail.txt.erb deleted file mode 100644 index d955dba9..00000000 --- a/app/views/layouts/mail.txt.erb +++ /dev/null @@ -1,3 +0,0 @@ -<%= yield %> - -© 2015 Retrospring