From 6652ab2f7417b1a50ccff851c5875b06d51615a3 Mon Sep 17 00:00:00 2001 From: Josh Crawford Date: Thu, 21 Jan 2021 11:09:50 +1100 Subject: [PATCH] Fix gift voucher attaching to emails, even when disabled --- src/services/VouchersService.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/services/VouchersService.php b/src/services/VouchersService.php index e3b9157..4562d34 100755 --- a/src/services/VouchersService.php +++ b/src/services/VouchersService.php @@ -74,7 +74,9 @@ public function onBeforeSendEmail(MailEvent $event) } // Check this is an email we want to attach the voucher PDF to - if (!isset($settings->attachPdfToEmails[$commerceEmail->uid])) { + $matchedEmail = $settings->attachPdfToEmails[$commerceEmail->uid] ?? null; + + if (!$matchedEmail) { return; }