diff --git a/CRM/Contact/Form/Task/PDFLetterCommon.php b/CRM/Contact/Form/Task/PDFLetterCommon.php index c5b8439801d0..a0424e1d6cf7 100644 --- a/CRM/Contact/Form/Task/PDFLetterCommon.php +++ b/CRM/Contact/Form/Task/PDFLetterCommon.php @@ -180,7 +180,7 @@ public static function postProcess(&$form) { } $tee = NULL; - if ($isLiveMode && Civi::settings()->get('recordGeneratedLetters') === 'combined-attached') { + if (self::isLiveMode($form) && Civi::settings()->get('recordGeneratedLetters') === 'combined-attached') { if (count($activityIds) !== 1) { throw new CRM_Core_Exception("When recordGeneratedLetters=combined-attached, there should only be one activity."); }