From 2219f8170c490cb9188e8613e725f960f365e9ac Mon Sep 17 00:00:00 2001 From: Shannon Alexander Date: Fri, 29 Jul 2022 17:35:42 -0400 Subject: [PATCH 01/18] add styles to email stylesheet --- app/assets/stylesheets/email.css.scss | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/assets/stylesheets/email.css.scss b/app/assets/stylesheets/email.css.scss index 0c13b1ef748..9046517db65 100644 --- a/app/assets/stylesheets/email.css.scss +++ b/app/assets/stylesheets/email.css.scss @@ -32,6 +32,11 @@ line-height: 10px; } +.s16 { + font-size: 16px; + line-height: 24px; +} + .s30 { font-size: 30px; line-height: 30px; @@ -47,6 +52,16 @@ h4 { margin-bottom: 16px; } +.mt-40 { + margin-top: 40px; +} + +.button.big table a { + padding: 16px 20px; + font-size: 20px; + border-radius: 8px; +} + .button.large.expanded table a { padding: 20px 0; } From 4bfc8e3f61335312bd4bf690882a05cf35a2ee25 Mon Sep 17 00:00:00 2001 From: Shannon Alexander Date: Fri, 29 Jul 2022 17:39:52 -0400 Subject: [PATCH 02/18] add heading strings --- config/locales/in_person_proofing/en.yml | 1 + config/locales/in_person_proofing/es.yml | 1 + config/locales/in_person_proofing/fr.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/config/locales/in_person_proofing/en.yml b/config/locales/in_person_proofing/en.yml index 7d39e98f81c..2fcf596b9e3 100644 --- a/config/locales/in_person_proofing/en.yml +++ b/config/locales/in_person_proofing/en.yml @@ -88,6 +88,7 @@ en: location: Select a location to verify your ID prepare: Verify your identity in person state_id: Enter the information on your ID + success: You successfully verified your identity with Login.gov update_address: Update your current address update_state_id: Update the information on your ID process: diff --git a/config/locales/in_person_proofing/es.yml b/config/locales/in_person_proofing/es.yml index dff6dbe5ad1..7fd03fe3084 100644 --- a/config/locales/in_person_proofing/es.yml +++ b/config/locales/in_person_proofing/es.yml @@ -92,6 +92,7 @@ es: location: Seleccione un lugar para verificar su cédula prepare: Verifique su identidad en persona state_id: Ingrese la información de su cédula + success: Verificó correctamente su identidad con Login.gov update_address: Actualizar su dirección actual update_state_id: Actualizar la información de su cédula de identidad process: diff --git a/config/locales/in_person_proofing/fr.yml b/config/locales/in_person_proofing/fr.yml index 6a2454799ff..c544f2dd1c2 100644 --- a/config/locales/in_person_proofing/fr.yml +++ b/config/locales/in_person_proofing/fr.yml @@ -96,6 +96,7 @@ fr: location: Sélectionnez un lieu pour vérifier votre identité prepare: Vérifiez votre identité en personne state_id: Saisissez les informations figurant sur votre document d’identité + success: Vous avez vérifié avec succès votre identité avec Login.gov update_address: Mettre à jour votre adresse actuelle update_state_id: Mettre à jour les informations figurant sur votre document d’identité process: From d2859136f979ab2c8b78861e27bc6f6caf9628d0 Mon Sep 17 00:00:00 2001 From: Shannon Alexander Date: Fri, 29 Jul 2022 17:41:31 -0400 Subject: [PATCH 03/18] add verified email strings --- config/locales/user_mailer/en.yml | 10 ++++++++++ config/locales/user_mailer/es.yml | 11 +++++++++++ config/locales/user_mailer/fr.yml | 11 +++++++++++ 3 files changed, 32 insertions(+) diff --git a/config/locales/user_mailer/en.yml b/config/locales/user_mailer/en.yml index 587cc7c4aa0..7d608772a20 100644 --- a/config/locales/user_mailer/en.yml +++ b/config/locales/user_mailer/en.yml @@ -105,6 +105,16 @@ en: intro: Here are the details to verify your identity in person at a United States Post Office near you. subject: You’re ready to verify your identity with %{app_name} in person + in_person_verified: + greeting: Hi %{name}, + intro: You successfully verified your identity at the %{location} Post Office on %{date}. + link: http://www.secure.login.gov/verify + next_sign_in: Next, click the button or copy the link below to sign in to Login.gov. + sign_in: Sign in + subject: You successfully verified your identity with Login.gov + warning_contact_us_html: If you did not attempt to verify your identity in person, + please contact us and sign in to + change your password. letter_reminder: info_html: The letter you are about to receive will contain a confirmation code that helps us verify your address. You can complete the identity diff --git a/config/locales/user_mailer/es.yml b/config/locales/user_mailer/es.yml index 7ac1e5820c8..175edcdc50d 100644 --- a/config/locales/user_mailer/es.yml +++ b/config/locales/user_mailer/es.yml @@ -111,6 +111,17 @@ es: intro: Estos son los detalles para verificar su identidad en persona en una oficina de correos de los Estados Unidos cercana a usted. subject: Está listo para verificar su identidad con %{app_name} en persona + in_person_verified: + greeting: 'Hola, %{name}:' + intro: El %{date}, verificó correctamente su identidad en la oficina de correos de %{location}. + link: http://www.secure.login.gov/verify + next_sign_in: Luego, haga clic en el botón o copie el enlace que aparece a continuación para + iniciar sesión en Login.gov. + sign_in: Iniciar sesión + subject: Verificó correctamente su identidad con Login.gov + warning_contact_us_html: Si usted no intentó verificar su identidad en persona, por favor, + póngase en contacto con nosotros e + inicie sesión para cambiar su contraseña. letter_reminder: info_html: La carta que está a punto de recibir contendrá un código de confirmación que nos ayudará a verificar su dirección. Puede completar diff --git a/config/locales/user_mailer/fr.yml b/config/locales/user_mailer/fr.yml index f1a56ba36e1..2038fc2043b 100644 --- a/config/locales/user_mailer/fr.yml +++ b/config/locales/user_mailer/fr.yml @@ -114,6 +114,17 @@ fr: intro: Voici les détails pour vérifier votre identité en personne dans un bureau de poste des États-Unis près de chez vous. subject: Vous êtes prêt à vérifier votre identité avec %{app_name} en personne + in_person_verified: + greeting: 'Bonjour %{name},' + intro: Vous avez vérifié avec succès votre identité au bureau de poste de %{location} le %{date}. + link: http://www.secure.login.gov/verify + next_sign_in: Ensuite, cliquez sur le bouton ou copiez le lien ci-dessous pour vous + connecter à Login.gov. + sign_in: Se connecter + subject: Vous avez vérifié avec succès votre identité avec Login.gov + warning_contact_us_html: Si vous n’avez pas essayé de vérifier votre identité en personne, + veuillez nous contacter et vous connecter + pour changer votre mot de passe. letter_reminder: info_html: La lettre que vous êtes sur le point de recevoir contiendra un code de confirmation nous permettant de vérifier votre adresse. Vous pouvez From 5d4c674be76b98f26f91535339b82825a9fc0993 Mon Sep 17 00:00:00 2001 From: Shannon Alexander Date: Fri, 29 Jul 2022 17:41:59 -0400 Subject: [PATCH 04/18] add route --- config/routes.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/routes.rb b/config/routes.rb index ee18ff94063..ead957c6b93 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -329,6 +329,8 @@ get '/in_person' => 'in_person#index' get '/in_person/ready_to_verify' => 'in_person/ready_to_verify#show', as: :in_person_ready_to_verify + get '/in_person/verified' => 'in_person/verified#show', + as: :in_person_verified get '/in_person/usps_locations' => 'in_person/usps_locations#index' put '/in_person/usps_locations' => 'in_person/usps_locations#update' get '/in_person/usps_locations/selected' => 'in_person/usps_locations#show' From 0d5544283343ff04ce58c6b8ffbfaf478f58fa46 Mon Sep 17 00:00:00 2001 From: Shannon Alexander Date: Fri, 29 Jul 2022 17:46:23 -0400 Subject: [PATCH 05/18] create verified email and show in preview --- .../idv/in_person/verified_controller.rb | 23 +++++++++ app/mailers/user_mailer.rb | 11 ++++ .../idv/in_person/verified_presenter.rb | 21 ++++++++ .../user_mailer/in_person_verified.html.erb | 51 +++++++++++++++++++ spec/mailers/previews/user_mailer_preview.rb | 23 +++++++++ 5 files changed, 129 insertions(+) create mode 100644 app/controllers/idv/in_person/verified_controller.rb create mode 100644 app/presenters/idv/in_person/verified_presenter.rb create mode 100644 app/views/user_mailer/in_person_verified.html.erb diff --git a/app/controllers/idv/in_person/verified_controller.rb b/app/controllers/idv/in_person/verified_controller.rb new file mode 100644 index 00000000000..c9662a1c5ef --- /dev/null +++ b/app/controllers/idv/in_person/verified_controller.rb @@ -0,0 +1,23 @@ +module Idv + module InPerson + class VerifiedController < ApplicationController + + def show + @presenter = ReadyToVerifyPresenter.new(enrollment: enrollment) + end + + def send_verified_email(user, enrollment) + user.confirmed_email_addresses.each do |email_address| + UserMailer.in_person_verified( + user, + email_address, + first_name: user_session.dig(:idv, :pii, :first_name), + enrollment: entrollment, + ).deliver_now_or_later + end + end + + end + end +end + \ No newline at end of file diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index 2831a2639f7..d5501d68884 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -236,6 +236,17 @@ def in_person_ready_to_verify(user, email_address, first_name:, enrollment:) end end + def in_person_verified(user, email_address, first_name:, enrollment:) + with_user_locale(user) do + @first_name = first_name + @presenter = Idv::InPerson::VerifiedPresenter.new(enrollment: enrollment) + mail( + to: email_address.email, + subject: t('user_mailer.in_person_verified.subject', app_name: APP_NAME), + ) + end + end + private def email_should_receive_nonessential_notifications?(email) diff --git a/app/presenters/idv/in_person/verified_presenter.rb b/app/presenters/idv/in_person/verified_presenter.rb new file mode 100644 index 00000000000..6936e8971f2 --- /dev/null +++ b/app/presenters/idv/in_person/verified_presenter.rb @@ -0,0 +1,21 @@ +module Idv + module InPerson + class VerifiedPresenter + + # update to user's time zone when out of pilot + USPS_SERVER_TIMEZONE = ActiveSupport::TimeZone['America/New_York'] + def initialize(enrollment:) + @enrollment = enrollment + end + + def location + @enrollment.selected_location_details["name"] + end + + def date + @enrollment.status_updated_at.in_time_zone(USPS_SERVER_TIMEZONE).strftime(I18n.t('time.formats.event_date')) + end + + end + end +end \ No newline at end of file diff --git a/app/views/user_mailer/in_person_verified.html.erb b/app/views/user_mailer/in_person_verified.html.erb new file mode 100644 index 00000000000..d0117450aa4 --- /dev/null +++ b/app/views/user_mailer/in_person_verified.html.erb @@ -0,0 +1,51 @@ +<%= image_tag('user-signup-ial2.svg', alt: '', class: 'float-center') %> +

+

+ <%= t('user_mailer.in_person_verified.greeting', name: @first_name ) %>
+ <%= t('user_mailer.in_person_verified.intro', location: @presenter.location, date: @presenter.date) %>

+ <%= t('user_mailer.in_person_verified.next_sign_in') %> +
+

+ +
+ + + + + + + +
+ + + + + + +
+ <%= link_to t('user_mailer.in_person_verified.sign_in'), + sign_up_create_email_confirmation_url( + _request_id: @request_id, + confirmation_token: @token, + locale: @locale, + ), + target: '_blank', + class: 'float-center', + rel: 'noopener' %> +
+
+
+ +

+ <%= link_to t('user_mailer.in_person_verified.link'), ('http://www.secure.login.gov/verify') %> +

+ +

+
+<%= t('user_mailer.in_person_verified.warning_contact_us_html', + contact_us:"https://www.login.gov/contact/", + sign_in: event_disavowal_url(disavowal_token: @disavowal_token), + ) %> + + +

\ No newline at end of file diff --git a/spec/mailers/previews/user_mailer_preview.rb b/spec/mailers/previews/user_mailer_preview.rb index 0b1dd186ba0..c3de9b83a38 100644 --- a/spec/mailers/previews/user_mailer_preview.rb +++ b/spec/mailers/previews/user_mailer_preview.rb @@ -143,6 +143,15 @@ def in_person_ready_to_verify ) end + def in_person_verified + UserMailer.in_person_verified( + user, + email_address_record, + first_name: 'Michael', + enrollment: verified_enrollment, + ) + end + private def user @@ -178,6 +187,20 @@ def in_person_enrollment ) end + def verified_enrollment + unsaveable( + InPersonEnrollment.new( + user: user, + profile: unsaveable(Profile.new(user: user)), + status_updated_at: Time.zone.now, + status: 2, + selected_location_details: { + 'name' => 'Baltimore', + } + ) + ) + end + # Remove #save and #save! to make sure we can't write these made-up records def unsaveable(record) class << record From d281bf582c8400580e60a5a4fd41fa57e417c3cc Mon Sep 17 00:00:00 2001 From: Shannon Alexander Date: Fri, 29 Jul 2022 17:48:16 -0400 Subject: [PATCH 06/18] add send verified email to jobs --- app/jobs/get_usps_proofing_results_job.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/jobs/get_usps_proofing_results_job.rb b/app/jobs/get_usps_proofing_results_job.rb index 9f585b6f0de..ad1923828d2 100644 --- a/app/jobs/get_usps_proofing_results_job.rb +++ b/app/jobs/get_usps_proofing_results_job.rb @@ -143,6 +143,8 @@ def update_enrollment_status(enrollment, response) enrollment.profile.activate enrollment.update(status: :passed) handle_successful_status_update(enrollment) + # move this somewhere it will trigger to test + send_verified_email(user, enrollment) else # Unsupported ID type enrollment.update(status: :failed) From f2be35bd9c7f3c8ae831b4edeba8b22bbc817c34 Mon Sep 17 00:00:00 2001 From: Tomas Apodaca Date: Sun, 31 Jul 2022 14:35:23 -0700 Subject: [PATCH 07/18] lint fix --- .../idv/in_person/verified_controller.rb | 19 +++++------ .../idv/in_person/verified_presenter.rb | 33 ++++++++++--------- .../user_mailer/in_person_verified.html.erb | 21 +++++++----- spec/mailers/previews/user_mailer_preview.rb | 14 ++++---- 4 files changed, 44 insertions(+), 43 deletions(-) diff --git a/app/controllers/idv/in_person/verified_controller.rb b/app/controllers/idv/in_person/verified_controller.rb index c9662a1c5ef..a0ded217ed9 100644 --- a/app/controllers/idv/in_person/verified_controller.rb +++ b/app/controllers/idv/in_person/verified_controller.rb @@ -1,23 +1,20 @@ module Idv - module InPerson - class VerifiedController < ApplicationController - - def show - @presenter = ReadyToVerifyPresenter.new(enrollment: enrollment) - end + module InPerson + class VerifiedController < ApplicationController + def show + @presenter = ReadyToVerifyPresenter.new(enrollment: enrollment) + end - def send_verified_email(user, enrollment) + def send_verified_email(user, enrollment) user.confirmed_email_addresses.each do |email_address| UserMailer.in_person_verified( user, email_address, first_name: user_session.dig(:idv, :pii, :first_name), - enrollment: entrollment, + enrollment: enrollment, ).deliver_now_or_later end end - - end end + end end - \ No newline at end of file diff --git a/app/presenters/idv/in_person/verified_presenter.rb b/app/presenters/idv/in_person/verified_presenter.rb index 6936e8971f2..7dac2bd98b2 100644 --- a/app/presenters/idv/in_person/verified_presenter.rb +++ b/app/presenters/idv/in_person/verified_presenter.rb @@ -1,21 +1,22 @@ module Idv - module InPerson - class VerifiedPresenter + module InPerson + class VerifiedPresenter + # update to user's time zone when out of pilot + USPS_SERVER_TIMEZONE = ActiveSupport::TimeZone['America/New_York'] - # update to user's time zone when out of pilot - USPS_SERVER_TIMEZONE = ActiveSupport::TimeZone['America/New_York'] - def initialize(enrollment:) - @enrollment = enrollment - end + def initialize(enrollment:) + @enrollment = enrollment + end - def location - @enrollment.selected_location_details["name"] - end + def location + @enrollment.selected_location_details['name'] + end - def date - @enrollment.status_updated_at.in_time_zone(USPS_SERVER_TIMEZONE).strftime(I18n.t('time.formats.event_date')) - end - - end + def date + @enrollment.status_updated_at.in_time_zone(USPS_SERVER_TIMEZONE).strftime( + I18n.t('time.formats.event_date'), + ) + end end -end \ No newline at end of file + end +end diff --git a/app/views/user_mailer/in_person_verified.html.erb b/app/views/user_mailer/in_person_verified.html.erb index d0117450aa4..3bc73f7b3a5 100644 --- a/app/views/user_mailer/in_person_verified.html.erb +++ b/app/views/user_mailer/in_person_verified.html.erb @@ -1,9 +1,9 @@ <%= image_tag('user-signup-ial2.svg', alt: '', class: 'float-center') %>

- <%= t('user_mailer.in_person_verified.greeting', name: @first_name ) %>
- <%= t('user_mailer.in_person_verified.intro', location: @presenter.location, date: @presenter.date) %>

- <%= t('user_mailer.in_person_verified.next_sign_in') %> + <%= t('user_mailer.in_person_verified.greeting', name: @first_name) %>
+ <%= t('user_mailer.in_person_verified.intro', location: @presenter.location, date: @presenter.date) %>

+ <%= t('user_mailer.in_person_verified.next_sign_in') %>

@@ -37,15 +37,20 @@

- <%= link_to t('user_mailer.in_person_verified.link'), ('http://www.secure.login.gov/verify') %> + <%= link_to t('user_mailer.in_person_verified.link'), 'http://www.secure.login.gov/verify' %>


-<%= t('user_mailer.in_person_verified.warning_contact_us_html', - contact_us:"https://www.login.gov/contact/", +<%= link_to( + t( + 'user_mailer.in_person_verified.warning_contact_us_html', + contact_us: MarketingSite.contact_url, sign_in: event_disavowal_url(disavowal_token: @disavowal_token), - ) %> + ), + MarketingSite.contact_url, + ) +%> -

\ No newline at end of file +

diff --git a/spec/mailers/previews/user_mailer_preview.rb b/spec/mailers/previews/user_mailer_preview.rb index c3de9b83a38..2130e003856 100644 --- a/spec/mailers/previews/user_mailer_preview.rb +++ b/spec/mailers/previews/user_mailer_preview.rb @@ -187,20 +187,18 @@ def in_person_enrollment ) end - def verified_enrollment + def verified_enrollment unsaveable( InPersonEnrollment.new( user: user, profile: unsaveable(Profile.new(user: user)), - status_updated_at: Time.zone.now, - status: 2, - selected_location_details: { - 'name' => 'Baltimore', - } - ) + status_updated_at: Time.zone.now - 1.hour, + status: :passed, + selected_location_details: { 'name' => 'Baltimore' }.to_json, + ), ) end - + # Remove #save and #save! to make sure we can't write these made-up records def unsaveable(record) class << record From d90efbbabae3224846bc84abc43866220c2e00bd Mon Sep 17 00:00:00 2001 From: Tomas Apodaca Date: Sun, 31 Jul 2022 15:36:27 -0700 Subject: [PATCH 08/18] fix urls? and normalize yaml --- .../user_mailer/in_person_verified.html.erb | 19 ++++++------------- config/locales/user_mailer/en.yml | 10 +++++----- config/locales/user_mailer/es.yml | 15 ++++++++------- config/locales/user_mailer/fr.yml | 15 ++++++++------- 4 files changed, 27 insertions(+), 32 deletions(-) diff --git a/app/views/user_mailer/in_person_verified.html.erb b/app/views/user_mailer/in_person_verified.html.erb index 3bc73f7b3a5..6a052f70b90 100644 --- a/app/views/user_mailer/in_person_verified.html.erb +++ b/app/views/user_mailer/in_person_verified.html.erb @@ -17,11 +17,7 @@ <%= link_to t('user_mailer.in_person_verified.sign_in'), - sign_up_create_email_confirmation_url( - _request_id: @request_id, - confirmation_token: @token, - locale: @locale, - ), + idv_url, target: '_blank', class: 'float-center', rel: 'noopener' %> @@ -37,18 +33,15 @@

- <%= link_to t('user_mailer.in_person_verified.link'), 'http://www.secure.login.gov/verify' %> + <%= link_to idv_url, idv_url, target: '_blank', rel: 'noopener' %>


-<%= link_to( - t( - 'user_mailer.in_person_verified.warning_contact_us_html', - contact_us: MarketingSite.contact_url, - sign_in: event_disavowal_url(disavowal_token: @disavowal_token), - ), - MarketingSite.contact_url, +<%= t( + 'user_mailer.in_person_verified.warning_contact_us_html', + contact_us_url: MarketingSite.contact_url, + sign_in_url: idv_url, ) %> diff --git a/config/locales/user_mailer/en.yml b/config/locales/user_mailer/en.yml index 7d608772a20..3d0c37fdbe6 100644 --- a/config/locales/user_mailer/en.yml +++ b/config/locales/user_mailer/en.yml @@ -107,14 +107,14 @@ en: subject: You’re ready to verify your identity with %{app_name} in person in_person_verified: greeting: Hi %{name}, - intro: You successfully verified your identity at the %{location} Post Office on %{date}. - link: http://www.secure.login.gov/verify + intro: You successfully verified your identity at the %{location} Post Office on + %{date}. next_sign_in: Next, click the button or copy the link below to sign in to Login.gov. sign_in: Sign in subject: You successfully verified your identity with Login.gov - warning_contact_us_html: If you did not attempt to verify your identity in person, - please contact us and sign in to - change your password. + warning_contact_us_html: If you did not attempt to verify your identity in + person, please contact us and sign in to change your password. letter_reminder: info_html: The letter you are about to receive will contain a confirmation code that helps us verify your address. You can complete the identity diff --git a/config/locales/user_mailer/es.yml b/config/locales/user_mailer/es.yml index 175edcdc50d..0a634849621 100644 --- a/config/locales/user_mailer/es.yml +++ b/config/locales/user_mailer/es.yml @@ -113,15 +113,16 @@ es: subject: Está listo para verificar su identidad con %{app_name} en persona in_person_verified: greeting: 'Hola, %{name}:' - intro: El %{date}, verificó correctamente su identidad en la oficina de correos de %{location}. - link: http://www.secure.login.gov/verify - next_sign_in: Luego, haga clic en el botón o copie el enlace que aparece a continuación para - iniciar sesión en Login.gov. + intro: El %{date}, verificó correctamente su identidad en la oficina de correos + de %{location}. + next_sign_in: Luego, haga clic en el botón o copie el enlace que aparece a + continuación para iniciar sesión en Login.gov. sign_in: Iniciar sesión subject: Verificó correctamente su identidad con Login.gov - warning_contact_us_html: Si usted no intentó verificar su identidad en persona, por favor, - póngase en contacto con nosotros e - inicie sesión para cambiar su contraseña. + warning_contact_us_html: Si usted no intentó verificar su identidad en persona, + por favor, póngase en contacto con + nosotros e inicie sesión para cambiar + su contraseña. letter_reminder: info_html: La carta que está a punto de recibir contendrá un código de confirmación que nos ayudará a verificar su dirección. Puede completar diff --git a/config/locales/user_mailer/fr.yml b/config/locales/user_mailer/fr.yml index 2038fc2043b..13e421f5b96 100644 --- a/config/locales/user_mailer/fr.yml +++ b/config/locales/user_mailer/fr.yml @@ -116,15 +116,16 @@ fr: subject: Vous êtes prêt à vérifier votre identité avec %{app_name} en personne in_person_verified: greeting: 'Bonjour %{name},' - intro: Vous avez vérifié avec succès votre identité au bureau de poste de %{location} le %{date}. - link: http://www.secure.login.gov/verify - next_sign_in: Ensuite, cliquez sur le bouton ou copiez le lien ci-dessous pour vous - connecter à Login.gov. + intro: Vous avez vérifié avec succès votre identité au bureau de poste de + %{location} le %{date}. + next_sign_in: Ensuite, cliquez sur le bouton ou copiez le lien ci-dessous pour + vous connecter à Login.gov. sign_in: Se connecter subject: Vous avez vérifié avec succès votre identité avec Login.gov - warning_contact_us_html: Si vous n’avez pas essayé de vérifier votre identité en personne, - veuillez nous contacter et vous connecter - pour changer votre mot de passe. + warning_contact_us_html: Si vous n’avez pas essayé de vérifier votre identité en + personne, veuillez nous contacter et + vous connecter pour changer votre mot de + passe. letter_reminder: info_html: La lettre que vous êtes sur le point de recevoir contiendra un code de confirmation nous permettant de vérifier votre adresse. Vous pouvez From 316d4e53f619bede305f3500709cf4b4317b8bb6 Mon Sep 17 00:00:00 2001 From: Tomas Apodaca Date: Sun, 31 Jul 2022 21:03:22 -0700 Subject: [PATCH 09/18] can hide title in layout, added to new template --- app/mailers/user_mailer.rb | 1 + app/views/layouts/user_mailer.html.erb | 7 +++++-- app/views/user_mailer/in_person_verified.html.erb | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index d5501d68884..955d9599207 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -239,6 +239,7 @@ def in_person_ready_to_verify(user, email_address, first_name:, enrollment:) def in_person_verified(user, email_address, first_name:, enrollment:) with_user_locale(user) do @first_name = first_name + @hide_title = true @presenter = Idv::InPerson::VerifiedPresenter.new(enrollment: enrollment) mail( to: email_address.email, diff --git a/app/views/layouts/user_mailer.html.erb b/app/views/layouts/user_mailer.html.erb index f695ac2cfe6..243a7b28278 100644 --- a/app/views/layouts/user_mailer.html.erb +++ b/app/views/layouts/user_mailer.html.erb @@ -71,8 +71,11 @@ -

<%= @header || message.subject %> -

<%= yield %> + <% unless @hide_title %> +

<%= @header || message.subject %> +

+ <% end %> + <%= yield %> diff --git a/app/views/user_mailer/in_person_verified.html.erb b/app/views/user_mailer/in_person_verified.html.erb index 6a052f70b90..6d2108b2ae9 100644 --- a/app/views/user_mailer/in_person_verified.html.erb +++ b/app/views/user_mailer/in_person_verified.html.erb @@ -1,4 +1,5 @@ <%= image_tag('user-signup-ial2.svg', alt: '', class: 'float-center') %> +

<%= message.subject %>

<%= t('user_mailer.in_person_verified.greeting', name: @first_name) %>
From 990dbea4b3224c5f0d9e0cea6edf923248d4efea Mon Sep 17 00:00:00 2001 From: Tomas Apodaca Date: Sun, 31 Jul 2022 21:04:12 -0700 Subject: [PATCH 10/18] use rasterized header image & add padding --- app/assets/images/email/user-signup-ial2.png | Bin 0 -> 13300 bytes .../user_mailer/in_person_verified.html.erb | 8 +++++++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 app/assets/images/email/user-signup-ial2.png diff --git a/app/assets/images/email/user-signup-ial2.png b/app/assets/images/email/user-signup-ial2.png new file mode 100644 index 0000000000000000000000000000000000000000..9d8521fc12e80e90f367bb6e7380ebfbec844157 GIT binary patch literal 13300 zcmV?o00009a7bBm000id z000id0mpBsWB>pF8FWQhbW?9;ba!ELWdL_~cP?peYja~^aAhuUa%Y?FJQ@H1AOJ~3 zK~#90?Y(!HT*r0h{i_=~_jFHBj!1)?1Ca=l00RgNKvEVhFl(i?l~&fSEQyw7@7nbD zt%IT^Te3tkNn!#)krD_JAjAMB3_t=T0T4Nd0cHl1W9M7@M^BDD)3>JwklyFvLrmYg zRj2QL`_!pZ=bVB+;ZGO_M5+ZCP24_fR!-DnOp%6|Dg}80kqM+rDeVX>LW-b3G#JQ6 z1$hRc99P5gla~%2tV*@)V+B_=VM^yuA16^uf$Ig_0OXCJ8;KD6q%^h=RUg@Q;6S;_ zVqQ_W>IifD{Hgg-EDuQJp92dq_dA9`{1zhL+4}L3b0+qC#o($T%-XrLR-=fo3S=pu zC3(13B!9nk-@%_Gd7LqaE1fW6{eoGaG9-ToEE@H};qg{a=9k`j>#fLWkDV$c`BDhn+ z91!CK(hf8uL@iQ&D1_K!M8wuB-Dn;o4?I4spEqlzA>F`!T|iB>ET%wmS_=Mo$;StO^$-}T7AIbedBU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N=1tAj<~Zih^uCm)Pap#cRdU8Zh*S1gM8Q!-?U=a?ASF2b%DeVWnbjImh|eG07xmG zx@X<82Zp%iio(^UVF0N`zX>z}WYo^0&{;gh9WnSL{)EX==p09SZKuKAsG>fYP={j> zR~=#QS-s+tM0^oq)kbEv-9(mcco~QzL8dK}>HZtR=uq0?t7cYB7%RBy2m^3W>9Xg5 zp8^;mo%xYcvTZp@8!yM6$AZXu2zKrr{p9Y_WdnN;uV7r2gaJ@m%D)cc1pw){FgLJ{ zDQVM9A7^UXOy>Gak^as=@8^$xuq^J{{Z|^UI-|Ec9^SiG_f&@->&StUNP?Lc`LONn zK6PM*3zzOx=Jrv`r#8pig04b$-Zrkp^1Nl#M1ikAKn!RT@ z*t&<7@bKb)ow|!T&TDWtOhkq|W9TCY{?A=&mVI}m^>42fT=j(Mz_YKucbzblhk>qn zNim3e>Zw=DxfD82P2h5$Oi5L!WZAOGw~iw{T!7l-LmE9E+aZDYQljNduN3^z5C&k= zrbCvfyXmWnln+YC>wR4a3AQj&jYUj~s0IPOb5E!jE=nQ4*OX=b`PDoH^~N6+VLI@{ zjvY2zo8>c#-~owPMf{P65#UWJM=ZC!N$0000 +<%= image_tag( + 'email/user-signup-ial2.png', + width: 140, + height: 177, + alt: '', + class: 'float-center padding-bottom-4', + ) %>

<%= message.subject %>

From 8749b78848167845c64aa9040625714f8fa62616 Mon Sep 17 00:00:00 2001 From: Tomas Apodaca Date: Sun, 31 Jul 2022 21:04:33 -0700 Subject: [PATCH 11/18] use the standard email button size --- app/assets/stylesheets/email.css.scss | 6 ------ app/views/user_mailer/in_person_verified.html.erb | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/app/assets/stylesheets/email.css.scss b/app/assets/stylesheets/email.css.scss index 9046517db65..b2bec51bb6e 100644 --- a/app/assets/stylesheets/email.css.scss +++ b/app/assets/stylesheets/email.css.scss @@ -56,12 +56,6 @@ h4 { margin-top: 40px; } -.button.big table a { - padding: 16px 20px; - font-size: 20px; - border-radius: 8px; -} - .button.large.expanded table a { padding: 20px 0; } diff --git a/app/views/user_mailer/in_person_verified.html.erb b/app/views/user_mailer/in_person_verified.html.erb index db5fd19d1d2..4c0bf80b6c4 100644 --- a/app/views/user_mailer/in_person_verified.html.erb +++ b/app/views/user_mailer/in_person_verified.html.erb @@ -15,7 +15,7 @@

-
+
From 9b75ba3d707c3fc130f77ad8fe2a30f61b173e75 Mon Sep 17 00:00:00 2001 From: Tomas Apodaca Date: Sun, 31 Jul 2022 21:05:08 -0700 Subject: [PATCH 12/18] use existing sample enrollment data for preview --- spec/mailers/previews/user_mailer_preview.rb | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/spec/mailers/previews/user_mailer_preview.rb b/spec/mailers/previews/user_mailer_preview.rb index 2130e003856..702d76eb95d 100644 --- a/spec/mailers/previews/user_mailer_preview.rb +++ b/spec/mailers/previews/user_mailer_preview.rb @@ -148,7 +148,7 @@ def in_person_verified user, email_address_record, first_name: 'Michael', - enrollment: verified_enrollment, + enrollment: in_person_enrollment, ) end @@ -172,7 +172,8 @@ def in_person_enrollment user: user, profile: unsaveable(Profile.new(user: user)), enrollment_code: '2048702198804358', - created_at: Time.zone.now, + created_at: Time.zone.now - 2.hours, + status_updated_at: Time.zone.now - 1.hour, current_address_matches_id: true, selected_location_details: { 'name' => 'BALTIMORE', @@ -187,18 +188,6 @@ def in_person_enrollment ) end - def verified_enrollment - unsaveable( - InPersonEnrollment.new( - user: user, - profile: unsaveable(Profile.new(user: user)), - status_updated_at: Time.zone.now - 1.hour, - status: :passed, - selected_location_details: { 'name' => 'Baltimore' }.to_json, - ), - ) - end - # Remove #save and #save! to make sure we can't write these made-up records def unsaveable(record) class << record From 77580c7dd3fe9d37de4513b11fd3f7c1c9499d97 Mon Sep 17 00:00:00 2001 From: Tomas Apodaca Date: Sun, 31 Jul 2022 21:32:25 -0700 Subject: [PATCH 13/18] send email in job, remove user's first name --- .../idv/in_person/verified_controller.rb | 20 ------------------- app/jobs/get_usps_proofing_results_job.rb | 13 ++++++++++-- app/mailers/user_mailer.rb | 3 +-- .../user_mailer/in_person_verified.html.erb | 2 +- config/locales/user_mailer/en.yml | 2 +- config/locales/user_mailer/es.yml | 2 +- config/locales/user_mailer/fr.yml | 2 +- config/routes.rb | 2 -- spec/mailers/previews/user_mailer_preview.rb | 1 - 9 files changed, 16 insertions(+), 31 deletions(-) delete mode 100644 app/controllers/idv/in_person/verified_controller.rb diff --git a/app/controllers/idv/in_person/verified_controller.rb b/app/controllers/idv/in_person/verified_controller.rb deleted file mode 100644 index a0ded217ed9..00000000000 --- a/app/controllers/idv/in_person/verified_controller.rb +++ /dev/null @@ -1,20 +0,0 @@ -module Idv - module InPerson - class VerifiedController < ApplicationController - def show - @presenter = ReadyToVerifyPresenter.new(enrollment: enrollment) - end - - def send_verified_email(user, enrollment) - user.confirmed_email_addresses.each do |email_address| - UserMailer.in_person_verified( - user, - email_address, - first_name: user_session.dig(:idv, :pii, :first_name), - enrollment: enrollment, - ).deliver_now_or_later - end - end - end - end -end diff --git a/app/jobs/get_usps_proofing_results_job.rb b/app/jobs/get_usps_proofing_results_job.rb index ad1923828d2..f7eeff09808 100644 --- a/app/jobs/get_usps_proofing_results_job.rb +++ b/app/jobs/get_usps_proofing_results_job.rb @@ -143,8 +143,7 @@ def update_enrollment_status(enrollment, response) enrollment.profile.activate enrollment.update(status: :passed) handle_successful_status_update(enrollment) - # move this somewhere it will trigger to test - send_verified_email(user, enrollment) + send_verified_email(enrollment.user, enrollment) else # Unsupported ID type enrollment.update(status: :failed) @@ -157,4 +156,14 @@ def update_enrollment_status(enrollment, response) handle_unsupported_status(enrollment, response['status']) end end + + def send_verified_email(user, enrollment) + user.confirmed_email_addresses.each do |email_address| + UserMailer.in_person_verified( + user, + email_address, + enrollment: enrollment, + ).deliver_now_or_later + end + end end diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index 955d9599207..11aaff7da55 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -236,9 +236,8 @@ def in_person_ready_to_verify(user, email_address, first_name:, enrollment:) end end - def in_person_verified(user, email_address, first_name:, enrollment:) + def in_person_verified(user, email_address, enrollment:) with_user_locale(user) do - @first_name = first_name @hide_title = true @presenter = Idv::InPerson::VerifiedPresenter.new(enrollment: enrollment) mail( diff --git a/app/views/user_mailer/in_person_verified.html.erb b/app/views/user_mailer/in_person_verified.html.erb index 4c0bf80b6c4..99d93b58969 100644 --- a/app/views/user_mailer/in_person_verified.html.erb +++ b/app/views/user_mailer/in_person_verified.html.erb @@ -8,7 +8,7 @@

<%= message.subject %>

- <%= t('user_mailer.in_person_verified.greeting', name: @first_name) %>
+ <%= t('user_mailer.in_person_verified.greeting') %>
<%= t('user_mailer.in_person_verified.intro', location: @presenter.location, date: @presenter.date) %>

<%= t('user_mailer.in_person_verified.next_sign_in') %>
diff --git a/config/locales/user_mailer/en.yml b/config/locales/user_mailer/en.yml index 3d0c37fdbe6..42e11bce1ac 100644 --- a/config/locales/user_mailer/en.yml +++ b/config/locales/user_mailer/en.yml @@ -106,7 +106,7 @@ en: Post Office near you. subject: You’re ready to verify your identity with %{app_name} in person in_person_verified: - greeting: Hi %{name}, + greeting: Hello, intro: You successfully verified your identity at the %{location} Post Office on %{date}. next_sign_in: Next, click the button or copy the link below to sign in to Login.gov. diff --git a/config/locales/user_mailer/es.yml b/config/locales/user_mailer/es.yml index 0a634849621..285bb45383b 100644 --- a/config/locales/user_mailer/es.yml +++ b/config/locales/user_mailer/es.yml @@ -112,7 +112,7 @@ es: oficina de correos de los Estados Unidos cercana a usted. subject: Está listo para verificar su identidad con %{app_name} en persona in_person_verified: - greeting: 'Hola, %{name}:' + greeting: Hola, intro: El %{date}, verificó correctamente su identidad en la oficina de correos de %{location}. next_sign_in: Luego, haga clic en el botón o copie el enlace que aparece a diff --git a/config/locales/user_mailer/fr.yml b/config/locales/user_mailer/fr.yml index 13e421f5b96..c637e1659d8 100644 --- a/config/locales/user_mailer/fr.yml +++ b/config/locales/user_mailer/fr.yml @@ -115,7 +115,7 @@ fr: de poste des États-Unis près de chez vous. subject: Vous êtes prêt à vérifier votre identité avec %{app_name} en personne in_person_verified: - greeting: 'Bonjour %{name},' + greeting: Bonjour, intro: Vous avez vérifié avec succès votre identité au bureau de poste de %{location} le %{date}. next_sign_in: Ensuite, cliquez sur le bouton ou copiez le lien ci-dessous pour diff --git a/config/routes.rb b/config/routes.rb index ead957c6b93..ee18ff94063 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -329,8 +329,6 @@ get '/in_person' => 'in_person#index' get '/in_person/ready_to_verify' => 'in_person/ready_to_verify#show', as: :in_person_ready_to_verify - get '/in_person/verified' => 'in_person/verified#show', - as: :in_person_verified get '/in_person/usps_locations' => 'in_person/usps_locations#index' put '/in_person/usps_locations' => 'in_person/usps_locations#update' get '/in_person/usps_locations/selected' => 'in_person/usps_locations#show' diff --git a/spec/mailers/previews/user_mailer_preview.rb b/spec/mailers/previews/user_mailer_preview.rb index 702d76eb95d..10702d047c6 100644 --- a/spec/mailers/previews/user_mailer_preview.rb +++ b/spec/mailers/previews/user_mailer_preview.rb @@ -147,7 +147,6 @@ def in_person_verified UserMailer.in_person_verified( user, email_address_record, - first_name: 'Michael', enrollment: in_person_enrollment, ) end From 3330d53f779f754391925b3607054233293cc11e Mon Sep 17 00:00:00 2001 From: Tomas Apodaca Date: Sun, 31 Jul 2022 22:48:04 -0700 Subject: [PATCH 14/18] rename presenter methods --- app/presenters/idv/in_person/verified_presenter.rb | 4 ++-- app/views/user_mailer/in_person_verified.html.erb | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/presenters/idv/in_person/verified_presenter.rb b/app/presenters/idv/in_person/verified_presenter.rb index 7dac2bd98b2..027fdd2ebfd 100644 --- a/app/presenters/idv/in_person/verified_presenter.rb +++ b/app/presenters/idv/in_person/verified_presenter.rb @@ -8,11 +8,11 @@ def initialize(enrollment:) @enrollment = enrollment end - def location + def location_name @enrollment.selected_location_details['name'] end - def date + def formatted_verified_date @enrollment.status_updated_at.in_time_zone(USPS_SERVER_TIMEZONE).strftime( I18n.t('time.formats.event_date'), ) diff --git a/app/views/user_mailer/in_person_verified.html.erb b/app/views/user_mailer/in_person_verified.html.erb index 99d93b58969..6a15ed2cfc0 100644 --- a/app/views/user_mailer/in_person_verified.html.erb +++ b/app/views/user_mailer/in_person_verified.html.erb @@ -9,7 +9,11 @@

<%= t('user_mailer.in_person_verified.greeting') %>
- <%= t('user_mailer.in_person_verified.intro', location: @presenter.location, date: @presenter.date) %>

+ <%= t( + 'user_mailer.in_person_verified.intro', + location: @presenter.location_name, + date: @presenter.formatted_verified_date, + ) %>

<%= t('user_mailer.in_person_verified.next_sign_in') %>

From ed692724616a0290338dc5fa20728b4c8c8f17b2 Mon Sep 17 00:00:00 2001 From: Tomas Apodaca Date: Sun, 31 Jul 2022 22:48:17 -0700 Subject: [PATCH 15/18] tests --- .../get_usps_proofing_results_job_spec.rb | 50 +++++++++++++++++-- spec/mailers/user_mailer_spec.rb | 45 +++++++++++++++++ .../idv/in_person/verified_presenter_spec.rb | 32 ++++++++++++ 3 files changed, 123 insertions(+), 4 deletions(-) create mode 100644 spec/presenters/idv/in_person/verified_presenter_spec.rb diff --git a/spec/jobs/get_usps_proofing_results_job_spec.rb b/spec/jobs/get_usps_proofing_results_job_spec.rb index 9ff78d25b28..7f217d3aae6 100644 --- a/spec/jobs/get_usps_proofing_results_job_spec.rb +++ b/spec/jobs/get_usps_proofing_results_job_spec.rb @@ -17,16 +17,36 @@ let!(:passed_enrollment) { create(:in_person_enrollment, :passed) } let!(:pending_enrollment) do - create(:in_person_enrollment, status: :pending, enrollment_code: SecureRandom.hex(16)) + create( + :in_person_enrollment, + status: :pending, + enrollment_code: SecureRandom.hex(16), + selected_location_details: { name: 'FRIENDSHIP' }, + ) end let!(:pending_enrollment_2) do - create(:in_person_enrollment, status: :pending, enrollment_code: SecureRandom.hex(16)) + create( + :in_person_enrollment, + status: :pending, + enrollment_code: SecureRandom.hex(16), + selected_location_details: { name: 'BALTIMORE' }, + ) end let!(:pending_enrollment_3) do - create(:in_person_enrollment, status: :pending, enrollment_code: SecureRandom.hex(16)) + create( + :in_person_enrollment, + status: :pending, + enrollment_code: SecureRandom.hex(16), + selected_location_details: { name: 'WASHINGTON' }, + ) end let!(:pending_enrollment_4) do - create(:in_person_enrollment, status: :pending, enrollment_code: SecureRandom.hex(16)) + create( + :in_person_enrollment, + status: :pending, + enrollment_code: SecureRandom.hex(16), + selected_location_details: { name: 'ARLINGTON' }, + ) end let(:pending_enrollments) do [ @@ -148,6 +168,28 @@ end end + it 'sends verifed email on 2xx responses with valid JSON' do + stub_request_token + stub_request_passed_proofing_results + + allow(InPersonEnrollment).to receive(:needs_usps_status_check). + and_return([pending_enrollment]) + + mailer = instance_double(ActionMailer::MessageDelivery, deliver_now_or_later: true) + user = pending_enrollment.user + user.email_addresses.each do |email_address| + expect(UserMailer).to receive(:in_person_verified). + with( + user, + email_address, + enrollment: instance_of(InPersonEnrollment), + ). + and_return(mailer) + end + + job.perform(Time.zone.now) + end + it 'receives a non-hash value' do stub_request_token stub_request_proofing_results_with_responses({}) diff --git a/spec/mailers/user_mailer_spec.rb b/spec/mailers/user_mailer_spec.rb index 878879d46c9..4c929362b92 100644 --- a/spec/mailers/user_mailer_spec.rb +++ b/spec/mailers/user_mailer_spec.rb @@ -520,6 +520,51 @@ def expect_email_body_to_have_help_and_contact_links end end + describe '#in_person_ready_to_verify' do + let(:first_name) { 'Michael' } + let!(:enrollment) { + create( + :in_person_enrollment, + :pending, + selected_location_details: { name: 'FRIENDSHIP' }, + status_updated_at: Time.zone.now - 2.hours, + ) + } + + let(:mail) do + UserMailer.in_person_ready_to_verify( + user, + user.email_addresses.first, + first_name: first_name, + enrollment: enrollment, + ) + end + + it_behaves_like 'a system email' + it_behaves_like 'an email that respects user email locale preference' + end + + describe '#in_person_verified' do + let(:enrollment) { + create( + :in_person_enrollment, + selected_location_details: { name: 'FRIENDSHIP' }, + status_updated_at: Time.zone.now - 2.hours, + ) + } + + let(:mail) do + UserMailer.in_person_verified( + user, + user.email_addresses.first, + enrollment: enrollment, + ) + end + + it_behaves_like 'a system email' + it_behaves_like 'an email that respects user email locale preference' + end + def strip_tags(str) ActionController::Base.helpers.strip_tags(str) end diff --git a/spec/presenters/idv/in_person/verified_presenter_spec.rb b/spec/presenters/idv/in_person/verified_presenter_spec.rb new file mode 100644 index 00000000000..26c83dfcb75 --- /dev/null +++ b/spec/presenters/idv/in_person/verified_presenter_spec.rb @@ -0,0 +1,32 @@ +require 'rails_helper' + +RSpec.describe Idv::InPerson::VerifiedPresenter do + let(:location_name) { 'FRIENDSHIP' } + let(:status_updated_at) { described_class::USPS_SERVER_TIMEZONE.parse('2022-07-14T00:00:00Z') } + let!(:enrollment) do + create( + :in_person_enrollment, + :pending, + selected_location_details: { name: location_name }, + ) + end + + subject(:presenter) { described_class.new(enrollment: enrollment) } + + describe '#location_name' do + it 'returns the enrollment location name' do + expect(presenter.location_name).to eq(location_name) + end + end + + describe '#formatted_verified_date' do + around do |example| + Time.use_zone('UTC') { example.run } + end + + it 'returns a formatted verified date' do + enrollment.update(status_updated_at: status_updated_at) + expect(presenter.formatted_verified_date).to eq 'July 13, 2022' + end + end +end From 7cf9bd7dea6bec9afef6f3820c6dae5ba8247ad3 Mon Sep 17 00:00:00 2001 From: Tomas Apodaca Date: Sun, 31 Jul 2022 23:07:24 -0700 Subject: [PATCH 16/18] add changelog changelog: Upcoming Features, In-Person Proofing, Implement "You verified" email notification From 7ecde017c3fbe2e339e7f4e0b5232c547bc46553 Mon Sep 17 00:00:00 2001 From: Tomas Apodaca Date: Mon, 1 Aug 2022 08:44:49 -0700 Subject: [PATCH 17/18] fix i18n test failures --- app/views/user_mailer/in_person_verified.html.erb | 2 +- config/locales/in_person_proofing/en.yml | 1 - config/locales/in_person_proofing/es.yml | 1 - config/locales/in_person_proofing/fr.yml | 1 - config/locales/user_mailer/en.yml | 4 ++-- config/locales/user_mailer/es.yml | 4 ++-- config/locales/user_mailer/fr.yml | 4 ++-- 7 files changed, 7 insertions(+), 10 deletions(-) diff --git a/app/views/user_mailer/in_person_verified.html.erb b/app/views/user_mailer/in_person_verified.html.erb index 6a15ed2cfc0..52a8194c3d5 100644 --- a/app/views/user_mailer/in_person_verified.html.erb +++ b/app/views/user_mailer/in_person_verified.html.erb @@ -14,7 +14,7 @@ location: @presenter.location_name, date: @presenter.formatted_verified_date, ) %>

- <%= t('user_mailer.in_person_verified.next_sign_in') %> + <%= t('user_mailer.in_person_verified.next_sign_in', app_name: APP_NAME) %>

diff --git a/config/locales/in_person_proofing/en.yml b/config/locales/in_person_proofing/en.yml index 2fcf596b9e3..7d39e98f81c 100644 --- a/config/locales/in_person_proofing/en.yml +++ b/config/locales/in_person_proofing/en.yml @@ -88,7 +88,6 @@ en: location: Select a location to verify your ID prepare: Verify your identity in person state_id: Enter the information on your ID - success: You successfully verified your identity with Login.gov update_address: Update your current address update_state_id: Update the information on your ID process: diff --git a/config/locales/in_person_proofing/es.yml b/config/locales/in_person_proofing/es.yml index 7fd03fe3084..dff6dbe5ad1 100644 --- a/config/locales/in_person_proofing/es.yml +++ b/config/locales/in_person_proofing/es.yml @@ -92,7 +92,6 @@ es: location: Seleccione un lugar para verificar su cédula prepare: Verifique su identidad en persona state_id: Ingrese la información de su cédula - success: Verificó correctamente su identidad con Login.gov update_address: Actualizar su dirección actual update_state_id: Actualizar la información de su cédula de identidad process: diff --git a/config/locales/in_person_proofing/fr.yml b/config/locales/in_person_proofing/fr.yml index c544f2dd1c2..6a2454799ff 100644 --- a/config/locales/in_person_proofing/fr.yml +++ b/config/locales/in_person_proofing/fr.yml @@ -96,7 +96,6 @@ fr: location: Sélectionnez un lieu pour vérifier votre identité prepare: Vérifiez votre identité en personne state_id: Saisissez les informations figurant sur votre document d’identité - success: Vous avez vérifié avec succès votre identité avec Login.gov update_address: Mettre à jour votre adresse actuelle update_state_id: Mettre à jour les informations figurant sur votre document d’identité process: diff --git a/config/locales/user_mailer/en.yml b/config/locales/user_mailer/en.yml index 42e11bce1ac..4583d0ca0ee 100644 --- a/config/locales/user_mailer/en.yml +++ b/config/locales/user_mailer/en.yml @@ -109,9 +109,9 @@ en: greeting: Hello, intro: You successfully verified your identity at the %{location} Post Office on %{date}. - next_sign_in: Next, click the button or copy the link below to sign in to Login.gov. + next_sign_in: Next, click the button or copy the link below to sign in to %{app_name}. sign_in: Sign in - subject: You successfully verified your identity with Login.gov + subject: You successfully verified your identity with %{app_name} warning_contact_us_html: If you did not attempt to verify your identity in person, please contact us and sign in to change your password. diff --git a/config/locales/user_mailer/es.yml b/config/locales/user_mailer/es.yml index 285bb45383b..35b2b9b65af 100644 --- a/config/locales/user_mailer/es.yml +++ b/config/locales/user_mailer/es.yml @@ -116,9 +116,9 @@ es: intro: El %{date}, verificó correctamente su identidad en la oficina de correos de %{location}. next_sign_in: Luego, haga clic en el botón o copie el enlace que aparece a - continuación para iniciar sesión en Login.gov. + continuación para iniciar sesión en %{app_name}. sign_in: Iniciar sesión - subject: Verificó correctamente su identidad con Login.gov + subject: Verificó correctamente su identidad con %{app_name} warning_contact_us_html: Si usted no intentó verificar su identidad en persona, por favor, póngase en contacto con nosotros e inicie sesión para cambiar diff --git a/config/locales/user_mailer/fr.yml b/config/locales/user_mailer/fr.yml index c637e1659d8..b336b21951f 100644 --- a/config/locales/user_mailer/fr.yml +++ b/config/locales/user_mailer/fr.yml @@ -119,9 +119,9 @@ fr: intro: Vous avez vérifié avec succès votre identité au bureau de poste de %{location} le %{date}. next_sign_in: Ensuite, cliquez sur le bouton ou copiez le lien ci-dessous pour - vous connecter à Login.gov. + vous connecter à %{app_name}. sign_in: Se connecter - subject: Vous avez vérifié avec succès votre identité avec Login.gov + subject: Vous avez vérifié avec succès votre identité avec %{app_name} warning_contact_us_html: Si vous n’avez pas essayé de vérifier votre identité en personne, veuillez nous contacter et vous connecter pour changer votre mot de From 24f02d3b4eb6beaa1372aed0608ca0787b9fb769 Mon Sep 17 00:00:00 2001 From: Tomas Apodaca Date: Tue, 2 Aug 2022 08:43:42 -0700 Subject: [PATCH 18/18] LG-6434: Create template for "Your identity could not be verified" email, and send when status is set to failed (#6676) * add strings * fr strings added * refactor presenter * add failure email ui * update spec to use refactored presenter * failure email * normalize yaml, split list into steps * email styles: no header image, bold list opener * mover lower part of both emails into a partial * Interpolate app_name Required by tests for single point of update * styling changes Co-authored-by: Shannon Alexander Co-authored-by: Andrew Duthie --- app/assets/stylesheets/email.css.scss | 4 -- app/jobs/get_usps_proofing_results_job.rb | 11 +++++ app/mailers/user_mailer.rb | 12 ++++- ...> verification_results_email_presenter.rb} | 2 +- ...-verification-results-email-lower.html.erb | 38 ++++++++++++++++ .../user_mailer/in_person_failed.html.erb | 20 +++++++++ .../user_mailer/in_person_verified.html.erb | 45 +------------------ config/locales/user_mailer/en.yml | 14 ++++++ config/locales/user_mailer/es.yml | 15 +++++++ config/locales/user_mailer/fr.yml | 17 +++++++ .../get_usps_proofing_results_job_spec.rb | 26 ++++++++++- spec/mailers/previews/user_mailer_preview.rb | 8 ++++ spec/mailers/user_mailer_spec.rb | 21 +++++++++ ...ification_results_email_presenter_spec.rb} | 2 +- 14 files changed, 183 insertions(+), 52 deletions(-) rename app/presenters/idv/in_person/{verified_presenter.rb => verification_results_email_presenter.rb} (92%) create mode 100644 app/views/shared/_in-person-verification-results-email-lower.html.erb create mode 100644 app/views/user_mailer/in_person_failed.html.erb rename spec/presenters/idv/in_person/{verified_presenter_spec.rb => verification_results_email_presenter_spec.rb} (92%) diff --git a/app/assets/stylesheets/email.css.scss b/app/assets/stylesheets/email.css.scss index b2bec51bb6e..b9e1286126f 100644 --- a/app/assets/stylesheets/email.css.scss +++ b/app/assets/stylesheets/email.css.scss @@ -52,10 +52,6 @@ h4 { margin-bottom: 16px; } -.mt-40 { - margin-top: 40px; -} - .button.large.expanded table a { padding: 20px 0; } diff --git a/app/jobs/get_usps_proofing_results_job.rb b/app/jobs/get_usps_proofing_results_job.rb index f7eeff09808..8b3b78bd7dd 100644 --- a/app/jobs/get_usps_proofing_results_job.rb +++ b/app/jobs/get_usps_proofing_results_job.rb @@ -152,6 +152,7 @@ def update_enrollment_status(enrollment, response) when IPP_STATUS_FAILED enrollment.update(status: :failed) handle_failed_status(enrollment, response) + send_failed_email(enrollment.user, enrollment) else handle_unsupported_status(enrollment, response['status']) end @@ -166,4 +167,14 @@ def send_verified_email(user, enrollment) ).deliver_now_or_later end end + + def send_failed_email(user, enrollment) + user.confirmed_email_addresses.each do |email_address| + UserMailer.in_person_failed( + user, + email_address, + enrollment: enrollment, + ).deliver_now_or_later + end + end end diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index 11aaff7da55..ccb2bef93d6 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -239,7 +239,7 @@ def in_person_ready_to_verify(user, email_address, first_name:, enrollment:) def in_person_verified(user, email_address, enrollment:) with_user_locale(user) do @hide_title = true - @presenter = Idv::InPerson::VerifiedPresenter.new(enrollment: enrollment) + @presenter = Idv::InPerson::VerificationResultsEmailPresenter.new(enrollment: enrollment) mail( to: email_address.email, subject: t('user_mailer.in_person_verified.subject', app_name: APP_NAME), @@ -247,6 +247,16 @@ def in_person_verified(user, email_address, enrollment:) end end + def in_person_failed(user, email_address, enrollment:) + with_user_locale(user) do + @presenter = Idv::InPerson::VerificationResultsEmailPresenter.new(enrollment: enrollment) + mail( + to: email_address.email, + subject: t('user_mailer.in_person_failed.subject', app_name: APP_NAME), + ) + end + end + private def email_should_receive_nonessential_notifications?(email) diff --git a/app/presenters/idv/in_person/verified_presenter.rb b/app/presenters/idv/in_person/verification_results_email_presenter.rb similarity index 92% rename from app/presenters/idv/in_person/verified_presenter.rb rename to app/presenters/idv/in_person/verification_results_email_presenter.rb index 027fdd2ebfd..d8970ec9388 100644 --- a/app/presenters/idv/in_person/verified_presenter.rb +++ b/app/presenters/idv/in_person/verification_results_email_presenter.rb @@ -1,6 +1,6 @@ module Idv module InPerson - class VerifiedPresenter + class VerificationResultsEmailPresenter # update to user's time zone when out of pilot USPS_SERVER_TIMEZONE = ActiveSupport::TimeZone['America/New_York'] diff --git a/app/views/shared/_in-person-verification-results-email-lower.html.erb b/app/views/shared/_in-person-verification-results-email-lower.html.erb new file mode 100644 index 00000000000..3ebe6dca242 --- /dev/null +++ b/app/views/shared/_in-person-verification-results-email-lower.html.erb @@ -0,0 +1,38 @@ +
+ + + + + + + +
+ + + + + + +
+ <%= link_to t('user_mailer.in_person_verified.sign_in'), + idv_url, + target: '_blank', + class: 'float-center', + rel: 'noopener' %> +
+
+
+ +

+ <%= link_to idv_url, idv_url, target: '_blank', rel: 'noopener' %> +

+ +
+
+ <%= t( + 'user_mailer.in_person_verified.warning_contact_us_html', + contact_us_url: MarketingSite.contact_url, + sign_in_url: idv_url, + ) + %> +
diff --git a/app/views/user_mailer/in_person_failed.html.erb b/app/views/user_mailer/in_person_failed.html.erb new file mode 100644 index 00000000000..f34e8718abb --- /dev/null +++ b/app/views/user_mailer/in_person_failed.html.erb @@ -0,0 +1,20 @@ +
+ <%= t('user_mailer.in_person_verified.greeting') %>
+

+ <%= t( + 'user_mailer.in_person_failed.intro', + location: @presenter.location_name, + date: @presenter.formatted_verified_date, + ) %> +

+

+ <%= t('user_mailer.in_person_failed.body', app_name: APP_NAME) %>

+

+ <%= t('user_mailer.in_person_failed.verifying_identity') %>
+
    +
  • <%= t('user_mailer.in_person_failed.verifying_step_not_expired') %>
  • +
  • <%= t('user_mailer.in_person_failed.verifying_step_proof_of_address') %>
  • +
+
+ +<%= render 'shared/in-person-verification-results-email-lower' %> diff --git a/app/views/user_mailer/in_person_verified.html.erb b/app/views/user_mailer/in_person_verified.html.erb index 52a8194c3d5..8ffd02a9cce 100644 --- a/app/views/user_mailer/in_person_verified.html.erb +++ b/app/views/user_mailer/in_person_verified.html.erb @@ -6,8 +6,7 @@ class: 'float-center padding-bottom-4', ) %>

<%= message.subject %>

-

-

+

<%= t('user_mailer.in_person_verified.greeting') %>
<%= t( 'user_mailer.in_person_verified.intro', @@ -15,46 +14,6 @@ date: @presenter.formatted_verified_date, ) %>

<%= t('user_mailer.in_person_verified.next_sign_in', app_name: APP_NAME) %> -

-

- -
- - - - - - - -
- - - - - - -
- <%= link_to t('user_mailer.in_person_verified.sign_in'), - idv_url, - target: '_blank', - class: 'float-center', - rel: 'noopener' %> -
-
-
- -

- <%= link_to idv_url, idv_url, target: '_blank', rel: 'noopener' %>

-

-
-<%= t( - 'user_mailer.in_person_verified.warning_contact_us_html', - contact_us_url: MarketingSite.contact_url, - sign_in_url: idv_url, - ) -%> - - -

+<%= render 'shared/in-person-verification-results-email-lower' %> diff --git a/config/locales/user_mailer/en.yml b/config/locales/user_mailer/en.yml index 4583d0ca0ee..634f1ad81aa 100644 --- a/config/locales/user_mailer/en.yml +++ b/config/locales/user_mailer/en.yml @@ -100,6 +100,20 @@ en: %{app_name} %{help_link} or %{contact_link}. subject: Email address deleted help_link_text: Help Center + in_person_failed: + body: Click the button or copy the link below to try verifying your identity + online again through %{app_name}. If you are still experiencing issues, + please contact the agency you are trying to access. + intro: Your identity could not be verified at the %{location} Post Office on + %{date}. + subject: Your identity could not be verified in person + verifying_identity: 'When verifying your identity:' + verifying_step_not_expired: 'Your state-issued ID or driver’s license must not + be expired. We do not currently accept any other forms of + identification, such as passports and military IDs.' + verifying_step_proof_of_address: 'If you try to verify your identity in person + again, you need to bring a valid proof of address if your current + address is different than the address on your ID.' in_person_ready_to_verify: greeting: Hi %{name}, intro: Here are the details to verify your identity in person at a United States diff --git a/config/locales/user_mailer/es.yml b/config/locales/user_mailer/es.yml index 35b2b9b65af..9f0634ed76a 100644 --- a/config/locales/user_mailer/es.yml +++ b/config/locales/user_mailer/es.yml @@ -106,6 +106,21 @@ es: %{app_name} %{help_link} o el %{contact_link}. subject: Dirección de correo electrónico eliminada help_link_text: Centro de Ayuda + in_person_failed: + body: Haga clic en el botón o copie el enlace siguiente para volver a intentar + verificar su identidad en línea con %{app_name}. Si sigue teniendo + problemas, póngase en contacto con la agencia a la que intenta acceder. + intro: El %{date}, no se pudo verificar su identidad en la oficina de correos de + %{location}. + subject: No se pudo verificar su identidad en persona + verifying_identity: 'Al verificar su identidad:' + verifying_step_not_expired: Su documento de identidad o permiso de conducir + emitido por el estado debe estar vigente. Por el momento, no aceptamos + otras formas de identificación, como pasaportes o cartillas militares. + verifying_step_proof_of_address: Si vuelve a intentar verificar su identidad en + persona, deberá llevar un comprobante de domicilio vigente si su + dirección actual es distinta de la que aparece en su documento de + identidad. in_person_ready_to_verify: greeting: 'Hola, %{name}:' intro: Estos son los detalles para verificar su identidad en persona en una diff --git a/config/locales/user_mailer/fr.yml b/config/locales/user_mailer/fr.yml index b336b21951f..1e72e5204ce 100644 --- a/config/locales/user_mailer/fr.yml +++ b/config/locales/user_mailer/fr.yml @@ -109,6 +109,23 @@ fr: veuillez visiter le %{help_link} de %{app_name} ou %{contact_link}. subject: Adresse email supprimée help_link_text: Centre d’aide + in_person_failed: + body: Cliquez sur le bouton ou copiez le lien ci-dessous pour essayer de + vérifier à nouveau votre identité en ligne par le biais de %{app_name}. + Si vous rencontrez toujours des problèmes, veuillez contacter l’agence à + laquelle vous essayez d’accéder. + intro: Votre identité n’a pas pu être vérifiée au bureau de poste de %{location} + le %{date}. + subject: Votre identité n’a pas pu être vérifiée en personne + verifying_identity: 'Lors de la vérification de votre identité :' + verifying_step_not_expired: Votre carte d’identité ou votre permis de conduire + délivré par l’État ne doit pas être périmé. Nous n’acceptons + actuellement aucune autre forme d’identification, comme les passeports + et les cartes d’identité militaires. + verifying_step_proof_of_address: Si vous tentez à nouveau de vérifier votre + identité en personne, vous devez apporter un justificatif de domicile + valable si votre adresse actuelle est différente de celle figurant sur + votre pièce d’identité. in_person_ready_to_verify: greeting: Bonjour %{name}, intro: Voici les détails pour vérifier votre identité en personne dans un bureau diff --git a/spec/jobs/get_usps_proofing_results_job_spec.rb b/spec/jobs/get_usps_proofing_results_job_spec.rb index 7f217d3aae6..5500a41e826 100644 --- a/spec/jobs/get_usps_proofing_results_job_spec.rb +++ b/spec/jobs/get_usps_proofing_results_job_spec.rb @@ -113,7 +113,7 @@ ) end - it 'logs details about failed requests' do + it 'logs details about a failed proofing' do stub_request_token stub_request_failed_proofing_results @@ -141,7 +141,29 @@ ) end - it 'updates enrollment records and activates profiles on 2xx responses with valid JSON' do + it 'sends proofing failed email on response with failed status' do + stub_request_token + stub_request_failed_proofing_results + + allow(InPersonEnrollment).to receive(:needs_usps_status_check). + and_return([pending_enrollment]) + + mailer = instance_double(ActionMailer::MessageDelivery, deliver_now_or_later: true) + user = pending_enrollment.user + user.email_addresses.each do |email_address| + expect(UserMailer).to receive(:in_person_failed). + with( + user, + email_address, + enrollment: instance_of(InPersonEnrollment), + ). + and_return(mailer) + end + + job.perform(Time.zone.now) + end + + it 'updates enrollment records and activates profiles on response with passed status' do stub_request_token stub_request_passed_proofing_results diff --git a/spec/mailers/previews/user_mailer_preview.rb b/spec/mailers/previews/user_mailer_preview.rb index 10702d047c6..d4535666b41 100644 --- a/spec/mailers/previews/user_mailer_preview.rb +++ b/spec/mailers/previews/user_mailer_preview.rb @@ -151,6 +151,14 @@ def in_person_verified ) end + def in_person_failed + UserMailer.in_person_failed( + user, + email_address_record, + enrollment: in_person_enrollment, + ) + end + private def user diff --git a/spec/mailers/user_mailer_spec.rb b/spec/mailers/user_mailer_spec.rb index 4c929362b92..feb9d2188fe 100644 --- a/spec/mailers/user_mailer_spec.rb +++ b/spec/mailers/user_mailer_spec.rb @@ -565,6 +565,27 @@ def expect_email_body_to_have_help_and_contact_links it_behaves_like 'an email that respects user email locale preference' end + describe '#in_person_failed' do + let(:enrollment) { + create( + :in_person_enrollment, + selected_location_details: { name: 'FRIENDSHIP' }, + status_updated_at: Time.zone.now - 2.hours, + ) + } + + let(:mail) do + UserMailer.in_person_failed( + user, + user.email_addresses.first, + enrollment: enrollment, + ) + end + + it_behaves_like 'a system email' + it_behaves_like 'an email that respects user email locale preference' + end + def strip_tags(str) ActionController::Base.helpers.strip_tags(str) end diff --git a/spec/presenters/idv/in_person/verified_presenter_spec.rb b/spec/presenters/idv/in_person/verification_results_email_presenter_spec.rb similarity index 92% rename from spec/presenters/idv/in_person/verified_presenter_spec.rb rename to spec/presenters/idv/in_person/verification_results_email_presenter_spec.rb index 26c83dfcb75..8d05000ea47 100644 --- a/spec/presenters/idv/in_person/verified_presenter_spec.rb +++ b/spec/presenters/idv/in_person/verification_results_email_presenter_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -RSpec.describe Idv::InPerson::VerifiedPresenter do +RSpec.describe Idv::InPerson::VerificationResultsEmailPresenter do let(:location_name) { 'FRIENDSHIP' } let(:status_updated_at) { described_class::USPS_SERVER_TIMEZONE.parse('2022-07-14T00:00:00Z') } let!(:enrollment) do