contextFactory = $contextFactory; $this->unsubscribeAction = $unsubscribeAction; $this->addTagAction = $addTagAction; $this->removeTagAction = $removeTagAction; $this->addToListAction = $addToListAction; $this->tagRemovedTrigger = $tagRemovedTrigger; $this->removeFromListAction = $removeFromListAction; $this->updateSubscriberAction = $updateSubscriberAction; $this->notificationEmailAction = $notificationEmailAction; $this->customTrigger = $customTrigger; $this->clicksEmailLinkTrigger = $clicksEmailLinkTrigger; $this->customDataSubject = $customDataSubject; $this->customAction = $customAction; $this->tagAddedTrigger = $tagAddedTrigger; $this->tagSubject = $tagSubject; $this->premiumTemplatesFactory = $premiumTemplatesFactory; $this->analytics = $analytics; } public function register(Registry $registry): void { $registry->addContextFactory('mailpoet-premium', function () { return $this->contextFactory->getContextData(); }); $registry->addAction($this->unsubscribeAction); $registry->addAction($this->addTagAction); $registry->addAction($this->removeTagAction); $registry->addAction($this->addToListAction); $registry->addAction($this->removeFromListAction); $registry->addAction($this->updateSubscriberAction); $registry->addAction($this->notificationEmailAction); $registry->addTrigger($this->customTrigger); $registry->addSubject($this->customDataSubject); $registry->addAction($this->customAction); $registry->addTrigger($this->tagAddedTrigger); $registry->addTrigger($this->tagRemovedTrigger); $registry->addTrigger($this->clicksEmailLinkTrigger); $registry->addSubject($this->tagSubject); // add/overwrite by premium templates foreach ($this->premiumTemplatesFactory->createTemplates() as $template) { $registry->addTemplate($template); } $this->analytics->register(); } }