LG-6896: Send 'fraud suspected' in-person proofing failed email#7013
LG-6896: Send 'fraud suspected' in-person proofing failed email#7013svalexander merged 23 commits intomainfrom
Conversation
aduth
left a comment
There was a problem hiding this comment.
Couple minor comments, but LGTM overall 👍
|
|
||
| enrollment.update(status: :failed) | ||
| send_failed_email(enrollment.user, enrollment) | ||
| if response['fraudSuspected'] == true |
There was a problem hiding this comment.
Since the value is already a boolean, I think we could leave out the "equals" comparison.
| if response['fraudSuspected'] == true | |
| if response['fraudSuspected'] |
| "status": "In-person failed", | ||
| "proofingPostOffice": "WILKES BARRE", | ||
| "proofingCity": "WILKES BARRE", | ||
| "proofingState": "PA", | ||
| "enrollmentCode": "2090002197604352", | ||
| "primaryIdType": "Uniformed Services identification card", | ||
| "transactionStartDateTime": "12/17/2020 033855", | ||
| "transactionEndDateTime": "12/17/2020 034055", | ||
| "secondaryIdType": "Deed of Trust", | ||
| "failureReason": "Clerk indicates that ID name or address does not match source data.", | ||
| "fraudSuspected": true, | ||
| "proofingConfirmationNumber": "350040248346707", | ||
| "ippAssuranceLevel": "1.5" | ||
| } | ||
|
No newline at end of file |
There was a problem hiding this comment.
Minor whitespace suggestions:
| "status": "In-person failed", | |
| "proofingPostOffice": "WILKES BARRE", | |
| "proofingCity": "WILKES BARRE", | |
| "proofingState": "PA", | |
| "enrollmentCode": "2090002197604352", | |
| "primaryIdType": "Uniformed Services identification card", | |
| "transactionStartDateTime": "12/17/2020 033855", | |
| "transactionEndDateTime": "12/17/2020 034055", | |
| "secondaryIdType": "Deed of Trust", | |
| "failureReason": "Clerk indicates that ID name or address does not match source data.", | |
| "fraudSuspected": true, | |
| "proofingConfirmationNumber": "350040248346707", | |
| "ippAssuranceLevel": "1.5" | |
| } | |
| "status": "In-person failed", | |
| "proofingPostOffice": "WILKES BARRE", | |
| "proofingCity": "WILKES BARRE", | |
| "proofingState": "PA", | |
| "enrollmentCode": "2090002197604352", | |
| "primaryIdType": "Uniformed Services identification card", | |
| "transactionStartDateTime": "12/17/2020 033855", | |
| "transactionEndDateTime": "12/17/2020 034055", | |
| "secondaryIdType": "Deed of Trust", | |
| "failureReason": "Clerk indicates that ID name or address does not match source data.", | |
| "fraudSuspected": true, | |
| "proofingConfirmationNumber": "350040248346707", | |
| "ippAssuranceLevel": "1.5" | |
| } |
tomas-nava
left a comment
There was a problem hiding this comment.
some suggestions to fix failing tests!
app/mailers/user_mailer.rb
Outdated
| ) | ||
| mail( | ||
| to: email_address.email, | ||
| subject: t('user_mailer.in_person_failed_suspected_fraud.subject', app_name: APP_NAME), |
There was a problem hiding this comment.
| subject: t('user_mailer.in_person_failed_suspected_fraud.subject', app_name: APP_NAME), | |
| subject: t('user_mailer.in_person_failed_suspected_fraud.subject'), |
There's no app_name variable in this translation.
| <%= t( | ||
| 'user_mailer.in_person_failed_suspected_fraud.body.intro', | ||
| location: @presenter.location_name, | ||
| date: @presenter.formatted_verified_date, | ||
| ) %> |
There was a problem hiding this comment.
| <%= t( | |
| 'user_mailer.in_person_failed_suspected_fraud.body.intro', | |
| location: @presenter.location_name, | |
| date: @presenter.formatted_verified_date, | |
| ) %> | |
| <%= t( | |
| 'user_mailer.in_person_failed_suspected_fraud.body.intro', | |
| app_name: APP_NAME, | |
| location: @presenter.location_name, | |
| date: @presenter.formatted_verified_date, | |
| ) %> |
We should pass app_name here and use it instead of Login.gov in the translations
config/locales/user_mailer/en.yml
Outdated
| href="%{help_center_url}">visit our Help Center</a> or reach out to | ||
| the agency you are trying to access. | ||
| intro: We understand that you were attempting to verify your identity through | ||
| Login.gov, however your identity could not be verified at the |
There was a problem hiding this comment.
| Login.gov, however your identity could not be verified at the | |
| %{app_name}, however your identity could not be verified at the |
We should always use app_name instead of hardcoding Login.gov
config/locales/user_mailer/es.yml
Outdated
| href="%{help_center_url}">visitar nuestro Centro de Ayuda</a> o | ||
| ponerse en contacto con la agencia a la que intenta acceder. | ||
| intro: Entendemos que estaba intentando verificar su identidad a través de | ||
| Login.gov, sin embargo, su identidad no pudo ser verificada en la |
There was a problem hiding this comment.
| Login.gov, sin embargo, su identidad no pudo ser verificada en la | |
| %{app_name}, sin embargo, su identidad no pudo ser verificada en la |
We should always use app_name instead of hardcoding Login.gov
config/locales/user_mailer/fr.yml
Outdated
| href="%{help_center_url}">consulter notre centre d’aide</a> ou | ||
| contacter l’agence à laquelle vous essayez d’accéder. | ||
| intro: Nous comprenons que vous avez tenté de vérifier votre identité par le | ||
| biais de Login.gov, mais votre identité n’a pas pu être vérifiée au |
There was a problem hiding this comment.
| biais de Login.gov, mais votre identité n’a pas pu être vérifiée au | |
| biais de %{app_name}, mais votre identité n’a pas pu être vérifiée au |
We should always use app_name instead of hardcoding Login.gov
Ticket
What: This pr sends a delayed failure email to a user who has completed in person proofing and fraudSuspected was true.
How: Added a new email template for this failure version as well as updated the usps job. Because there are now two versions of the failure email we need to check the value of status within handle_failed_status().
Note: fraudSuspected is a string according to the api documentation. There are some mock files (perhaps others) where it is a boolean, we should address this in another ticket.
Testing the email
To preview the email visit http://localhost:3000/rails/mailers/user_mailer/in_person_failed_fraud.html?locale=en
Or to trigger an email sent to mailcatcher update response on lines 86-88 to
response = JSON.parse(UspsInPersonProofing::Mock::Fixtures.request_failed_suspected_fraud_proofing_results_response)En version
Es version
Fr version