Browse Source

fix bulk upload email timestamp formatting (#1426)

pull/1431/head
Phil Lee 2 years ago committed by GitHub
parent
commit
74a75d3d3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      app/mailers/bulk_upload_mailer.rb
  2. 4
      spec/mailers/bulk_upload_mailer_spec.rb

4
app/mailers/bulk_upload_mailer.rb

@ -26,7 +26,7 @@ class BulkUploadMailer < NotifyMailer
{
title:,
filename: bulk_upload.filename,
upload_timestamp: bulk_upload.created_at,
upload_timestamp: bulk_upload.created_at.to_fs(:govuk_date_and_time),
success_description:,
logs_link: url,
},
@ -112,7 +112,7 @@ class BulkUploadMailer < NotifyMailer
BULK_UPLOAD_FAILED_SERVICE_ERROR_TEMPLATE_ID,
{
filename: bulk_upload.filename,
upload_timestamp: bulk_upload.created_at,
upload_timestamp: bulk_upload.created_at.to_fs(:govuk_date_and_time),
lettings_or_sales: bulk_upload.log_type,
year_combo: bulk_upload.year_combo,
errors: errors.map { |e| "- #{e}" }.join("\n"),

4
spec/mailers/bulk_upload_mailer_spec.rb

@ -52,7 +52,7 @@ RSpec.describe BulkUploadMailer do
personalisation: {
title: "You’ve successfully uploaded 0 logs",
filename: bulk_upload.filename,
upload_timestamp: bulk_upload.created_at,
upload_timestamp: bulk_upload.created_at.to_fs(:govuk_date_and_time),
success_description: "The lettings 2022/23 data you uploaded has been checked. The 0 logs you uploaded are now complete.",
logs_link: lettings_logs_url,
},
@ -69,7 +69,7 @@ RSpec.describe BulkUploadMailer do
template_id: described_class::BULK_UPLOAD_FAILED_SERVICE_ERROR_TEMPLATE_ID,
personalisation: {
filename: bulk_upload.filename,
upload_timestamp: bulk_upload.created_at,
upload_timestamp: bulk_upload.created_at.to_fs(:govuk_date_and_time),
lettings_or_sales: bulk_upload.log_type,
year_combo: bulk_upload.year_combo,
errors: "- foo\n- bar",

Loading…
Cancel
Save