mailpoet
/
lib
/
EmailEditor
/
Integrations
/
MailPoet
/
Patterns
/
Library
/
ProductRestockNotificationPattern.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
ProductRestockNotificationPattern.php
68 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 | * Product restock notification email pattern. |
| 13 | */ |
| 14 | class ProductRestockNotificationPattern extends Pattern { |
| 15 | protected $name = 'product-restock-notification'; |
| 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)"><!-- wp:heading {"level":1} --> |
| 30 | <h1 class="wp-block-heading">' . |
| 31 | /* translators: PRODUCT NAME is placeholder text that merchants replace with their own content. */ |
| 32 | __('PRODUCT NAME is back in stock!', 'mailpoet') . '</h1> |
| 33 | <!-- /wp:heading --> |
| 34 | |
| 35 | <!-- wp:paragraph {"style":{"typography":{"fontSize":"16px"}}} --> |
| 36 | <p style="font-size:16px">' . __('One of our most-loved items just returned. Hurry before it sells out again!', 'mailpoet') . '</p> |
| 37 | <!-- /wp:paragraph --> |
| 38 | |
| 39 | <!-- wp:image --> |
| 40 | <figure class="wp-block-image"><img alt=""/></figure> |
| 41 | <!-- /wp:image --> |
| 42 | |
| 43 | <!-- wp:heading {"textAlign":"center"} --> |
| 44 | <h2 class="wp-block-heading has-text-align-center">' . __('Product name', 'mailpoet') . '</h2> |
| 45 | <!-- /wp:heading --> |
| 46 | |
| 47 | <!-- wp:paragraph {"align":"center","style":{"typography":{"fontSize":"16px"}}} --> |
| 48 | <p class="has-text-align-center" style="font-size:16px">$99.90</p> |
| 49 | <!-- /wp:paragraph --> |
| 50 | |
| 51 | <!-- wp:buttons {"layout":{"type":"flex","justifyContent":"center"}} --> |
| 52 | <div class="wp-block-buttons"> |
| 53 | <!-- 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"}}}} --> |
| 54 | <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]">' . __('Shop now', 'mailpoet') . '</a></div> |
| 55 | <!-- /wp:button --> |
| 56 | </div> |
| 57 | <!-- /wp:buttons --> |
| 58 | </div> |
| 59 | <!-- /wp:group --> |
| 60 | '; |
| 61 | } |
| 62 | |
| 63 | protected function get_title(): string { // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
| 64 | /* translators: Name of a content pattern used as starting content of an email */ |
| 65 | return __('Product Restock Notification', 'mailpoet'); |
| 66 | } |
| 67 | } |
| 68 |