diff --git a/app/assets/images/tailwind/reset-password-illustration.png b/app/assets/images/tailwind/reset-password-illustration.png new file mode 100644 index 000000000..d393a95e8 Binary files /dev/null and b/app/assets/images/tailwind/reset-password-illustration.png differ diff --git a/app/views/devise/mailer/_reset_password_instructions_current_theme.html.erb b/app/views/devise/mailer/_reset_password_instructions_current_theme.html.erb new file mode 100644 index 000000000..e103fec00 --- /dev/null +++ b/app/views/devise/mailer/_reset_password_instructions_current_theme.html.erb @@ -0,0 +1,19 @@ + + + + + + + <% if resource.name.present? %> +

Hello <%= resource.name %>!

+ <% else %> +

Hello!

+ <% end %> + +

Please click the link below and follow the instructions. We'll have you up and running with a new password in no time.

+ +

<%= link_to "Reset password", edit_password_url(resource, reset_password_token: token) %>

+ +

Didn't request this email? Then you can safely ignore it.

+ + diff --git a/app/views/devise/mailer/_reset_password_instructions_new_theme.html.erb b/app/views/devise/mailer/_reset_password_instructions_new_theme.html.erb new file mode 100644 index 000000000..fdba5bcb2 --- /dev/null +++ b/app/views/devise/mailer/_reset_password_instructions_new_theme.html.erb @@ -0,0 +1,142 @@ + + + + + + + + + + + Reset password instructions + + + + + + +
+ Please click the button below and follow the instructions. We'll have you up and running with a new password in no time. +  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏ +
+
+
+ + + + +
+ + + + + + + +
+ + + + +
+

Planning Alerts

+
+ + + + +
Email alerts of planning applications near you
+
+
+

Hello,

+

Please click the button below and follow the instructions. + We'll have you up and running with a new password in no time. +

+

Thanks,
Planning Alerts team

+
+ +
+ + + + +
+ " alt="Illustration of a woman with glasses using her laptop" style="max-width: 100%; vertical-align: middle; line-height: 1; border: 0"> +
+
+

Didn't request this email? Then you can safely ignore it.

+
+

+ Planning Alerts + is a free service where anyone can find out what is being built and knocked down in their area. +

+

+ The service + is run by the independent charity + OpenAustralia Foundation. +

+

+ Contact us +

+
+
+
+ + \ No newline at end of file diff --git a/app/views/devise/mailer/reset_password_instructions.html.erb b/app/views/devise/mailer/reset_password_instructions.html.erb index 4551534b3..4a2b1726d 100644 --- a/app/views/devise/mailer/reset_password_instructions.html.erb +++ b/app/views/devise/mailer/reset_password_instructions.html.erb @@ -1,19 +1,5 @@ - - - - - - - <% if @resource.name.present? %> -

Hello <%= @resource.name %>!

- <% else %> -

Hello!

- <% end %> - -

Please click the link below and follow the instructions. We'll have you up and running with a new password in no time.

- -

<%= link_to "Reset password", edit_password_url(@resource, reset_password_token: @token) %>

- -

Didn't request this email? Then you can safely ignore it.

- - +<% if @resource.tailwind_theme %> + <%= render "reset_password_instructions_new_theme", resource: @resource, token: @token %> +<% else %> + <%= render "reset_password_instructions_current_theme", resource: @resource, token: @token %> +<% end %> diff --git a/spec/mailers/previews/login_and_account_preview.rb b/spec/mailers/previews/login_and_account_preview.rb index 73153608a..945131e4b 100644 --- a/spec/mailers/previews/login_and_account_preview.rb +++ b/spec/mailers/previews/login_and_account_preview.rb @@ -19,6 +19,13 @@ def reset_password_instructions Devise::Mailer.reset_password_instructions(user, "faketoken") end + # It shows a different email address in the "to" and the body of the email. + # TODO: Figure out what's going on and fix it + def reset_password_instructions_new_theme + user = FactoryBot.build_stubbed(:user, name: "Matthew", tailwind_theme: true) + Devise::Mailer.reset_password_instructions(user, "faketoken") + end + def activate_account_instructions user = FactoryBot.build_stubbed(:user) Users::ActivationMailer.notify(user, "faketoken")