AbandonedCartPattern.php
4 months ago
AbandonedCartReminderPattern.php
1 month ago
AbandonedCartWithDiscountPattern.php
1 month ago
AbstractAbandonedCartPattern.php
5 months ago
AskForReviewPostPurchasePattern.php
1 month ago
BirthdayEmailPattern.php
1 month ago
BookingAutomationEmailPattern.php
1 month ago
CategoryPurchaseFollowUpPattern.php
1 month ago
EducationalCampaignPattern.php
1 month ago
EventInvitationPattern.php
3 months ago
FirstPurchaseThankYouPattern.php
1 month ago
NewArrivalsAnnouncementPattern.php
3 months ago
NewProductsAnnouncementPattern.php
3 months ago
NewsletterPattern.php
4 months ago
PostPurchaseThankYouPattern.php
1 month ago
ProductPurchaseFollowUpPattern.php
1 month ago
ProductRestockNotificationPattern.php
5 months ago
SaleAnnouncementPattern.php
3 months ago
SubscriptionAutomationEmailPattern.php
1 month ago
TagPurchaseFollowUpPattern.php
1 month ago
WelcomeEmailPattern.php
1 month ago
WelcomeWithDiscountEmailPattern.php
1 month ago
WinBackCustomerPattern.php
1 month ago
index.php
1 year ago
NewsletterPattern.php
75 lines
| 1 | <?php declare(strict_types = 1); |
| 2 | |
| 3 | namespace MailPoet\EmailEditor\Integrations\MailPoet\Patterns\Library; |
| 4 | |
| 5 | if (!defined('ABSPATH')) exit; |
| 6 | |
| 7 | |
| 8 | use MailPoet\EmailEditor\Integrations\MailPoet\EmailEditor; |
| 9 | use MailPoet\EmailEditor\Integrations\MailPoet\Patterns\Pattern; |
| 10 | |
| 11 | /** |
| 12 | * Newsletter email pattern for regular communications. |
| 13 | */ |
| 14 | class NewsletterPattern extends Pattern { |
| 15 | protected $name = 'newsletter-content'; |
| 16 | protected $block_types = ['core/post-content']; // phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps |
| 17 | protected $template_types = ['email-template']; // phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps |
| 18 | protected $categories = ['newsletter']; |
| 19 | protected $post_types = [EmailEditor::MAILPOET_EMAIL_POST_TYPE]; // phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps |
| 20 | |
| 21 | /** |
| 22 | * Get pattern content. |
| 23 | * |
| 24 | * @return string Pattern HTML content. |
| 25 | */ |
| 26 | protected function get_content(): string { // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
| 27 | return ' |
| 28 | <!-- wp:group {"style":{"spacing":{"padding":{"right":"var:preset|spacing|40","left":"var:preset|spacing|40"}}},"layout":{"type":"constrained"}} --> |
| 29 | <div class="wp-block-group" style="padding-right:var(--wp--preset--spacing--40);padding-left:var(--wp--preset--spacing--40)"> |
| 30 | <!-- wp:heading {"level":1} --> |
| 31 | <h1 class="wp-block-heading">' . __('Weekly Newsletter', 'mailpoet') . '</h1> |
| 32 | <!-- /wp:heading --> |
| 33 | |
| 34 | <!-- wp:paragraph --> |
| 35 | <p>' . __('Welcome to our weekly newsletter! Stay updated with the latest trends in hair care, styling tips, and exclusive offers.', 'mailpoet') . '</p> |
| 36 | <!-- /wp:paragraph --> |
| 37 | |
| 38 | <!-- wp:image {"sizeSlug":"full"} --> |
| 39 | <figure class="wp-block-image size-full"><img src="' . esc_url($this->cdnAssetUrl->generateCdnUrl('email-editor/newsletter.jpg')) . '" alt="' . esc_attr__('Newsletter image', 'mailpoet') . '"/></figure> |
| 40 | <!-- /wp:image --> |
| 41 | |
| 42 | <!-- wp:paragraph --> |
| 43 | <p>' . __('This week, we explore new products that enhance shine and promote healthy hair growth. Don‘t miss out on our exclusive offers tailored just for you!', 'mailpoet') . '</p> |
| 44 | <!-- /wp:paragraph --> |
| 45 | |
| 46 | <!-- wp:heading {"level":2} --> |
| 47 | <h2 class="wp-block-heading">' . __('Summer trends', 'mailpoet') . '</h2> |
| 48 | <!-- /wp:heading --> |
| 49 | |
| 50 | <!-- wp:paragraph --> |
| 51 | <p>' . __('Discover the latest in skincare with our innovative formulas that hydrate and rejuvenate. Join us for special discounts available for a limited time!', 'mailpoet') . '</p> |
| 52 | <!-- /wp:paragraph --> |
| 53 | |
| 54 | <!-- wp:paragraph --> |
| 55 | <p>' . __('Unveil a fresh approach to wellness with our cutting-edge supplements designed to boost energy and support your immune system. Take advantage of our introductory pricing!', 'mailpoet') . '</p> |
| 56 | <!-- /wp:paragraph --> |
| 57 | |
| 58 | <!-- wp:buttons {"layout":{"type":"flex","justifyContent":"center"}} --> |
| 59 | <div class="wp-block-buttons"> |
| 60 | <!-- wp:button {"style":{"typography":{"fontSize":"16px"},"spacing":{"padding":{"top":"var:preset|spacing|10","bottom":"var:preset|spacing|10","left":"var:preset|spacing|20","right":"var:preset|spacing|20"}}}} --> |
| 61 | <div class="wp-block-button"><a class="wp-block-button__link wp-element-button has-custom-font-size" style="font-size:16px;padding-top:var(--wp--preset--spacing--10);padding-bottom:var(--wp--preset--spacing--10);padding-left:var(--wp--preset--spacing--20);padding-right:var(--wp--preset--spacing--20)" href="[mailpoet/site-homepage-url]">' . __('Visit our store', 'mailpoet') . '</a></div> |
| 62 | <!-- /wp:button --> |
| 63 | </div> |
| 64 | <!-- /wp:buttons --> |
| 65 | </div> |
| 66 | <!-- /wp:group --> |
| 67 | '; |
| 68 | } |
| 69 | |
| 70 | protected function get_title(): string { // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
| 71 | /* translators: Name of a content pattern used as starting content of an email */ |
| 72 | return __('Newsletter', 'mailpoet'); |
| 73 | } |
| 74 | } |
| 75 |