diff --git a/CRM/Mosaico/Services.php b/CRM/Mosaico/Services.php index 44e7847f7e..ef4e910bd1 100644 --- a/CRM/Mosaico/Services.php +++ b/CRM/Mosaico/Services.php @@ -32,7 +32,10 @@ public static function registerServices(ContainerBuilder $container) { protected static function getListenerSpecs() { $listenerSpecs = array(); - $listenerSpecs[] = array(\Civi\FlexMailer\Validator::EVENT_CHECK_SENDABLE, array('mosaico_required_tokens', 'onCheckSendable'), FM::WEIGHT_MAIN); + if (class_exists('\Civi\FlexMailer\Validator')) { + // TODO Simplify by removing conditional. Wait until at least Feb 2018. + $listenerSpecs[] = array(\Civi\FlexMailer\Validator::EVENT_CHECK_SENDABLE, array('mosaico_required_tokens', 'onCheckSendable'), FM::WEIGHT_MAIN); + } $listenerSpecs[] = array(FM::EVENT_COMPOSE, array('mosaico_flexmail_composer', 'onCompose'), FM::WEIGHT_MAIN); $listenerSpecs[] = array(FM::EVENT_COMPOSE, array('mosaico_flexmail_url_filter', 'onCompose'), FM::WEIGHT_ALTER - 100);