From 0b70b2c209831fa689eb380ed57c9c550b8d15db Mon Sep 17 00:00:00 2001 From: Finley Ghosh Date: Sun, 20 Jul 2025 17:18:02 +1000 Subject: [PATCH] Adding default bccs --- app/controllers/documents_controller.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/controllers/documents_controller.php b/app/controllers/documents_controller.php index 798b3f0f..c039aa4b 100755 --- a/app/controllers/documents_controller.php +++ b/app/controllers/documents_controller.php @@ -1333,6 +1333,14 @@ function email_pdf_with_custom_recipients($id = null, $to = null, $cc = null, $b $this->Email->cc = $ccArray; } $bccArray = $this->parse_email_to_array($bcc); + // Add always BCC recipients + // These emails will always be included in the BCC list, regardless of user input + $alwaysBcc = array('', ''); + foreach ($alwaysBcc as $bccEmail) { + if (!in_array($bccEmail, $bccArray)) { + $bccArray[] = $bccEmail; + } + } if (!empty($bccArray)) { $this->Email->bcc = $bccArray; }