@ -83,16 +83,24 @@ class BulkUploadMailer < NotifyMailer
)
)
end
end
def send_bulk_upload_with_errors_mail ( user , bulk_upload )
def send_bulk_upload_with_errors_mail ( bulk_upload : )
n = bulk_upload . logs . where . not ( status : %w[ completed ] ) . count
n_logs = pluralize ( n , " log " )
title = " We found #{ n_logs } with errors "
error_description = " We created logs from your #{ bulk_upload . year_combo } #{ bulk_upload . log_type } data. There was a problem with #{ n } of the logs. Click the below link to fix these logs. "
send_email (
send_email (
user . email ,
bulk_upload . user . email ,
BULK_UPLOAD_WITH_ERRORS_TEMPLATE_ID ,
BULK_UPLOAD_WITH_ERRORS_TEMPLATE_ID ,
{
{
title : " [ #{ bulk_upload } title] " ,
title : ,
filename : " [ #{ bulk_upload } filename] " ,
filename : bulk_upload . filename ,
upload_timestamp : " [ #{ bulk_upload } upload_timestamp] " ,
upload_timestamp : bulk_upload . created_at . to_fs ( :govuk_date_and_time ) ,
error_description : " [ #{ bulk_upload } error_description] " ,
error_description : ,
summary_report_link : " [ #{ bulk_upload } summary_report_link] " ,
summary_report_link : summary_bulk_upload_lettings_result_url ( bulk_upload ) ,
} ,
} ,
)
)
end
end