Skip to content
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

Disable user profile email in form 40-0247 #15818

Merged
merged 1 commit into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def form_specific_data
when 'vba_40_0247'
return unless Flipper.enabled?(:form40_0247_confirmation_email)

form40_0247_contact_info(@form_data)
[@form_data['applicant_email'], @form_data.dig('applicant_full_name', 'first')]
else
[nil, nil]
end
Expand Down Expand Up @@ -131,11 +131,5 @@ def form21_10210_contact_info(form_data)
[nil, nil]
end
end

def form40_0247_contact_info(form_data)
# email address is optional field
# when email is not entered, use current user's email
[form_data['applicant_email'].presence || @user&.va_profile_email, form_data.dig('applicant_full_name', 'first')]
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
context 'when user is signed in' do
let(:user) { create(:user, :loa3) }

it 'sends the confirmation email' do
it 'does not send the confirmation email' do
allow(VANotify::EmailJob).to receive(:perform_async)
expect(data['applicant_email']).to be_nil

Expand All @@ -157,15 +157,7 @@

subject.send

expect(VANotify::EmailJob).to have_received(:perform_async).with(
user.va_profile_email,
'form40_0247_confirmation_email_template_id',
{
'first_name' => 'JOE',
'date_submitted' => Time.zone.today.strftime('%B %d, %Y'),
'confirmation_number' => 'confirmation_number'
}
)
expect(VANotify::EmailJob).not_to have_received(:perform_async)
end
end

Expand Down
Loading