diff --git a/mailpoet/lib/EmailEditor/Integrations/MailPoet/EmailEditor.php b/mailpoet/lib/EmailEditor/Integrations/MailPoet/EmailEditor.php
index 014f2330ac..dc14559e06 100644
--- a/mailpoet/lib/EmailEditor/Integrations/MailPoet/EmailEditor.php
+++ b/mailpoet/lib/EmailEditor/Integrations/MailPoet/EmailEditor.php
@@ -62,27 +62,4 @@ class EmailEditor {
'schema' => $this->emailApiController->getEmailDataSchema(),
]);
}
-
- public function getEmailDefaultContent(): string {
- return '
-
-
' . esc_html__('You received this email because you are subscribed to the [site:title]', 'mailpoet') . '
- - -' . esc_html__('Unsubscribe', 'mailpoet') . ' | ' . esc_html__('Manage subscription', 'mailpoet') . '
- - '; - } } diff --git a/mailpoet/lib/Newsletter/NewsletterSaveController.php b/mailpoet/lib/Newsletter/NewsletterSaveController.php index dfa663d0b7..8a8587f792 100644 --- a/mailpoet/lib/Newsletter/NewsletterSaveController.php +++ b/mailpoet/lib/Newsletter/NewsletterSaveController.php @@ -78,8 +78,7 @@ class NewsletterSaveController { /*** @var NewsletterCoupon */ private $newsletterCoupon; - /** @var EmailEditor */ - private $emailEditor; + private CdnAssetUrl $cdnAssetUrl; public function __construct( AuthorizedEmailsController $authorizedEmailsController, @@ -98,7 +97,7 @@ class NewsletterSaveController { ApiDataSanitizer $dataSanitizer, Scheduler $scheduler, NewsletterCoupon $newsletterCoupon, - EmailEditor $emailEditor + CdnAssetUrl $cdnAssetUrl ) { $this->authorizedEmailsController = $authorizedEmailsController; $this->emoji = $emoji; @@ -116,7 +115,7 @@ class NewsletterSaveController { $this->dataSanitizer = $dataSanitizer; $this->scheduler = $scheduler; $this->newsletterCoupon = $newsletterCoupon; - $this->emailEditor = $emailEditor; + $this->cdnAssetUrl = $cdnAssetUrl; } public function save(array $data = []): NewsletterEntity { @@ -463,7 +462,7 @@ class NewsletterSaveController { } $newPostId = $this->wp->wpInsertPost([ - 'post_content' => $this->emailEditor->getEmailDefaultContent(), + 'post_content' => $this->getEmailDefaultContent(), 'post_type' => EmailEditor::MAILPOET_EMAIL_POST_TYPE, 'post_status' => 'draft', 'post_author' => $this->wp->getCurrentUserId(), @@ -472,4 +471,27 @@ class NewsletterSaveController { $newsletter->setWpPost($this->entityManager->getReference(WpPostEntity::class, $newPostId)); $this->entityManager->flush(); } + + private function getEmailDefaultContent(): string { + return ' + +' . esc_html__('You received this email because you are subscribed to the [site:title]', 'mailpoet') . '
+ + +' . esc_html__('Unsubscribe', 'mailpoet') . ' | ' . esc_html__('Manage subscription', 'mailpoet') . '
+ + '; + } }