diff --git a/app/controllers/templates_preferences_controller.rb b/app/controllers/templates_preferences_controller.rb index 76af325b..24aedbd4 100644 --- a/app/controllers/templates_preferences_controller.rb +++ b/app/controllers/templates_preferences_controller.rb @@ -22,6 +22,7 @@ class TemplatesPreferencesController < ApplicationController preferences: %i[bcc_completed request_email_subject request_email_body documents_copy_email_subject documents_copy_email_body documents_copy_email_enabled documents_copy_email_attach_audit + documents_copy_email_attach_documents completed_notification_email_attach_documents completed_redirect_url submitters_order diff --git a/app/mailers/submitter_mailer.rb b/app/mailers/submitter_mailer.rb index 2c5caa2c..81773261 100644 --- a/app/mailers/submitter_mailer.rb +++ b/app/mailers/submitter_mailer.rb @@ -106,8 +106,11 @@ class SubmitterMailer < ApplicationMailer @email_config = AccountConfigs.find_for_account(@current_account, AccountConfig::SUBMITTER_DOCUMENTS_COPY_EMAIL_KEY) - @documents = add_completed_email_attachments!( - submitter, with_audit_log: @submitter.template.preferences['documents_copy_email_attach_audit'] != false && + add_completed_email_attachments!( + submitter, + with_documents: @submitter.template.preferences['documents_copy_email_attach_documents'] != false && + (@email_config.nil? || @email_config.value['attach_documents'] != false), + with_audit_log: @submitter.template.preferences['documents_copy_email_attach_audit'] != false && (@email_config.nil? || @email_config.value['attach_audit_log'] != false) ) diff --git a/app/views/personalization_settings/_documents_copy_email_form.html.erb b/app/views/personalization_settings/_documents_copy_email_form.html.erb index 03310057..6b9e0fc3 100644 --- a/app/views/personalization_settings/_documents_copy_email_form.html.erb +++ b/app/views/personalization_settings/_documents_copy_email_form.html.erb @@ -8,7 +8,7 @@