Skip to content

Commit

Permalink
Guard in case the admin hasn't upgraded FlexMailer yet
Browse files Browse the repository at this point in the history
  • Loading branch information
totten committed Nov 28, 2017
1 parent a949465 commit 3f3256b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion CRM/Mosaico/Services.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 3f3256b

Please sign in to comment.