-
Notifications
You must be signed in to change notification settings - Fork 166
LG-7187: Send Customer Experience Follow-up Email for In-Person Proofing #7046
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 14 commits
b72147a
44b903c
ed5d48c
7ed9379
7e019a0
65e9a8f
f00702a
b648e0c
f8cee4c
9901546
49ebd45
7e3a060
ec79ee8
2ddaecb
09a5fd0
9fc5791
b5601ad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,6 +18,7 @@ def show | |
| def update | ||
| track_completion_event('agency-page') | ||
| update_verified_attributes | ||
| send_in_person_completion_survey | ||
| if decider.go_back_to_mobile_app? | ||
| sign_user_out_and_instruct_to_go_back_to_mobile_app | ||
| else | ||
|
|
@@ -89,5 +90,14 @@ def pii | |
| pii_string = Pii::Cacher.new(current_user, user_session).fetch_string | ||
| JSON.parse(pii_string || '{}', symbolize_names: true) | ||
| end | ||
|
|
||
| def send_in_person_completion_survey | ||
| return unless sp_session_ial == 2 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what is the significance of 2 here?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This requires that the user be sharing attributes verified via IAL2 with the partner in order to trigger the survey email (as opposed to IAL1 or IAL3). Note that this current usage excludes the IAL "strict" mode. This value is passed as an attribute from the partner. The value then gets mapped to the IAL constants (in a session value) during authentication. |
||
|
|
||
| Idv::InPerson::CompletionSurveySender.send_completion_survey( | ||
| current_user, | ||
| current_sp.issuer, | ||
| ) | ||
| end | ||
| end | ||
| end | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| module Idv | ||
| module InPerson | ||
| class CompletionSurveySender | ||
| ## | ||
| # @param [User] user | ||
| # @param [String] issuer | ||
| def self.send_completion_survey(user, issuer) | ||
|
svalexander marked this conversation as resolved.
|
||
| return unless user.should_receive_in_person_completion_survey?(issuer) | ||
|
|
||
| user.confirmed_email_addresses.each do |email_address| | ||
| UserMailer.in_person_completion_survey( | ||
| user, | ||
| email_address, | ||
| ).deliver_now_or_later | ||
| end | ||
|
|
||
| user.mark_in_person_completion_survey_sent(issuer) | ||
| end | ||
| end | ||
| end | ||
| end | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| <p class="margin-bottom-3"><%= t('user_mailer.in_person_completion_survey.body.greeting') %></p> | ||
| <p class="margin-bottom-3"><%= t('user_mailer.in_person_completion_survey.body.thanks', app_name: APP_NAME) %></p> | ||
| <p class="margin-bottom-3"><%= t('user_mailer.in_person_completion_survey.body.intent') %></p> | ||
| <p class="margin-bottom-3"><%= t('user_mailer.in_person_completion_survey.body.request_description') %></p> | ||
| <p class="margin-bottom-3"><%= t( | ||
| 'user_mailer.in_person_completion_survey.body.privacy_html', | ||
| url: @privacy_url, | ||
| ) %></p> | ||
| <p class="margin-bottom-4"><%= t('user_mailer.in_person_completion_survey.body.cta.callout') %></p> | ||
|
aduth marked this conversation as resolved.
Outdated
|
||
|
|
||
| <table class="button expanded large radius"> | ||
| <tbody> | ||
| <tr> | ||
| <td> | ||
| <table> | ||
| <tbody> | ||
| <tr> | ||
| <td> | ||
| <center> | ||
| <%= link_to t('user_mailer.in_person_completion_survey.body.cta.label'), | ||
| @survey_url, | ||
| target: '_blank', | ||
| class: 'float-center', | ||
| align: 'center', | ||
| rel: 'noopener', | ||
| style: 'padding: 1rem 0' %> | ||
|
aduth marked this conversation as resolved.
Outdated
|
||
| </center> | ||
| </td> | ||
| </tr> | ||
| </tbody> | ||
| </table> | ||
| </td> | ||
| <td class="expander"> | ||
| </td> | ||
| </tr> | ||
| </tbody> | ||
| </table> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| class AddFollowUpSurveySentToInPersonEnrollment < ActiveRecord::Migration[7.0] | ||
| def change | ||
| add_column :in_person_enrollments, :follow_up_survey_sent, :boolean, default: false | ||
| end | ||
| end |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ | |
|
|
||
| RSpec.describe 'In Person Proofing', js: true do | ||
| include IdvStepHelper | ||
| include SpAuthHelper | ||
| include InPersonHelper | ||
|
|
||
| before do | ||
|
|
@@ -176,6 +177,29 @@ | |
| end | ||
| end | ||
|
|
||
| context 'after in-person proofing is completed and passed for a partner' do | ||
| let(:sp) { nil } | ||
| before do | ||
| create_in_person_ial2_account_go_back_to_sp_and_sign_out(sp) | ||
| end | ||
|
|
||
| [ | ||
| :oidc, | ||
| :saml, | ||
| ].each do |service_provider| | ||
|
Comment on lines
+186
to
+189
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you think there's value in exercising this for both SP protocols, or could we just do one? Reason I ask is that these tests can be quite slow to run.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's valuable to have at least one IPP feature test covering both SP protocols, and to my knowledge this is the only one. |
||
| context "using #{service_provider}" do | ||
| let(:sp) { service_provider } | ||
| it 'sends a survey when they share information with that partner', | ||
| allow_browser_log: true do | ||
| expect(last_email.html_part.body). | ||
| to have_selector( | ||
| "a[href='#{IdentityConfig.store.in_person_completion_survey_url}']", | ||
| ) | ||
| end | ||
| end | ||
| end | ||
| end | ||
|
|
||
| context 'with hybrid document capture' do | ||
| before do | ||
| allow(FeatureManagement).to receive(:doc_capture_polling_enabled?).and_return(true) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.