mailpoet
/
lib
/
EmailEditor
/
Integrations
/
MailPoet
/
Patterns
/
Library
/
EducationalCampaignPattern.php
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
EducationalCampaignPattern.php
148 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 | * Educational campaign email pattern. |
| 13 | */ |
| 14 | class EducationalCampaignPattern extends Pattern { |
| 15 | protected $name = 'educational-campaign'; |
| 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 = ['educational-campaign']; |
| 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">' . |
| 32 | /* translators: %s: Site title personalization tag */ |
| 33 | sprintf(__('How to Get the Most from %s', 'mailpoet'), '<!--[mailpoet/site-title]-->') . '</h1> |
| 34 | <!-- /wp:heading --> |
| 35 | |
| 36 | <!-- wp:paragraph {"style":{"typography":{"fontSize":"16px"}}} --> |
| 37 | <p style="font-size:16px">' . |
| 38 | /* translators: %s: Site title personalization tag */ |
| 39 | sprintf(__('Our latest guide walks you through tips to make the most from %s.', 'mailpoet'), '<!--[mailpoet/site-title]-->') . '</p> |
| 40 | <!-- /wp:paragraph --> |
| 41 | |
| 42 | <!-- wp:heading --> |
| 43 | <h2 class="wp-block-heading">' . __('How it works', 'mailpoet') . '</h2> |
| 44 | <!-- /wp:heading --> |
| 45 | |
| 46 | <!-- wp:columns --> |
| 47 | <div class="wp-block-columns"> |
| 48 | <!-- wp:column {"style":{"spacing":{"padding":{"right":"0","left":"0"}}}} --> |
| 49 | <div class="wp-block-column" style="padding-right:0;padding-left:0"> |
| 50 | <!-- wp:image {"sizeSlug":"full"} --> |
| 51 | <figure class="wp-block-image size-full"><img src="' . esc_url($this->cdnAssetUrl->generateCdnUrl('email-editor/educational-step-1.jpg')) . '" alt="' . esc_attr__('Step 1 image', 'mailpoet') . '"/></figure> |
| 52 | <!-- /wp:image --> |
| 53 | </div> |
| 54 | <!-- /wp:column --> |
| 55 | |
| 56 | <!-- wp:column {"style":{"spacing":{"padding":{"right":"0","left":"var:preset|spacing|30"}}}} --> |
| 57 | <div class="wp-block-column" style="padding-right:0;padding-left:var(--wp--preset--spacing--30)"> |
| 58 | <!-- wp:heading {"level":3} --> |
| 59 | <h3 class="wp-block-heading">' . __('Step 1', 'mailpoet') . '</h3> |
| 60 | <!-- /wp:heading --> |
| 61 | |
| 62 | <!-- wp:paragraph --> |
| 63 | <p><em>' . |
| 64 | /* translators: Placeholder text that merchants replace with their own content. */ |
| 65 | __('Brief description', 'mailpoet') . '</em></p> |
| 66 | <!-- /wp:paragraph --> |
| 67 | </div> |
| 68 | <!-- /wp:column --> |
| 69 | </div> |
| 70 | <!-- /wp:columns --> |
| 71 | |
| 72 | <!-- wp:spacer {"height":"30px"} --> |
| 73 | <div style="height:30px" aria-hidden="true" class="wp-block-spacer"></div> |
| 74 | <!-- /wp:spacer --> |
| 75 | |
| 76 | <!-- wp:columns --> |
| 77 | <div class="wp-block-columns"> |
| 78 | <!-- wp:column {"style":{"spacing":{"padding":{"right":"var:preset|spacing|30","left":"0"}}}} --> |
| 79 | <div class="wp-block-column" style="padding-right:var(--wp--preset--spacing--30);padding-left:0"> |
| 80 | <!-- wp:heading {"level":3} --> |
| 81 | <h3 class="wp-block-heading">' . __('Step 2', 'mailpoet') . '</h3> |
| 82 | <!-- /wp:heading --> |
| 83 | |
| 84 | <!-- wp:paragraph --> |
| 85 | <p><em>' . |
| 86 | /* translators: Placeholder text that merchants replace with their own content. */ |
| 87 | __('Brief description', 'mailpoet') . '</em></p> |
| 88 | <!-- /wp:paragraph --> |
| 89 | </div> |
| 90 | <!-- /wp:column --> |
| 91 | |
| 92 | <!-- wp:column {"style":{"spacing":{"padding":{"right":"0","left":"0"}}}} --> |
| 93 | <div class="wp-block-column" style="padding-right:0;padding-left:0"> |
| 94 | <!-- wp:image {"sizeSlug":"full"} --> |
| 95 | <figure class="wp-block-image size-full"><img src="' . esc_url($this->cdnAssetUrl->generateCdnUrl('email-editor/educational-step-2.jpg')) . '" alt="' . esc_attr__('Step 2 image', 'mailpoet') . '"/></figure> |
| 96 | <!-- /wp:image --> |
| 97 | </div> |
| 98 | <!-- /wp:column --> |
| 99 | </div> |
| 100 | <!-- /wp:columns --> |
| 101 | |
| 102 | <!-- wp:spacer {"height":"30px"} --> |
| 103 | <div style="height:30px" aria-hidden="true" class="wp-block-spacer"></div> |
| 104 | <!-- /wp:spacer --> |
| 105 | |
| 106 | <!-- wp:columns --> |
| 107 | <div class="wp-block-columns"> |
| 108 | <!-- wp:column {"style":{"spacing":{"padding":{"right":"0","left":"0"}}}} --> |
| 109 | <div class="wp-block-column" style="padding-right:0;padding-left:0"> |
| 110 | <!-- wp:image {"sizeSlug":"full"} --> |
| 111 | <figure class="wp-block-image size-full"><img src="' . esc_url($this->cdnAssetUrl->generateCdnUrl('email-editor/educational-step-3.jpg')) . '" alt="' . esc_attr__('Step 3 image', 'mailpoet') . '"/></figure> |
| 112 | <!-- /wp:image --> |
| 113 | </div> |
| 114 | <!-- /wp:column --> |
| 115 | |
| 116 | <!-- wp:column {"style":{"spacing":{"padding":{"right":"0","left":"var:preset|spacing|30"}}}} --> |
| 117 | <div class="wp-block-column" style="padding-right:0;padding-left:var(--wp--preset--spacing--30)"><!-- wp:heading {"level":3} --> |
| 118 | <h3 class="wp-block-heading">' . __('Step 3', 'mailpoet') . '</h3> |
| 119 | <!-- /wp:heading --> |
| 120 | |
| 121 | <!-- wp:paragraph --> |
| 122 | <p><em>' . |
| 123 | /* translators: Placeholder text that merchants replace with their own content. */ |
| 124 | __('Brief description', 'mailpoet') . '</em></p> |
| 125 | <!-- /wp:paragraph --> |
| 126 | </div> |
| 127 | <!-- /wp:column --> |
| 128 | </div> |
| 129 | <!-- /wp:columns --> |
| 130 | |
| 131 | <!-- wp:buttons {"layout":{"type":"flex","justifyContent":"center"}} --> |
| 132 | <div class="wp-block-buttons"> |
| 133 | <!-- 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"}}}} --> |
| 134 | <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]">' . __('Read the guide', 'mailpoet') . '</a></div> |
| 135 | <!-- /wp:button --> |
| 136 | </div> |
| 137 | <!-- /wp:buttons --> |
| 138 | </div> |
| 139 | <!-- /wp:group --> |
| 140 | '; |
| 141 | } |
| 142 | |
| 143 | protected function get_title(): string { // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
| 144 | /* translators: Name of a content pattern used as starting content of an email */ |
| 145 | return __('Educational Campaign', 'mailpoet'); |
| 146 | } |
| 147 | } |
| 148 |