From fad372d4bae8224c245a5984c86dac34caafaa47 Mon Sep 17 00:00:00 2001 From: Bauke Zwaan Date: Fri, 12 Mar 2021 09:30:11 +0100 Subject: [PATCH] Only add attachments when HideFormData-setting is not set for this recipient --- code/Control/UserDefinedFormController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/Control/UserDefinedFormController.php b/code/Control/UserDefinedFormController.php index 1e73ad6..87d4bef 100644 --- a/code/Control/UserDefinedFormController.php +++ b/code/Control/UserDefinedFormController.php @@ -323,7 +323,7 @@ JS // Merge fields are used for CMS authors to reference specific form fields in email content $mergeFields = $this->getMergeFieldsMap($emailData['Fields']); - if ($attachments) { + if ($attachments && (bool) $recipient->HideFormData === false) { foreach ($attachments as $file) { /** @var File $file */ if ((int) $file->ID === 0) {