mailpoet
/
lib
/
EmailEditor
/
Integrations
/
MailPoet
/
Patterns
/
Library
/
AbandonedCartWithDiscountPattern.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
AbandonedCartWithDiscountPattern.php
66 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 | /** |
| 9 | * Abandoned cart with discount email pattern for cart recovery. |
| 10 | */ |
| 11 | class AbandonedCartWithDiscountPattern extends AbstractAbandonedCartPattern { |
| 12 | protected $name = 'abandoned-cart-with-discount-content'; |
| 13 | |
| 14 | protected function get_content(): string { // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
| 15 | return $this->buildContent($this->getProductPlaceholderBlocks([ |
| 16 | 'product-large-01.jpg', |
| 17 | 'product-large-02.jpg', |
| 18 | ])); |
| 19 | } |
| 20 | |
| 21 | public function get_email_content(): string { // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
| 22 | return $this->buildContent($this->getProductCollectionBlock()); |
| 23 | } |
| 24 | |
| 25 | private function buildContent(string $productSection): string { |
| 26 | return ' |
| 27 | <!-- wp:group {"style":{"spacing":{"padding":{"right":"var:preset|spacing|40","left":"var:preset|spacing|40"}}},"layout":{"type":"constrained"}} --> |
| 28 | <div class="wp-block-group" style="padding-right:var(--wp--preset--spacing--40);padding-left:var(--wp--preset--spacing--40)"> |
| 29 | <!-- wp:heading {"level":1} --> |
| 30 | <h1 class="wp-block-heading ">' . __('We Saved Your Cart + Little Surprise', 'mailpoet') . '</h1> |
| 31 | <!-- /wp:heading --> |
| 32 | |
| 33 | <!-- wp:paragraph --> |
| 34 | <p>' . __('Good news — your cart is still here! Even better? You can get 10% off if you check out in the next 24 hours.', 'mailpoet') . '</p> |
| 35 | <!-- /wp:paragraph --> |
| 36 | |
| 37 | <!-- wp:paragraph --> |
| 38 | <p>' . __('Use this code at checkout to redeem your discount:', 'mailpoet') . '</p> |
| 39 | <!-- /wp:paragraph --> |
| 40 | |
| 41 | ' . $this->getGeneratedCouponBlock('left', 10, 1) . ' |
| 42 | |
| 43 | <!-- wp:buttons {"layout":{"type":"flex","justifyContent":"center"}} --> |
| 44 | <div class="wp-block-buttons"> |
| 45 | <!-- 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"}}}} --> |
| 46 | <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]">' . __('Finish checkout', 'mailpoet') . '</a></div> |
| 47 | <!-- /wp:button --> |
| 48 | </div> |
| 49 | <!-- /wp:buttons --> |
| 50 | |
| 51 | <!-- wp:heading {"textAlign":"left","level":3,"style":{"border":{"top":{"color":"var:preset|color|cyan-bluish-gray","width":"1px"}},"spacing":{"padding":{"top":"var:preset|spacing|30","bottom":"var:preset|spacing|30"}}}} --> |
| 52 | <h3 class="wp-block-heading has-text-align-left" style="border-top-color:var(--wp--preset--color--cyan-bluish-gray);border-top-width:1px;padding-top:var(--wp--preset--spacing--30);padding-bottom:var(--wp--preset--spacing--30)">' . __('These items are waiting in your cart', 'mailpoet') . '</h3> |
| 53 | <!-- /wp:heading --> |
| 54 | |
| 55 | ' . $productSection . ' |
| 56 | </div> |
| 57 | <!-- /wp:group --> |
| 58 | '; |
| 59 | } |
| 60 | |
| 61 | protected function get_title(): string { // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
| 62 | /* translators: Name of a content pattern used as starting content of an email */ |
| 63 | return __('Abandoned Cart with Discount', 'mailpoet'); |
| 64 | } |
| 65 | } |
| 66 |