wp = $wp; $this->cdnAssetUrl = $cdnAssetUrl; } public function initialize() { $this->wp->addFilter('mailpoet_email_editor_register_templates', [$this, 'registerTemplates'], 10, 1); } public function registerTemplates(Templates_Registry $templatesRegistry): Templates_Registry { $newsletter = new Newsletter($this->cdnAssetUrl); $template = new Template( $this->templatePrefix, $newsletter->getSlug(), $newsletter->getTitle(), $newsletter->getDescription(), $newsletter->getContent(), [EmailEditor::MAILPOET_EMAIL_POST_TYPE] ); $templatesRegistry->register($template); return $templatesRegistry; } }