Browse Source

feat: add methods for remaining bulk upload emails

pull/1244/head
Sam Seed 3 years ago
parent
commit
6ec391a61a
  1. 46
      app/mailers/bulk_upload_mailer.rb

46
app/mailers/bulk_upload_mailer.rb

@ -1,7 +1,24 @@
class BulkUploadMailer < NotifyMailer class BulkUploadMailer < NotifyMailer
BULK_UPLOAD_COMPLETE_TEMPLATE_ID = "83279578-c890-4168-838b-33c9cf0dc9f0".freeze
BULK_UPLOAD_FAILED_CSV_ERRORS_TEMPLATE_ID = "e27abcd4-5295-48c2-b127-e9ee4b781b75".freeze BULK_UPLOAD_FAILED_CSV_ERRORS_TEMPLATE_ID = "e27abcd4-5295-48c2-b127-e9ee4b781b75".freeze
BULK_UPLOAD_FAILED_FILE_SETUP_ERROR_TEMPLATE_ID = "24c9f4c7-96ad-470a-ba31-eb51b7cbafd9".freeze
BULK_UPLOAD_FAILED_SERVICE_ERROR_TEMPLATE_ID = "c3f6288c-7a74-4e77-99ee-6c4a0f6e125a".freeze
BULK_UPLOAD_WITH_ERRORS_TEMPLATE_ID = "eb539005-6234-404e-812d-167728cf4274".freeze BULK_UPLOAD_WITH_ERRORS_TEMPLATE_ID = "eb539005-6234-404e-812d-167728cf4274".freeze
def send_bulk_upload_complete_mail(user, bulk_upload)
send_email(
user.email,
BULK_UPLOAD_COMPLETE_TEMPLATE_ID,
{
title: "[dummy title]",
filename: "[dummy filename]",
upload_timestamp: "[dummy upload_timestamp]",
success_description: "[dummy success_description]",
logs_link: "[dummy logs_link]"
},
)
end
def send_bulk_upload_failed_csv_errors_mail(user, bulk_upload) def send_bulk_upload_failed_csv_errors_mail(user, bulk_upload)
send_email( send_email(
user.email, user.email,
@ -17,6 +34,35 @@ class BulkUploadMailer < NotifyMailer
) )
end end
def send_bulk_upload_failed_file_setup_error_mail(user, bulk_upload)
send_email(
user.email,
BULK_UPLOAD_FAILED_FILE_SETUP_ERROR_TEMPLATE_ID,
{
filename: "[dummy filename]",
upload_timestamp: "[dummy upload_timestamp]",
lettings_or_sales: "[dummy lettings_or_sales]",
year_combo: "[dummy year_combo]",
errors_list: "[dummy errors_list]",
bulk_upload_link: "[dummy bulk_upload_link]"
},
)
end
def send_bulk_upload_failed_service_error_mail(user, bulk_upload)
send_email(
user.email,
BULK_UPLOAD_FAILED_SERVICE_ERROR_TEMPLATE_ID,
{
filename: "[dummy filename]",
upload_timestamp: "[dummy upload_timestamp]",
lettings_or_sales: "[dummy lettings_or_sales]",
year_combo: "[dummy year_combo]",
bulk_upload_link: "[dummy bulk_upload_link]"
},
)
end
def send_bulk_upload_with_errors_mail(user, bulk_upload) def send_bulk_upload_with_errors_mail(user, bulk_upload)
send_email( send_email(
user.email, user.email,

Loading…
Cancel
Save