mailpoet
/
lib
/
EmailEditor
/
Integrations
/
MailPoet
/
Patterns
/
Library
/
PostPurchaseThankYouPattern.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
PostPurchaseThankYouPattern.php
84 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 | use MailPoet\EmailEditor\Integrations\MailPoet\ProductCollection\OrderProductCollectionProcessor; |
| 11 | |
| 12 | /** |
| 13 | * Post purchase thank you email pattern. |
| 14 | */ |
| 15 | class PostPurchaseThankYouPattern extends Pattern { |
| 16 | protected $name = 'post-purchase-thank-you'; |
| 17 | protected $block_types = ['core/post-content']; // phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps |
| 18 | protected $template_types = ['email-template']; // phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps |
| 19 | protected $categories = ['purchase']; |
| 20 | protected $post_types = [EmailEditor::MAILPOET_EMAIL_POST_TYPE]; // phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps |
| 21 | |
| 22 | /** |
| 23 | * Get pattern content. |
| 24 | * |
| 25 | * @return string Pattern HTML content. |
| 26 | */ |
| 27 | protected function get_content(): string { // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
| 28 | return $this->buildContent($this->getProductPlaceholderColumns([ |
| 29 | 'product-small-02.jpg', |
| 30 | 'product-small-05.jpg', |
| 31 | 'product-small-03.jpg', |
| 32 | 'product-small-06.jpg', |
| 33 | ])); |
| 34 | } |
| 35 | |
| 36 | public function get_email_content(): string { // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
| 37 | return $this->buildContent($this->getRecommendedProductCollectionBlock( |
| 38 | OrderProductCollectionProcessor::COLLECTION_ORDER_CROSS_SELLS, |
| 39 | 'popularity' |
| 40 | )); |
| 41 | } |
| 42 | |
| 43 | private function buildContent(string $productSection): string { |
| 44 | return ' |
| 45 | <!-- wp:group {"style":{"spacing":{"padding":{"right":"var:preset|spacing|40","left":"var:preset|spacing|40"}}},"layout":{"type":"constrained"}} --> |
| 46 | <div class="wp-block-group" style="padding-right:var(--wp--preset--spacing--40);padding-left:var(--wp--preset--spacing--40)"> |
| 47 | <!-- wp:heading {"level":1} --> |
| 48 | <h1 class="wp-block-heading">' . __('Thank you for your loyalty', 'mailpoet') . '</h1> |
| 49 | <!-- /wp:heading --> |
| 50 | |
| 51 | <!-- wp:paragraph {"style":{"typography":{"fontSize":"16px"},"spacing":{"padding":{"top":"0","bottom":"var:preset|spacing|30"}}}} --> |
| 52 | <p style="padding-top:0;padding-bottom:var(--wp--preset--spacing--30);font-size:16px">' . |
| 53 | __('Your continued support means a lot to us.', 'mailpoet') . '</p> |
| 54 | <!-- /wp:paragraph --> |
| 55 | |
| 56 | <!-- wp:paragraph {"style":{"typography":{"fontSize":"16px"},"spacing":{"padding":{"top":"0","bottom":"var:preset|spacing|30"}}}} --> |
| 57 | <p style="padding-top:0;padding-bottom:var(--wp--preset--spacing--30);font-size:16px"> |
| 58 | ' . __('Here are a few picks that pair well with your recent order.', 'mailpoet') . '</p> |
| 59 | <!-- /wp:paragraph --> |
| 60 | |
| 61 | ' . $productSection . ' |
| 62 | |
| 63 | <!-- wp:spacer {"height":"30px"} --> |
| 64 | <div style="height:30px" aria-hidden="true" class="wp-block-spacer"></div> |
| 65 | <!-- /wp:spacer --> |
| 66 | |
| 67 | <!-- wp:paragraph {"fontSize":"medium"} --> |
| 68 | <p class="has-medium-font-size">' . __('Happy shopping!', 'mailpoet') . '</p> |
| 69 | <!-- /wp:paragraph --> |
| 70 | |
| 71 | <!-- wp:paragraph {"fontSize":"medium"} --> |
| 72 | <p class="has-medium-font-size">–<!--[woocommerce/site-title]--></p> |
| 73 | <!-- /wp:paragraph --> |
| 74 | </div> |
| 75 | <!-- /wp:group --> |
| 76 | '; |
| 77 | } |
| 78 | |
| 79 | protected function get_title(): string { // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
| 80 | /* translators: Name of a content pattern used as starting content of an email */ |
| 81 | return __('Post Purchase Thank You', 'mailpoet'); |
| 82 | } |
| 83 | } |
| 84 |