From 9502b9c8eda745fc394676c67d7b66eabc6e4174 Mon Sep 17 00:00:00 2001 From: Matthew Landauer Date: Mon, 18 Sep 2023 04:48:55 +0000 Subject: [PATCH] Add reset password email in new theme --- .../tailwind/reset-password-illustration.png | Bin 0 -> 9262 bytes ...ssword_instructions_current_theme.html.erb | 19 +++ ...t_password_instructions_new_theme.html.erb | 142 ++++++++++++++++++ .../reset_password_instructions.html.erb | 24 +-- .../previews/login_and_account_preview.rb | 7 + 5 files changed, 173 insertions(+), 19 deletions(-) create mode 100644 app/assets/images/tailwind/reset-password-illustration.png create mode 100644 app/views/devise/mailer/_reset_password_instructions_current_theme.html.erb create mode 100644 app/views/devise/mailer/_reset_password_instructions_new_theme.html.erb 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 0000000000000000000000000000000000000000..d393a95e81aba41d5ec1734dc56856838a9818db GIT binary patch literal 9262 zcmX9^bwE?^*B{a#CEXy1goreZax^N<0O=5r?(SAVQo2S6V@P+4w3Kw0^yr2S#=GzD z{bO;rbI)_0=hWw%bH8e+DG?FS5dZ)HA{AwMEdT(+4*h)w4+s4oB-na`{=j!p{^$+> z5R(7*!T@CD(4c?BaMx0j1yqhP?4vKRY(T0Y0H7v;@ZKC70ATA;kq7DcU>vQGxO}(D zdwIHc;q@kz@+s;ud~t*&xjRYzI-@)Dqr~0}f73DuYTVw+r2;j0FShY?-AUYzx8PU@ zrpuD^X0OGQ!%a``U^!Fc;P^99V%`d^rghT#uT$?R#V|1zQWPG>5c2TCzisU={>l*2 ztLp*v5CrqX&vlyrHZ0n8pSN})8OCz%b+`we_OK&0aNtP#sjCitmeKlE{^fp0MF-sr zdpkRAtaSkpscqMtr;==%t#cX4CYGE^QYBxoi<=`MMl&9W(Y(#;zSg94mFkHhmaXbq z=^QlVRQi-zfKY+8r6v>oxOq;sr_HyAeWn+m({d65{gbFJ(w}%$-?L) zJ>i$W2${!|{QdQlu0bRnia};|ZCXVJQ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%z@16NVq;I%I6imY^G z3=sC8EwvnLZ*{t7!?IfZL=5Q{sLDc2pxn0PO>f6c+U4oVCQ&Rb$?yoWBvdWK`n>y9U$5o)*{sN)Vaoh$!%M4EK$g$CC z!RrZ(xjqYwnaV=(yPL;?HFUEa5|xlSZoUYkt^NB*p_9Mw+fUiYwLGmCU|x0(+2efT|c_vr4@M59U*I zyDF%MU=|qcrRL0Akf`|e@&b=*0`j$Rht``lGDp3mQF6HJ zd*R6L#kFsxC#(13s$dck9f)H5MuYg0m@$!F45!H4Baxk56A zUFcaS#=wk6AlRpK|LML!Dr%7l7u`GgRt|4mq*Lkj?)`xm#eRGn&P7g1tcvIN3@c;nHmnuRPe!fYrgnn_4 zxUzJBU#2>gxfzHD=DY>OaDE^=UA`e>f^Cf)7W%Q9sTKbM@1G??qyWIJ<_{6cSqT2K z6f~22mA~w9yBL7moRXBMBbh$|fC)Addwyf*mjJ-&3*$M%dOh^Yu-<-g5;T{h_m-Qn z6Gg`zYR+0+kXjtTDIu4kUZqb-lFVUKWWbR7V-cuVzQYg0nRP(Q4*)oZbFcyxPExn` eos<^4o=6EFm$h;}%RoQg15i;=ldqID3;RFbZYCQ5 literal 0 HcmV?d00001 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")