Skip to content

Commit

Permalink
Dasherize some headers
Browse files Browse the repository at this point in the history
  • Loading branch information
inulty-dfe committed May 21, 2024
1 parent fa1a09b commit bf88e41
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/email_log_interceptor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ def self.delivering_email(mail)
body: mail.body.encoded,
notify_reference:,
application_form_id: mail.header['application_form_id']&.value,
mailer: mail.header['rails_mailer'].value,
mail_template: mail.header['rails_mail_template'].value,
mailer: mail.header['rails-mailer']&.first&.value,
mail_template: mail.header['rails-mail-template']&.first&.value,
delivery_status: mail.perform_deliveries ? 'pending' : 'skipped',
)

Expand Down
6 changes: 3 additions & 3 deletions spec/services/send_new_application_email_to_provider_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
training_provider_email = ActionMailer::Base.deliveries.find { |e| e.header['to'].value == training_provider_user.email_address }
ratifying_provider_email = ActionMailer::Base.deliveries.find { |e| e.header['to'].value == ratifying_provider_user.email_address }

expect(training_provider_email['rails-mail-template'].value).to eq('application_submitted')
expect(ratifying_provider_email['rails-mail-template'].value).to eq('application_submitted')
expect(training_provider_email['rails-mail-template'].first.value).to eq('application_submitted')
expect(ratifying_provider_email['rails-mail-template'].first.value).to eq('application_submitted')
end

it 'sends a different email when the candidate supplied safeguarding information' do
Expand All @@ -32,7 +32,7 @@

described_class.new(application_choice: choice).call

email = ActionMailer::Base.deliveries.find { |e| e.header['rails_mail_template'].value == 'application_submitted_with_safeguarding_issues' }
email = ActionMailer::Base.deliveries.find { |e| e.header['rails-mail-template'].first.value == 'application_submitted_with_safeguarding_issues' }

expect(email).to be_present
end
Expand Down

0 comments on commit bf88e41

Please sign in to comment.