Browse Source

Use invite template

pull/134/head
baarkerlounger 4 years ago committed by Paul Robert Lloyd
parent
commit
238bccc93a
  1. 8
      app/views/devise/mailer/_password_change_forgotten.html.erb
  2. 6
      app/views/devise/mailer/_password_change_initial.html.erb
  3. 13
      app/views/devise/mailer/reset_password_instructions.html.erb
  4. 2
      spec/requests/auth/passwords_controller_spec.rb

8
app/views/devise/mailer/_password_change_forgotten.html.erb

@ -0,0 +1,8 @@
<p>Hello <%= @resource.email %>!</p>
<p>Someone has requested a link to change your password. You can do this through the link below.</p>
<p><%= govuk_link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %></p>
<p>If you didn't request this, please ignore this email.</p>
<p>Your password won't change until you access the link above and create a new one.</p>

6
app/views/devise/mailer/_password_change_initial.html.erb

@ -0,0 +1,6 @@
<p>Hello <%= @resource.name %>!</p>
<p>An account has been created for you to submit CORE data on behalf of @resource.organisation.</p>
<p>Your username is <% @resource.email %>, use the link below to set your password.
<p><%= govuk_link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %></p>

13
app/views/devise/mailer/reset_password_instructions.html.erb

@ -1,8 +1,5 @@
<p>Hello <%= @resource.email %>!</p>
<p>Someone has requested a link to change your password. You can do this through the link below.</p>
<p><%= govuk_link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %></p>
<p>If you didn't request this, please ignore this email.</p>
<p>Your password won't change until you access the link above and create a new one.</p>
<% if @resource.last_sign_in_at.nil? %>
<%= render partial: "password_change_initial" %>
<% else %>
<%= render partial: "password_change_forgotten" %>
<% end %>

2
spec/requests/auth/passwords_controller_spec.rb

@ -32,7 +32,7 @@ RSpec.describe Auth::PasswordsController, type: :request do
end
context "when a password reset is requested the email" do
let(:user) { FactoryBot.create(:user) }
let(:user) { FactoryBot.create(:user, last_sign_in_at: Time.zone.now) }
let(:email) { user.email }
it "should contain the correct email" do

Loading…
Cancel
Save