Define default content blocks
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace MailPoet\EmailEditor\Integrations\MailPoet;
|
||||
|
||||
use MailPoet\Config\Env;
|
||||
use MailPoet\Features\FeaturesController;
|
||||
use MailPoet\WP\Functions as WPFunctions;
|
||||
|
||||
@@ -56,4 +57,27 @@ class EmailEditor {
|
||||
'schema' => $this->emailApiController->getEmailDataSchema(),
|
||||
]);
|
||||
}
|
||||
|
||||
public static function getEmailDefaultContent(): string {
|
||||
return '
|
||||
<!-- wp:image {"width":"130px","sizeSlug":"large"} -->
|
||||
<figure class="wp-block-image size-large is-resized"><img src="' . esc_url(Env::$assetsUrl) . '/img/blank_templates/fake-logo-alt.png" alt="Your Logo" style="width:130px"/></figure>
|
||||
<!-- /wp:image -->
|
||||
<!-- wp:heading {"fontSize":"medium","style":{"spacing":{"padding":{"top":"var:preset|spacing|10","bottom":"var:preset|spacing|10"}}}} -->
|
||||
<h2 class="wp-block-heading has-medium-font-size" style="padding-top:var(--wp--preset--spacing--10);padding-bottom:var(--wp--preset--spacing--10)"></h2>
|
||||
<!-- /wp:heading -->
|
||||
<!-- wp:image -->
|
||||
<figure class="wp-block-image"><img alt=""/></figure>
|
||||
<!-- /wp:image -->
|
||||
<!-- wp:paragraph {"style":{"spacing":{"padding":{"top":"var:preset|spacing|20","bottom":"var:preset|spacing|20"}}}} -->
|
||||
<p style="padding-top:var(--wp--preset--spacing--20);padding-bottom:var(--wp--preset--spacing--20)"></p>
|
||||
<!-- /wp:paragraph -->
|
||||
<!-- wp:paragraph {"fontSize":"small"} -->
|
||||
<p class="has-small-font-size">' . esc_html__('You received this email because you are subscribed to the [site:title]', 'mailpoet') . '</p>
|
||||
<!-- /wp:paragraph -->
|
||||
<!-- wp:paragraph {"fontSize":"small"} -->
|
||||
<p class="has-small-font-size"><a href="[link:subscription_unsubscribe_url]">' . esc_html__('Unsubscribe', 'mailpoet') . '</a> | <a href="[link:subscription_manage_url]">' . esc_html__('Manage subscription', 'mailpoet') . '</a></p>
|
||||
<!-- /wp:paragraph -->
|
||||
';
|
||||
}
|
||||
}
|
||||
|
@@ -446,7 +446,7 @@ class NewsletterSaveController {
|
||||
}
|
||||
|
||||
$newPostId = $this->wp->wpInsertPost([
|
||||
'post_content' => '',
|
||||
'post_content' => EmailEditor::getEmailDefaultContent(),
|
||||
'post_type' => EmailEditor::MAILPOET_EMAIL_POST_TYPE,
|
||||
'post_status' => 'draft',
|
||||
'post_author' => $this->wp->getCurrentUserId(),
|
||||
|
Reference in New Issue
Block a user