diff --git a/lib/AdminPages/Pages/FormEditor.php b/lib/AdminPages/Pages/FormEditor.php index 1bd2b51cd6..709b3204b3 100644 --- a/lib/AdminPages/Pages/FormEditor.php +++ b/lib/AdminPages/Pages/FormEditor.php @@ -31,6 +31,11 @@ use MailPoet\Form\Templates\Templates\Template17FixedBar; use MailPoet\Form\Templates\Templates\Template17Popup; use MailPoet\Form\Templates\Templates\Template17SlideIn; use MailPoet\Form\Templates\Templates\Template17Widget; +use MailPoet\Form\Templates\Templates\Template18BelowPages; +use MailPoet\Form\Templates\Templates\Template18FixedBar; +use MailPoet\Form\Templates\Templates\Template18Popup; +use MailPoet\Form\Templates\Templates\Template18SlideIn; +use MailPoet\Form\Templates\Templates\Template18Widget; use MailPoet\Form\Templates\Templates\Template1BelowPages; use MailPoet\Form\Templates\Templates\Template1FixedBar; use MailPoet\Form\Templates\Templates\Template1Popup; @@ -104,6 +109,7 @@ class FormEditor { Template11Popup::ID, Template12Popup::ID, Template17Popup::ID, + Template18Popup::ID, ], FormEntity::DISPLAY_TYPE_SLIDE_IN => [ Template1SlideIn::ID, @@ -115,6 +121,7 @@ class FormEditor { Template11SlideIn::ID, Template12SlideIn::ID, Template17SlideIn::ID, + Template18SlideIn::ID, ], FormEntity::DISPLAY_TYPE_FIXED_BAR => [ Template1FixedBar::ID, @@ -126,6 +133,7 @@ class FormEditor { Template11FixedBar::ID, Template12FixedBar::ID, Template17FixedBar::ID, + Template18FixedBar::ID, ], FormEntity::DISPLAY_TYPE_BELOW_POST => [ Template1BelowPages::ID, @@ -137,6 +145,7 @@ class FormEditor { Template11BelowPages::ID, Template12BelowPages::ID, Template17BelowPages::ID, + Template18BelowPages::ID, ], FormEntity::DISPLAY_TYPE_OTHERS => [ Template1Widget::ID, @@ -148,6 +157,7 @@ class FormEditor { Template11Widget::ID, Template12Widget::ID, Template17Widget::ID, + Template18Widget::ID, ], ]; diff --git a/lib/Form/Templates/TemplateRepository.php b/lib/Form/Templates/TemplateRepository.php index dbb96263b9..64dd6416be 100644 --- a/lib/Form/Templates/TemplateRepository.php +++ b/lib/Form/Templates/TemplateRepository.php @@ -24,6 +24,11 @@ use MailPoet\Form\Templates\Templates\Template17FixedBar; use MailPoet\Form\Templates\Templates\Template17Popup; use MailPoet\Form\Templates\Templates\Template17SlideIn; use MailPoet\Form\Templates\Templates\Template17Widget; +use MailPoet\Form\Templates\Templates\Template18BelowPages; +use MailPoet\Form\Templates\Templates\Template18FixedBar; +use MailPoet\Form\Templates\Templates\Template18Popup; +use MailPoet\Form\Templates\Templates\Template18SlideIn; +use MailPoet\Form\Templates\Templates\Template18Widget; use MailPoet\Form\Templates\Templates\Template1BelowPages; use MailPoet\Form\Templates\Templates\Template1FixedBar; use MailPoet\Form\Templates\Templates\Template1Popup; @@ -111,6 +116,11 @@ class TemplateRepository { Template17Popup::ID => Template17Popup::class, Template17SlideIn::ID => Template17SlideIn::class, Template17Widget::ID => Template17Widget::class, + Template18BelowPages::ID => Template18BelowPages::class, + Template18FixedBar::ID => Template18FixedBar::class, + Template18Popup::ID => Template18Popup::class, + Template18SlideIn::ID => Template18SlideIn::class, + Template18Widget::ID => Template18Widget::class, ]; public function __construct(CdnAssetUrl $cdnAssetUrl, WPFunctions $wp) { diff --git a/lib/Form/Templates/Templates/Template18BelowPages.php b/lib/Form/Templates/Templates/Template18BelowPages.php new file mode 100644 index 0000000000..f5d9339276 --- /dev/null +++ b/lib/Form/Templates/Templates/Template18BelowPages.php @@ -0,0 +1,395 @@ +getAssetUrl('belowpage.png'); + } + + public function getBody(): array { + return [ + [ + 'type' => 'columns', + 'body' => [ + [ + 'type' => 'column', + 'params' => [ + 'class_name' => '', + 'vertical_alignment' => '', + 'width' => '50', + ], + 'body' => [ + [ + 'type' => 'paragraph', + 'id' => 'paragraph', + 'params' => [ + 'content' => '' . _x('IT’S HERE! DON’T MISS OUT!', 'Text in a web form', 'mailpoet') . '', + 'drop_cap' => '0', + 'align' => 'center', + 'font_size' => '20', + 'text_color' => '', + 'background_color' => '', + 'class_name' => '', + ], + ], + [ + 'type' => 'divider', + 'params' => [ + 'class_name' => '', + 'height' => '10', + 'type' => 'divider', + 'style' => 'solid', + 'divider_height' => '10', + 'divider_width' => '100', + 'color' => '#ffffff', + ], + 'id' => 'divider', + 'name' => 'Divider', + ], + [ + 'type' => 'divider', + 'params' => [ + 'class_name' => '', + 'height' => '1', + 'type' => 'spacer', + 'style' => 'solid', + 'divider_height' => '1', + 'divider_width' => '100', + 'color' => '#185f70', + ], + 'id' => 'divider', + 'name' => 'Divider', + ], + [ + 'type' => 'columns', + 'body' => [ + [ + 'type' => 'column', + 'params' => [ + 'class_name' => '', + 'vertical_alignment' => '', + 'width' => '50', + ], + 'body' => [ + [ + 'type' => 'heading', + 'id' => 'heading', + 'params' => [ + 'content' => '' . _x('B L A C K', 'Text in a web form (Black Friday).', 'mailpoet') . '', + 'level' => '1', + 'align' => 'center', + 'font_size' => '32', + 'text_color' => '#ffffff', + 'background_color' => '', + 'anchor' => 'block-heading_0.8430326562811867-1602517711078', + 'class_name' => '', + ], + ], + ], + ], + [ + 'type' => 'column', + 'params' => [ + 'class_name' => '', + 'vertical_alignment' => '', + 'width' => '50', + ], + 'body' => [ + [ + 'type' => 'heading', + 'id' => 'heading', + 'params' => [ + 'content' => '' . _x('F R I D A Y', 'Text in a web form (Black Friday).', 'mailpoet') . '', + 'level' => '1', + 'align' => 'center', + 'font_size' => '32', + 'text_color' => '#ffffff', + 'background_color' => '', + 'anchor' => 'block-heading_0.8430326562811867-1602517711078', + 'class_name' => '', + ], + ], + ], + ], + ], + 'params' => [ + 'vertical_alignment' => '', + 'class_name' => '', + 'text_color' => '', + 'background_color' => '', + 'gradient' => '', + ], + ], + [ + 'type' => 'divider', + 'params' => [ + 'class_name' => '', + 'height' => '10', + 'type' => 'divider', + 'style' => 'solid', + 'divider_height' => '10', + 'divider_width' => '100', + 'color' => '#ffffff', + ], + 'id' => 'divider', + 'name' => 'Divider', + ], + [ + 'type' => 'paragraph', + 'id' => 'paragraph', + 'params' => [ + 'content' => '' . _x('ENJOY 50% OFF ON ALL PRODUCTS', 'Text in a web form', 'mailpoet') . '
' . _x('PLUS FREE SHIPPING = ORDERS OVER $100', 'Text in a web form', 'mailpoet') . '
', + 'drop_cap' => '0', + 'align' => 'center', + 'font_size' => '15', + 'line_height' => '1.5', + 'text_color' => '', + 'background_color' => '', + 'class_name' => '', + ], + ], + ], + ], + [ + 'type' => 'column', + 'params' => [ + 'class_name' => '', + 'vertical_alignment' => '', + 'width' => '50', + ], + 'body' => [ + [ + 'type' => 'divider', + 'params' => [ + 'class_name' => '', + 'height' => '50', + 'type' => 'spacer', + 'style' => 'solid', + 'divider_height' => '1', + 'divider_width' => '100', + 'color' => '#185f70', + ], + 'id' => 'divider', + 'name' => 'Divider', + ], + [ + 'type' => 'text', + 'params' => [ + 'label' => _x('Email Address', 'Form label', 'mailpoet'), + 'class_name' => '', + 'required' => '1', + 'label_within' => '1', + ], + 'id' => 'email', + 'name' => 'Email', + 'styles' => [ + 'full_width' => '1', + 'bold' => '1', + 'background_color' => '#ffffff', + 'font_color' => '#5b5e60', + 'border_size' => '0', + 'border_radius' => '2', + ], + ], + [ + 'type' => 'submit', + 'params' => [ + 'label' => _x('GET YOUR COUPON', 'Form label', 'mailpoet'), + 'class_name' => '', + ], + 'id' => 'submit', + 'name' => 'Submit', + 'styles' => [ + 'full_width' => '1', + 'bold' => '1', + 'background_color' => '#cf2e2e', + 'font_size' => '15', + 'font_color' => '#ffffff', + 'border_size' => '0', + 'border_radius' => '2', + 'padding' => '10', + 'font_family' => 'Heebo', + ], + ], + [ + 'type' => 'paragraph', + 'id' => 'paragraph', + 'params' => [ + 'content' => '' . $this->replaceLinkTags(_x('We don’t spam! Read our [link]privacy policy[/link] for more info.', 'Text in a web form.', 'mailpoet'), '#') . '', + 'drop_cap' => '0', + 'align' => 'center', + 'font_size' => '13', + 'line_height' => '1.5', + 'text_color' => '#ffffff', + 'background_color' => '', + 'class_name' => '', + ], + ], + ], + ], + ], + 'params' => [ + 'vertical_alignment' => '', + 'class_name' => '', + 'text_color' => '', + 'background_color' => '', + 'gradient' => '', + ], + ], + ]; + } + + public function getSettings(): array { + return [ + 'on_success' => 'message', + 'success_message' => '', + 'segments' => [], + 'segments_selected_by' => 'admin', + 'alignment' => 'left', + 'border_radius' => '0', + 'border_size' => '0', + 'form_padding' => '40', + 'input_padding' => '10', + 'success_validation_color' => '#00d084', + 'error_validation_color' => '#cf2e2e', + 'close_button' => 'classic_white', + 'font_family' => 'Heebo', + 'fontSize' => '15', + 'form_placement' => [ + 'popup' => [ + 'enabled' => '', + ], + 'fixed_bar' => [ + 'enabled' => '', + ], + 'below_posts' => [ + 'enabled' => '1', + 'styles' => [ + 'width' => [ + 'unit' => 'percent', + 'value' => '100', + ], + ], + ], + 'slide_in' => [ + 'enabled' => '', + ], + 'others' => [], + ], + 'backgroundColor' => '#000000', + 'background_image_url' => $this->getAssetUrl('blackfriday-5.png'), + 'background_image_display' => 'scale', + 'fontColor' => '#ffffff', + 'border_color' => '#ffffff', + ]; + } + + public function getStyles(): string { + return << span { + width: 5px; + height: 5px; + background-color: #5b5b5b; +} + +h2.mailpoet-heading { + margin: 0 0 20px 0; +} + +h1.mailpoet-heading { + margin: 0 0 10px; +} +EOL; + } +} diff --git a/lib/Form/Templates/Templates/Template18FixedBar.php b/lib/Form/Templates/Templates/Template18FixedBar.php new file mode 100644 index 0000000000..dacc12eb95 --- /dev/null +++ b/lib/Form/Templates/Templates/Template18FixedBar.php @@ -0,0 +1,411 @@ +getAssetUrl('fixedbar.png'); + } + + public function getBody(): array { + return [ + [ + 'type' => 'divider', + 'params' => [ + 'class_name' => '', + 'height' => '1', + 'type' => 'spacer', + 'style' => 'solid', + 'divider_height' => '1', + 'divider_width' => '100', + 'color' => '#185f70', + ], + 'id' => 'divider', + 'name' => 'Divider', + ], + [ + 'type' => 'columns', + 'body' => [ + [ + 'type' => 'column', + 'params' => [ + 'class_name' => '', + 'vertical_alignment' => '', + 'width' => '50', + ], + 'body' => [ + [ + 'type' => 'paragraph', + 'id' => 'paragraph', + 'params' => [ + 'content' => '' . _x('IT’S HERE! DON’T MISS OUT!', 'Text in a web form', 'mailpoet') . '', + 'drop_cap' => '0', + 'align' => 'center', + 'font_size' => '20', + 'text_color' => '', + 'background_color' => '', + 'class_name' => '', + ], + ], + [ + 'type' => 'divider', + 'params' => [ + 'class_name' => '', + 'height' => '10', + 'type' => 'divider', + 'style' => 'solid', + 'divider_height' => '10', + 'divider_width' => '100', + 'color' => '#ffffff', + ], + 'id' => 'divider', + 'name' => 'Divider', + ], + [ + 'type' => 'divider', + 'params' => [ + 'class_name' => '', + 'height' => '1', + 'type' => 'spacer', + 'style' => 'solid', + 'divider_height' => '1', + 'divider_width' => '100', + 'color' => '#185f70', + ], + 'id' => 'divider', + 'name' => 'Divider', + ], + [ + 'type' => 'columns', + 'body' => [ + [ + 'type' => 'column', + 'params' => [ + 'class_name' => '', + 'vertical_alignment' => '', + 'width' => '50', + ], + 'body' => [ + [ + 'type' => 'heading', + 'id' => 'heading', + 'params' => [ + 'content' => '' . _x('B L A C K', 'Text in a web form (Black Friday).', 'mailpoet') . '', + 'level' => '1', + 'align' => 'center', + 'font_size' => '38', + 'text_color' => '#ffffff', + 'background_color' => '', + 'anchor' => 'block-heading_0.8430326562811867-1602517711078', + 'class_name' => '', + ], + ], + ], + ], + [ + 'type' => 'column', + 'params' => [ + 'class_name' => '', + 'vertical_alignment' => '', + 'width' => '50', + ], + 'body' => [ + [ + 'type' => 'heading', + 'id' => 'heading', + 'params' => [ + 'content' => '' . _x('F R I D A Y', 'Text in a web form (Black Friday).', 'mailpoet') . '', + 'level' => '1', + 'align' => 'center', + 'font_size' => '38', + 'text_color' => '#ffffff', + 'background_color' => '', + 'anchor' => 'block-heading_0.8430326562811867-1602517711078', + 'class_name' => '', + ], + ], + ], + ], + ], + 'params' => [ + 'vertical_alignment' => '', + 'class_name' => '', + 'text_color' => '', + 'background_color' => '', + 'gradient' => '', + ], + ], + [ + 'type' => 'divider', + 'params' => [ + 'class_name' => '', + 'height' => '10', + 'type' => 'divider', + 'style' => 'solid', + 'divider_height' => '10', + 'divider_width' => '100', + 'color' => '#ffffff', + ], + 'id' => 'divider', + 'name' => 'Divider', + ], + [ + 'type' => 'paragraph', + 'id' => 'paragraph', + 'params' => [ + 'content' => '' . _x('ENJOY 50% OFF ON ALL PRODUCTS', 'Text in a web form', 'mailpoet') . '
' . _x('PLUS FREE SHIPPING = ORDERS OVER $100', 'Text in a web form', 'mailpoet') . '
', + 'drop_cap' => '0', + 'align' => 'center', + 'font_size' => '15', + 'line_height' => '1.5', + 'text_color' => '', + 'background_color' => '', + 'class_name' => '', + ], + ], + ], + ], + [ + 'type' => 'column', + 'params' => [ + 'class_name' => '', + 'vertical_alignment' => '', + 'width' => '50', + ], + 'body' => [ + [ + 'type' => 'divider', + 'params' => [ + 'class_name' => '', + 'height' => '50', + 'type' => 'spacer', + 'style' => 'solid', + 'divider_height' => '1', + 'divider_width' => '100', + 'color' => '#185f70', + ], + 'id' => 'divider', + 'name' => 'Divider', + ], + [ + 'type' => 'text', + 'params' => [ + 'label' => _x('Email Address', 'Form label', 'mailpoet'), + 'class_name' => '', + 'required' => '1', + 'label_within' => '1', + ], + 'id' => 'email', + 'name' => 'Email', + 'styles' => [ + 'full_width' => '1', + 'bold' => '1', + 'background_color' => '#ffffff', + 'font_color' => '#5b5e60', + 'border_size' => '0', + 'border_radius' => '2', + ], + ], + [ + 'type' => 'submit', + 'params' => [ + 'label' => _x('GET YOUR COUPON', 'Form label', 'mailpoet'), + 'class_name' => '', + ], + 'id' => 'submit', + 'name' => 'Submit', + 'styles' => [ + 'full_width' => '1', + 'bold' => '1', + 'background_color' => '#cf2e2e', + 'font_size' => '15', + 'font_color' => '#ffffff', + 'border_size' => '0', + 'border_radius' => '2', + 'padding' => '10', + 'font_family' => 'Heebo', + ], + ], + [ + 'type' => 'paragraph', + 'id' => 'paragraph', + 'params' => [ + 'content' => '' . $this->replaceLinkTags(_x('We don’t spam! Read our [link]privacy policy[/link] for more info.', 'Text in a web form.', 'mailpoet'), '#') . '', + 'drop_cap' => '0', + 'align' => 'center', + 'font_size' => '13', + 'line_height' => '1.5', + 'text_color' => '#ffffff', + 'background_color' => '', + 'class_name' => '', + ], + ], + ], + ], + ], + 'params' => [ + 'vertical_alignment' => '', + 'class_name' => '', + 'text_color' => '', + 'background_color' => '', + 'gradient' => '', + ], + ], + ]; + } + + public function getSettings(): array { + return [ + 'on_success' => 'message', + 'success_message' => '', + 'segments' => [], + 'segments_selected_by' => 'admin', + 'alignment' => 'left', + 'border_radius' => '0', + 'border_size' => '5', + 'form_padding' => '0', + 'input_padding' => '10', + 'success_validation_color' => '#00d084', + 'error_validation_color' => '#cf2e2e', + 'close_button' => 'classic_white', + 'font_family' => 'Heebo', + 'fontSize' => '15', + 'form_placement' => [ + 'popup' => [ + 'enabled' => '', + ], + 'fixed_bar' => [ + 'enabled' => '1', + 'styles' => [ + 'width' => [ + 'unit' => 'pixel', + 'value' => '1100', + ], + ], + 'position' => 'bottom', + 'animation' => 'slideup', + ], + 'below_posts' => [ + 'enabled' => '', + ], + 'slide_in' => [ + 'enabled' => '', + ], + 'others' => [], + ], + 'backgroundColor' => '#000000', + 'background_image_url' => $this->getAssetUrl('blackfriday-5.png'), + 'background_image_display' => 'scale', + 'fontColor' => '#ffffff', + 'border_color' => '#ffffff', + ]; + } + + public function getStyles(): string { + return << span { + width: 5px; + height: 5px; + background-color: #5b5b5b; +} + +h2.mailpoet-heading { + margin: 0 0 20px 0; +} + +h1.mailpoet-heading { + margin: 0 0 10px; +} +EOL; + } +} diff --git a/lib/Form/Templates/Templates/Template18Popup.php b/lib/Form/Templates/Templates/Template18Popup.php new file mode 100644 index 0000000000..3e9dd8cba2 --- /dev/null +++ b/lib/Form/Templates/Templates/Template18Popup.php @@ -0,0 +1,351 @@ +getAssetUrl('popup.png'); + } + + public function getBody(): array { + return [ + [ + 'type' => 'columns', + 'body' => [ + [ + 'type' => 'column', + 'params' => [ + 'class_name' => '', + 'vertical_alignment' => '', + 'width' => '10', + ], + ], + [ + 'type' => 'column', + 'params' => [ + 'class_name' => '', + 'vertical_alignment' => '', + 'width' => '80', + ], + 'body' => [ + [ + 'type' => 'divider', + 'params' => [ + 'class_name' => '', + 'height' => '20', + 'type' => 'spacer', + 'style' => 'solid', + 'divider_height' => '1', + 'divider_width' => '100', + 'color' => 'black', + ], + 'id' => 'divider', + 'name' => 'Divider', + ], + [ + 'type' => 'paragraph', + 'id' => 'paragraph', + 'params' => [ + 'content' => '' . _x('IT’S HERE! DON’T MISS OUT!', 'Text in a web form', 'mailpoet') . '', + 'drop_cap' => '0', + 'align' => 'center', + 'font_size' => '20', + 'text_color' => '', + 'background_color' => '', + 'class_name' => '', + ], + ], + [ + 'type' => 'divider', + 'params' => [ + 'class_name' => '', + 'height' => '10', + 'type' => 'divider', + 'style' => 'solid', + 'divider_height' => '10', + 'divider_width' => '100', + 'color' => '#ffffff', + ], + 'id' => 'divider', + 'name' => 'Divider', + ], + [ + 'type' => 'heading', + 'id' => 'heading', + 'params' => [ + 'content' => '' . _x('B L A C K', 'Text in a web form (Black Friday).', 'mailpoet') . '
' . _x('F R I D A Y', 'Text in a web form (Black Friday).', 'mailpoet') . '
', + 'level' => '1', + 'align' => 'center', + 'font_size' => '68', + 'text_color' => '#ffffff', + 'background_color' => '', + 'anchor' => 'block-heading_0.8430326562811867-1602517711078', + 'class_name' => '', + ], + ], + [ + 'type' => 'divider', + 'params' => [ + 'class_name' => '', + 'height' => '10', + 'type' => 'divider', + 'style' => 'solid', + 'divider_height' => '10', + 'divider_width' => '100', + 'color' => '#ffffff', + ], + 'id' => 'divider', + 'name' => 'Divider', + ], + [ + 'type' => 'paragraph', + 'id' => 'paragraph', + 'params' => [ + 'content' => '' . _x('ENJOY 50% OFF ON ALL PRODUCTS', 'Text in a web form', 'mailpoet') . '
' . _x('PLUS FREE SHIPPING = ORDERS OVER $100', 'Text in a web form', 'mailpoet') . '
', + 'drop_cap' => '0', + 'align' => 'center', + 'font_size' => '15', + 'line_height' => '1.5', + 'text_color' => '', + 'background_color' => '', + 'class_name' => '', + ], + ], + [ + 'type' => 'text', + 'params' => [ + 'label' => _x('Email Address', 'Form label', 'mailpoet'), + 'class_name' => '', + 'required' => '1', + 'label_within' => '1', + ], + 'id' => 'email', + 'name' => 'Email', + 'styles' => [ + 'full_width' => '1', + 'bold' => '1', + 'background_color' => '#ffffff', + 'font_color' => '#5b5e60', + 'border_size' => '0', + 'border_radius' => '2', + ], + ], + [ + 'type' => 'submit', + 'params' => [ + 'label' => _x('GET YOUR COUPON', 'Form label', 'mailpoet'), + 'class_name' => '', + ], + 'id' => 'submit', + 'name' => 'Submit', + 'styles' => [ + 'full_width' => '1', + 'bold' => '1', + 'background_color' => '#cf2e2e', + 'font_size' => '15', + 'font_color' => '#ffffff', + 'border_size' => '0', + 'border_radius' => '2', + 'padding' => '10', + 'font_family' => 'Heebo', + ], + ], + [ + 'type' => 'paragraph', + 'id' => 'paragraph', + 'params' => [ + 'content' => '' . $this->replaceLinkTags(_x('We don’t spam! Read our [link]privacy policy[/link] for more info.', 'Text in a web form.', 'mailpoet'), '#') . '', + 'drop_cap' => '0', + 'align' => 'center', + 'font_size' => '13', + 'line_height' => '1.5', + 'text_color' => '#ffffff', + 'background_color' => '', + 'class_name' => '', + ], + ], + [ + 'type' => 'divider', + 'params' => [ + 'class_name' => '', + 'height' => '10', + 'type' => 'spacer', + 'style' => 'solid', + 'divider_height' => '1', + 'divider_width' => '100', + 'color' => '#185f70', + ], + 'id' => 'divider', + 'name' => 'Divider', + ], + ], + ], + [ + 'type' => 'column', + 'params' => [ + 'class_name' => '', + 'vertical_alignment' => '', + 'width' => '10', + ], + ], + ], + 'params' => [ + 'vertical_alignment' => '', + 'class_name' => '', + 'text_color' => '', + 'background_color' => '', + 'gradient' => '', + ], + ], + ]; + } + + public function getSettings(): array { + return [ + 'on_success' => 'message', + 'success_message' => '', + 'segments' => [], + 'segments_selected_by' => 'admin', + 'alignment' => 'left', + 'border_radius' => '4', + 'border_size' => '5', + 'form_padding' => '0', + 'input_padding' => '10', + 'success_validation_color' => '#00d084', + 'error_validation_color' => '#cf2e2e', + 'close_button' => 'classic_white', + 'font_family' => 'Heebo', + 'fontSize' => '15', + 'form_placement' => [ + 'popup' => [ + 'enabled' => '1', + 'styles' => [ + 'width' => [ + 'unit' => 'pixel', + 'value' => '430', + ], + ], + 'animation' => 'slideup', + ], + 'fixed_bar' => [ + 'enabled' => '', + ], + 'below_posts' => [ + 'enabled' => '', + ], + 'slide_in' => [ + 'enabled' => '', + ], + 'others' => [], + ], + 'backgroundColor' => '#000000', + 'background_image_url' => $this->getAssetUrl('blackfriday-5.png'), + 'background_image_display' => 'scale', + 'fontColor' => '#ffffff', + 'border_color' => '#ffffff', + ]; + } + + public function getStyles(): string { + return << span { + width: 5px; + height: 5px; + background-color: #5b5b5b; +} + +h2.mailpoet-heading { + margin: 0 0 20px 0; +} + +h1.mailpoet-heading { + margin: 0 0 10px; +} +EOL; + } +} diff --git a/lib/Form/Templates/Templates/Template18SlideIn.php b/lib/Form/Templates/Templates/Template18SlideIn.php new file mode 100644 index 0000000000..ba71cb533a --- /dev/null +++ b/lib/Form/Templates/Templates/Template18SlideIn.php @@ -0,0 +1,360 @@ +getAssetUrl('slidein.png'); + } + + public function getBody(): array { + return [ + [ + 'type' => 'columns', + 'body' => [ + [ + 'type' => 'column', + 'params' => [ + 'class_name' => '', + 'vertical_alignment' => '', + 'width' => '10', + ], + ], + [ + 'type' => 'column', + 'params' => [ + 'class_name' => '', + 'vertical_alignment' => '', + 'width' => '80', + ], + 'body' => [ + [ + 'type' => 'divider', + 'params' => [ + 'class_name' => '', + 'height' => '20', + 'type' => 'spacer', + 'style' => 'solid', + 'divider_height' => '1', + 'divider_width' => '100', + 'color' => 'black', + ], + 'id' => 'divider', + 'name' => 'Divider', + ], + [ + 'type' => 'paragraph', + 'id' => 'paragraph', + 'params' => [ + 'content' => '' . _x('IT’S HERE! DON’T MISS OUT!', 'Text in a web form', 'mailpoet') . '', + 'drop_cap' => '0', + 'align' => 'center', + 'font_size' => '20', + 'text_color' => '', + 'background_color' => '', + 'class_name' => '', + ], + ], + [ + 'type' => 'divider', + 'params' => [ + 'class_name' => '', + 'height' => '7', + 'type' => 'divider', + 'style' => 'solid', + 'divider_height' => '7', + 'divider_width' => '100', + 'color' => '#ffffff', + ], + 'id' => 'divider', + 'name' => 'Divider', + ], + [ + 'type' => 'heading', + 'id' => 'heading', + 'params' => [ + 'content' => '' . _x('B L A C K', 'Text in a web form (Black Friday).', 'mailpoet') . ' ' . _x('F R I D A Y', 'Text in a web form (Black Friday).', 'mailpoet') . '', + 'level' => '1', + 'align' => 'center', + 'font_size' => '37', + 'text_color' => '#ffffff', + 'background_color' => '', + 'anchor' => 'block-heading_0.8430326562811867-1602517711078', + 'class_name' => '', + ], + ], + [ + 'type' => 'divider', + 'params' => [ + 'class_name' => '', + 'height' => '7', + 'type' => 'divider', + 'style' => 'solid', + 'divider_height' => '7', + 'divider_width' => '100', + 'color' => '#ffffff', + ], + 'id' => 'divider', + 'name' => 'Divider', + ], + [ + 'type' => 'paragraph', + 'id' => 'paragraph', + 'params' => [ + 'content' => '' . _x('ENJOY 50% OFF ON ALL PRODUCTS', 'Text in a web form', 'mailpoet') . '
' . _x('PLUS FREE SHIPPING = ORDERS OVER $100', 'Text in a web form', 'mailpoet') . '
', + 'drop_cap' => '0', + 'align' => 'center', + 'font_size' => '15', + 'line_height' => '1.5', + 'text_color' => '', + 'background_color' => '', + 'class_name' => '', + ], + ], + [ + 'type' => 'text', + 'params' => [ + 'label' => _x('Email Address', 'Form label', 'mailpoet'), + 'class_name' => '', + 'required' => '1', + 'label_within' => '1', + ], + 'id' => 'email', + 'name' => 'Email', + 'styles' => [ + 'full_width' => '1', + 'bold' => '1', + 'background_color' => '#ffffff', + 'font_color' => '#5b5e60', + 'border_size' => '0', + 'border_radius' => '2', + ], + ], + [ + 'type' => 'submit', + 'params' => [ + 'label' => _x('GET YOUR COUPON', 'Form label', 'mailpoet'), + 'class_name' => '', + ], + 'id' => 'submit', + 'name' => 'Submit', + 'styles' => [ + 'full_width' => '1', + 'bold' => '1', + 'background_color' => '#cf2e2e', + 'font_size' => '15', + 'font_color' => '#ffffff', + 'border_size' => '0', + 'border_radius' => '2', + 'padding' => '10', + 'font_family' => 'Heebo', + ], + ], + [ + 'type' => 'paragraph', + 'id' => 'paragraph', + 'params' => [ + 'content' => '' . $this->replaceLinkTags(_x('We don’t spam! Read our [link]privacy policy[/link] for more info.', 'Text in a web form.', 'mailpoet'), '#') . '', + 'drop_cap' => '0', + 'align' => 'center', + 'font_size' => '13', + 'line_height' => '1.5', + 'text_color' => '#ffffff', + 'background_color' => '', + 'class_name' => '', + ], + ], + [ + 'type' => 'divider', + 'params' => [ + 'class_name' => '', + 'height' => '10', + 'type' => 'spacer', + 'style' => 'solid', + 'divider_height' => '1', + 'divider_width' => '100', + 'color' => '#185f70', + ], + 'id' => 'divider', + 'name' => 'Divider', + ], + ], + ], + [ + 'type' => 'column', + 'params' => [ + 'class_name' => '', + 'vertical_alignment' => '', + 'width' => '10', + ], + ], + ], + 'params' => [ + 'vertical_alignment' => '', + 'class_name' => '', + 'text_color' => '', + 'background_color' => '', + 'gradient' => '', + ], + ], + ]; + } + + public function getSettings(): array { + return [ + 'on_success' => 'message', + 'success_message' => '', + 'segments' => [], + 'segments_selected_by' => 'admin', + 'alignment' => 'left', + 'border_radius' => '25', + 'border_size' => '5', + 'form_padding' => '0', + 'input_padding' => '10', + 'success_validation_color' => '#00d084', + 'error_validation_color' => '#cf2e2e', + 'close_button' => 'classic_white', + 'font_family' => 'Heebo', + 'fontSize' => '15', + 'form_placement' => [ + 'popup' => [ + 'enabled' => '', + ], + 'fixed_bar' => [ + 'enabled' => '', + ], + 'below_posts' => [ + 'enabled' => '', + ], + 'slide_in' => [ + 'enabled' => '1', + 'position' => 'right', + 'animation' => 'right', + 'styles' => [ + 'width' => [ + 'unit' => 'pixel', + 'value' => '430', + ], + ], + ], + 'others' => [ + 'enabled' => '1', + 'styles' => [ + 'width' => [ + 'unit' => 'percent', + 'value' => '100', + ], + ], + ], + ], + 'backgroundColor' => '#000000', + 'background_image_url' => $this->getAssetUrl('blackfriday-5.png'), + 'background_image_display' => 'scale', + 'fontColor' => '#ffffff', + 'border_color' => '#ffffff', + ]; + } + + public function getStyles(): string { + return << span { + width: 5px; + height: 5px; + background-color: #5b5b5b; +} + +h2.mailpoet-heading { + margin: 0 0 20px 0; +} + +h1.mailpoet-heading { + margin: 0 0 10px; +} +EOL; + } +} diff --git a/lib/Form/Templates/Templates/Template18Widget.php b/lib/Form/Templates/Templates/Template18Widget.php new file mode 100644 index 0000000000..14345cfcdf --- /dev/null +++ b/lib/Form/Templates/Templates/Template18Widget.php @@ -0,0 +1,322 @@ +getAssetUrl('widget.png'); + } + + public function getBody(): array { + return [ + [ + 'type' => 'columns', + 'body' => [ + [ + 'type' => 'column', + 'params' => [ + 'class_name' => '', + 'vertical_alignment' => '', + 'width' => '12.5', + ], + ], + [ + 'type' => 'column', + 'params' => [ + 'class_name' => '', + 'vertical_alignment' => '', + 'width' => '75', + ], + 'body' => [ + [ + 'type' => 'paragraph', + 'id' => 'paragraph', + 'params' => [ + 'content' => '' . _x('IT’S HERE! DON’T MISS OUT!', 'Text in a web form', 'mailpoet') . '', + 'drop_cap' => '0', + 'align' => 'center', + 'font_size' => '16', + 'text_color' => '', + 'background_color' => '', + 'class_name' => '', + ], + ], + [ + 'type' => 'divider', + 'params' => [ + 'class_name' => '', + 'height' => '7', + 'type' => 'divider', + 'style' => 'solid', + 'divider_height' => '7', + 'divider_width' => '100', + 'color' => '#ffffff', + ], + 'id' => 'divider', + 'name' => 'Divider', + ], + [ + 'type' => 'heading', + 'id' => 'heading', + 'params' => [ + 'content' => '' . _x('B L A C K', 'Text in a web form (Black Friday).', 'mailpoet') . '
' . _x('F R I D A Y', 'Text in a web form (Black Friday).', 'mailpoet') . '
', // @todo Add translations, links and emoji processing., + 'level' => '1', + 'align' => 'center', + 'font_size' => '38', + 'text_color' => '#ffffff', + 'background_color' => '', + 'anchor' => 'block-heading_0.8430326562811867-1602517711078', + 'class_name' => '', + ], + ], + [ + 'type' => 'divider', + 'params' => [ + 'class_name' => '', + 'height' => '7', + 'type' => 'divider', + 'style' => 'solid', + 'divider_height' => '7', + 'divider_width' => '100', + 'color' => '#ffffff', + ], + 'id' => 'divider', + 'name' => 'Divider', + ], + [ + 'type' => 'paragraph', + 'id' => 'paragraph', + 'params' => [ + 'content' => '' . _x('ENJOY 50% OFF ON ALL PRODUCTS', 'Text in a web form', 'mailpoet') . '
' . _x('PLUS FREE SHIPPING = ORDERS OVER $100', 'Text in a web form', 'mailpoet') . '
', + 'drop_cap' => '0', + 'align' => 'center', + 'font_size' => '13', + 'line_height' => '1.5', + 'text_color' => '', + 'background_color' => '', + 'class_name' => '', + ], + ], + [ + 'type' => 'text', + 'params' => [ + 'label' => _x('Email Address', 'Form label', 'mailpoet'), + 'class_name' => '', + 'required' => '1', + 'label_within' => '1', + ], + 'id' => 'email', + 'name' => 'Email', + 'styles' => [ + 'full_width' => '1', + 'bold' => '1', + 'background_color' => '#ffffff', + 'font_color' => '#5b5e60', + 'border_size' => '0', + 'border_radius' => '2', + ], + ], + [ + 'type' => 'submit', + 'params' => [ + 'label' => _x('GET YOUR COUPON', 'Form label', 'mailpoet'), + 'class_name' => '', + ], + 'id' => 'submit', + 'name' => 'Submit', + 'styles' => [ + 'full_width' => '1', + 'bold' => '1', + 'background_color' => '#cf2e2e', + 'font_size' => '15', + 'font_color' => '#ffffff', + 'border_size' => '0', + 'border_radius' => '2', + 'padding' => '10', + 'font_family' => 'Heebo', + ], + ], + [ + 'type' => 'paragraph', + 'id' => 'paragraph', + 'params' => [ + 'content' => '' . $this->replaceLinkTags(_x('We don’t spam! Read our [link]privacy policy[/link] for more info.', 'Text in a web form.', 'mailpoet'), '#') . '', + 'drop_cap' => '0', + 'align' => 'center', + 'font_size' => '13', + 'line_height' => '1.5', + 'text_color' => '#ffffff', + 'background_color' => '', + 'class_name' => '', + ], + ], + ], + ], + [ + 'type' => 'column', + 'params' => [ + 'class_name' => '', + 'vertical_alignment' => '', + 'width' => '12.5', + ], + ], + ], + 'params' => [ + 'vertical_alignment' => '', + 'class_name' => '', + 'text_color' => '', + 'background_color' => '', + 'gradient' => '', + ], + ], + ]; + } + + public function getSettings(): array { + return [ + 'on_success' => 'message', + 'success_message' => '', + 'segments' => [], + 'segments_selected_by' => 'admin', + 'alignment' => 'left', + 'border_radius' => '0', + 'border_size' => '0', + 'form_padding' => '30', + 'input_padding' => '10', + 'success_validation_color' => '#00d084', + 'error_validation_color' => '#cf2e2e', + 'close_button' => 'classic_white', + 'font_family' => 'Heebo', + 'fontSize' => '15', + 'form_placement' => [ + 'popup' => [ + 'enabled' => '', + ], + 'fixed_bar' => [ + 'enabled' => '', + ], + 'below_posts' => [ + 'enabled' => '', + ], + 'slide_in' => [ + 'enabled' => '', + ], + 'others' => [ + 'styles' => [ + 'width' => [ + 'unit' => 'percent', + 'value' => '100', + ], + ], + ], + ], + 'backgroundColor' => '#000000', + 'background_image_url' => $this->getAssetUrl('blackfriday-5.png'), + 'background_image_display' => 'scale', + 'fontColor' => '#ffffff', + ]; + } + + public function getStyles(): string { + return << span { + width: 5px; + height: 5px; + background-color: #5b5b5b; +} + +h2.mailpoet-heading { + margin: 0 0 20px 0; +} + +h1.mailpoet-heading { + margin: 0 0 10px; +} +EOL; + } +} diff --git a/plugin_repository/assets/form-templates/template-18/belowpage.png b/plugin_repository/assets/form-templates/template-18/belowpage.png new file mode 100644 index 0000000000..7d498b3fdb Binary files /dev/null and b/plugin_repository/assets/form-templates/template-18/belowpage.png differ diff --git a/plugin_repository/assets/form-templates/template-18/blackfriday-5.png b/plugin_repository/assets/form-templates/template-18/blackfriday-5.png new file mode 100644 index 0000000000..26d176bc4d Binary files /dev/null and b/plugin_repository/assets/form-templates/template-18/blackfriday-5.png differ diff --git a/plugin_repository/assets/form-templates/template-18/fixedbar.png b/plugin_repository/assets/form-templates/template-18/fixedbar.png new file mode 100644 index 0000000000..5f0b701a13 Binary files /dev/null and b/plugin_repository/assets/form-templates/template-18/fixedbar.png differ diff --git a/plugin_repository/assets/form-templates/template-18/popup.png b/plugin_repository/assets/form-templates/template-18/popup.png new file mode 100644 index 0000000000..8e908258f5 Binary files /dev/null and b/plugin_repository/assets/form-templates/template-18/popup.png differ diff --git a/plugin_repository/assets/form-templates/template-18/slidein.png b/plugin_repository/assets/form-templates/template-18/slidein.png new file mode 100644 index 0000000000..60f4cb24c9 Binary files /dev/null and b/plugin_repository/assets/form-templates/template-18/slidein.png differ diff --git a/plugin_repository/assets/form-templates/template-18/widget.png b/plugin_repository/assets/form-templates/template-18/widget.png new file mode 100644 index 0000000000..52d28da9b8 Binary files /dev/null and b/plugin_repository/assets/form-templates/template-18/widget.png differ