diff --git a/modules/simple_forms_api/app/services/simple_forms_api/notification_email.rb b/modules/simple_forms_api/app/services/simple_forms_api/notification_email.rb index aead2c5aeeb..fed3cd12bd3 100644 --- a/modules/simple_forms_api/app/services/simple_forms_api/notification_email.rb +++ b/modules/simple_forms_api/app/services/simple_forms_api/notification_email.rb @@ -270,7 +270,9 @@ def get_first_name_from_user def get_personalization(first_name) if @form_number.start_with? 'vba_21_0966' - default_personalization(first_name).merge(form21_0966_personalization) + personalization = default_personalization(first_name).merge(form21_0966_personalization) + personalization.except!('lighthouse_updated_at') unless lighthouse_updated_at + personalization else default_personalization(first_name) end diff --git a/modules/simple_forms_api/spec/requests/simple_forms_api/v1/simple_forms_spec.rb b/modules/simple_forms_api/spec/requests/simple_forms_api/v1/simple_forms_spec.rb index 5ae60c00e99..cd1b8cfc624 100644 --- a/modules/simple_forms_api/spec/requests/simple_forms_api/v1/simple_forms_spec.rb +++ b/modules/simple_forms_api/spec/requests/simple_forms_api/v1/simple_forms_spec.rb @@ -916,7 +916,6 @@ 'first_name' => 'Veteran', 'date_submitted' => Time.zone.today.strftime('%B %d, %Y'), 'confirmation_number' => confirmation_number, - 'lighthouse_updated_at' => nil, 'intent_to_file_benefits' => 'survivors pension benefits', 'intent_to_file_benefits_links' => '[Apply for DIC, Survivors Pension, and/or Accrued Benefits ' \ '(VA Form 21P-534EZ)](https://www.va.gov/find-forms/about-form-21p-534ez/)', @@ -942,7 +941,6 @@ 'first_name' => 'Veteran', 'date_submitted' => Time.zone.today.strftime('%B %d, %Y'), 'confirmation_number' => confirmation_number, - 'lighthouse_updated_at' => nil, 'intent_to_file_benefits' => 'survivors pension benefits', 'intent_to_file_benefits_links' => '[Apply for DIC, Survivors Pension, and/or Accrued Benefits ' \ '(VA Form 21P-534EZ)](https://www.va.gov/find-forms/about-form-21p-534ez/)', diff --git a/modules/simple_forms_api/spec/services/notification_email_spec.rb b/modules/simple_forms_api/spec/services/notification_email_spec.rb index 09f93898f89..a817c0c946d 100644 --- a/modules/simple_forms_api/spec/services/notification_email_spec.rb +++ b/modules/simple_forms_api/spec/services/notification_email_spec.rb @@ -785,6 +785,7 @@ end describe '21_0966' do + let(:lighthouse_updated_at) { 1.day.ago } let(:date_submitted) { Time.zone.today.strftime('%B %d, %Y') } let(:data) do fixture_path = Rails.root.join( @@ -794,7 +795,7 @@ end let(:config) do { form_data: data, form_number: 'vba_21_0966', - confirmation_number: 'confirmation_number', date_submitted: } + confirmation_number: 'confirmation_number', date_submitted:, lighthouse_updated_at: } end let(:user) { create(:user, :loa3) } @@ -812,7 +813,7 @@ 'first_name' => 'Veteran', 'date_submitted' => date_submitted, 'confirmation_number' => 'confirmation_number', - 'lighthouse_updated_at' => nil, + 'lighthouse_updated_at' => lighthouse_updated_at, 'intent_to_file_benefits' => 'survivors pension benefits', 'intent_to_file_benefits_links' => '[Apply for DIC, Survivors Pension, and/or Accrued Benefits ' \ '(VA Form 21P-534EZ)](https://www.va.gov/find-forms/about-form-21p-534ez/)', @@ -841,7 +842,7 @@ 'first_name' => 'I', 'date_submitted' => date_submitted, 'confirmation_number' => 'confirmation_number', - 'lighthouse_updated_at' => nil, + 'lighthouse_updated_at' => lighthouse_updated_at, 'intent_to_file_benefits' => 'survivors pension benefits', 'intent_to_file_benefits_links' => '[Apply for DIC, Survivors Pension, and/or Accrued Benefits ' \ '(VA Form 21P-534EZ)](https://www.va.gov/find-forms/about-form-21p-534ez/)', @@ -884,7 +885,6 @@ 'first_name' => 'Veteran', 'date_submitted' => date_submitted, 'confirmation_number' => 'confirmation_number', - 'lighthouse_updated_at' => nil, 'intent_to_file_benefits' => 'survivors pension benefits', 'intent_to_file_benefits_links' => '[Apply for DIC, Survivors Pension, and/or Accrued Benefits ' \ '(VA Form 21P-534EZ)](https://www.va.gov/find-forms/about-form-21p-534ez/)', @@ -913,7 +913,6 @@ 'first_name' => 'I', 'date_submitted' => date_submitted, 'confirmation_number' => 'confirmation_number', - 'lighthouse_updated_at' => nil, 'intent_to_file_benefits' => 'survivors pension benefits', 'intent_to_file_benefits_links' => '[Apply for DIC, Survivors Pension, and/or Accrued Benefits ' \ '(VA Form 21P-534EZ)](https://www.va.gov/find-forms/about-form-21p-534ez/)',