Skip to content

Commit

Permalink
Add ContactCondition to example Module
Browse files Browse the repository at this point in the history
  • Loading branch information
bencroker committed Feb 22, 2024
1 parent 7f25e50 commit 82477e7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions examples/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
use Craft;
use craft\base\conditions\BaseCondition;
use craft\events\RegisterConditionRuleTypesEvent;
use modules\conditions\segments\ContactIsUserConditionRule;
use modules\conditions\sendouts\LastEntryHasImageConditionRule;
use modules\conditions\sendouts\MondayMorningSendoutConditionRule;
use modules\conditions\sendouts\RecentEntriesPublishedConditionRule;
use putyourlightson\campaign\elements\conditions\contacts\ContactCondition;
use putyourlightson\campaign\elements\conditions\sendouts\SendoutScheduleCondition;
use yii\base\Event;

Expand All @@ -19,6 +21,14 @@ public function init(): void

parent::init();

Event::on(
ContactCondition::class,
BaseCondition::EVENT_REGISTER_CONDITION_RULE_TYPES,
function(RegisterConditionRuleTypesEvent $event) {
$event->conditionRuleTypes[] = ContactIsUserConditionRule::class;
}
);

Event::on(
SendoutScheduleCondition::class,
BaseCondition::EVENT_REGISTER_CONDITION_RULE_TYPES,
Expand Down

0 comments on commit 82477e7

Please sign in to comment.