Add Test 18 form based templates
[MAILPOET-3209]
This commit is contained in:
committed by
Veljko V
parent
150743a533
commit
3c5dc77889
@ -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,
|
||||
],
|
||||
];
|
||||
|
||||
|
@ -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) {
|
||||
|
395
lib/Form/Templates/Templates/Template18BelowPages.php
Normal file
395
lib/Form/Templates/Templates/Template18BelowPages.php
Normal file
@ -0,0 +1,395 @@
|
||||
<?php
|
||||
|
||||
namespace MailPoet\Form\Templates\Templates;
|
||||
|
||||
use MailPoet\Form\Templates\FormTemplate;
|
||||
|
||||
class Template18BelowPages extends FormTemplate {
|
||||
const ID = 'template_18_below_pages';
|
||||
|
||||
/** @var string */
|
||||
protected $assetsDirectory = 'template-18';
|
||||
|
||||
public function getName(): string {
|
||||
return _x('Black Friday', 'Form template name', 'mailpoet');
|
||||
}
|
||||
|
||||
public function getThumbnailUrl(): string {
|
||||
return $this->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' => '<strong><span style="font-family: Heebo" data-font="Heebo" class="mailpoet-has-font">' . _x('IT’S HERE! DON’T MISS OUT!', 'Text in a web form', 'mailpoet') . '</span></strong>',
|
||||
'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' => '<strong><span style="font-family: Fjalla One" data-font="Fjalla One" class="mailpoet-has-font"><strong>' . _x('B L A C K', 'Text in a web form (Black Friday).', 'mailpoet') . '</strong></span></strong>',
|
||||
'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' => '<strong><span style="font-family: Fjalla One" data-font="Fjalla One" class="mailpoet-has-font">' . _x('F R I D A Y', 'Text in a web form (Black Friday).', 'mailpoet') . '</span></strong>',
|
||||
'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' => '<span style="font-family: Heebo" data-font="Heebo" class="mailpoet-has-font"><strong>' . _x('ENJOY 50% OFF ON ALL PRODUCTS', 'Text in a web form', 'mailpoet') . '<br></strong>' . _x('PLUS FREE SHIPPING = ORDERS OVER $100', 'Text in a web form', 'mailpoet') . '</span>',
|
||||
'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' => '<span style="font-family: Heebo" data-font="Heebo" class="mailpoet-has-font">' . $this->replaceLinkTags(_x('We don’t spam! Read our [link]privacy policy[/link] for more info.', 'Text in a web form.', 'mailpoet'), '#') . '</span>',
|
||||
'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 <<<EOL
|
||||
/* form */
|
||||
.mailpoet_form {
|
||||
}
|
||||
|
||||
form {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.wp-block-column:not(:first-child),
|
||||
.mailpoet_form_column:not(:first-child) {
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
/* columns */
|
||||
.mailpoet_column_with_background {
|
||||
padding: 10px;
|
||||
}
|
||||
/* space between columns */
|
||||
.mailpoet_form_column:not(:first-child) {
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
/* input wrapper (label + input) */
|
||||
.mailpoet_paragraph {
|
||||
line-height:20px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.mailpoet_form_paragraph last {
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
/* labels */
|
||||
.mailpoet_segment_label,
|
||||
.mailpoet_text_label,
|
||||
.mailpoet_textarea_label,
|
||||
.mailpoet_select_label,
|
||||
.mailpoet_radio_label,
|
||||
.mailpoet_checkbox_label,
|
||||
.mailpoet_list_label,
|
||||
.mailpoet_date_label {
|
||||
display:block;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
/* inputs */
|
||||
.mailpoet_text,
|
||||
.mailpoet_textarea,
|
||||
.mailpoet_select,
|
||||
.mailpoet_date_month,
|
||||
.mailpoet_date_day,
|
||||
.mailpoet_date_year,
|
||||
.mailpoet_date {
|
||||
display:block;
|
||||
}
|
||||
|
||||
.mailpoet_text,
|
||||
.mailpoet_textarea {
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.mailpoet_checkbox {
|
||||
}
|
||||
|
||||
.mailpoet_submit {
|
||||
}
|
||||
|
||||
.mailpoet_divider {
|
||||
}
|
||||
|
||||
.mailpoet_message {
|
||||
}
|
||||
|
||||
.mailpoet_form_loading {
|
||||
width: 30px;
|
||||
text-align: center;
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
.mailpoet_form_loading > span {
|
||||
width: 5px;
|
||||
height: 5px;
|
||||
background-color: #5b5b5b;
|
||||
}
|
||||
|
||||
h2.mailpoet-heading {
|
||||
margin: 0 0 20px 0;
|
||||
}
|
||||
|
||||
h1.mailpoet-heading {
|
||||
margin: 0 0 10px;
|
||||
}
|
||||
EOL;
|
||||
}
|
||||
}
|
411
lib/Form/Templates/Templates/Template18FixedBar.php
Normal file
411
lib/Form/Templates/Templates/Template18FixedBar.php
Normal file
@ -0,0 +1,411 @@
|
||||
<?php
|
||||
|
||||
namespace MailPoet\Form\Templates\Templates;
|
||||
|
||||
use MailPoet\Form\Templates\FormTemplate;
|
||||
|
||||
class Template18FixedBar extends FormTemplate {
|
||||
const ID = 'template_18_fixed_bar';
|
||||
|
||||
/** @var string */
|
||||
protected $assetsDirectory = 'template-18';
|
||||
|
||||
public function getName(): string {
|
||||
return _x('Black Friday', 'Form template name', 'mailpoet');
|
||||
}
|
||||
|
||||
public function getThumbnailUrl(): string {
|
||||
return $this->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' => '<strong><span style="font-family: Heebo" data-font="Heebo" class="mailpoet-has-font">' . _x('IT’S HERE! DON’T MISS OUT!', 'Text in a web form', 'mailpoet') . '</span></strong>',
|
||||
'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' => '<strong><span style="font-family: Fjalla One" data-font="Fjalla One" class="mailpoet-has-font"><strong>' . _x('B L A C K', 'Text in a web form (Black Friday).', 'mailpoet') . '</strong></span></strong>',
|
||||
'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' => '<strong><span style="font-family: Fjalla One" data-font="Fjalla One" class="mailpoet-has-font">' . _x('F R I D A Y', 'Text in a web form (Black Friday).', 'mailpoet') . '</span></strong>',
|
||||
'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' => '<span style="font-family: Heebo" data-font="Heebo" class="mailpoet-has-font"><strong>' . _x('ENJOY 50% OFF ON ALL PRODUCTS', 'Text in a web form', 'mailpoet') . '<br></strong>' . _x('PLUS FREE SHIPPING = ORDERS OVER $100', 'Text in a web form', 'mailpoet') . '</span>',
|
||||
'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' => '<span style="font-family: Heebo" data-font="Heebo" class="mailpoet-has-font">' . $this->replaceLinkTags(_x('We don’t spam! Read our [link]privacy policy[/link] for more info.', 'Text in a web form.', 'mailpoet'), '#') . '</span>',
|
||||
'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 <<<EOL
|
||||
/* form */
|
||||
.mailpoet_form {
|
||||
}
|
||||
|
||||
form {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.wp-block-column:not(:first-child),
|
||||
.mailpoet_form_column:not(:first-child) {
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
/* columns */
|
||||
.mailpoet_column_with_background {
|
||||
padding: 10px;
|
||||
}
|
||||
/* space between columns */
|
||||
.mailpoet_form_column:not(:first-child) {
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
/* input wrapper (label + input) */
|
||||
.mailpoet_paragraph {
|
||||
line-height:20px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.mailpoet_form_paragraph last {
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
/* labels */
|
||||
.mailpoet_segment_label,
|
||||
.mailpoet_text_label,
|
||||
.mailpoet_textarea_label,
|
||||
.mailpoet_select_label,
|
||||
.mailpoet_radio_label,
|
||||
.mailpoet_checkbox_label,
|
||||
.mailpoet_list_label,
|
||||
.mailpoet_date_label {
|
||||
display:block;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
/* inputs */
|
||||
.mailpoet_text,
|
||||
.mailpoet_textarea,
|
||||
.mailpoet_select,
|
||||
.mailpoet_date_month,
|
||||
.mailpoet_date_day,
|
||||
.mailpoet_date_year,
|
||||
.mailpoet_date {
|
||||
display:block;
|
||||
}
|
||||
|
||||
.mailpoet_text,
|
||||
.mailpoet_textarea {
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.mailpoet_checkbox {
|
||||
}
|
||||
|
||||
.mailpoet_submit {
|
||||
}
|
||||
|
||||
.mailpoet_divider {
|
||||
}
|
||||
|
||||
.mailpoet_message {
|
||||
}
|
||||
|
||||
.mailpoet_form_loading {
|
||||
width: 30px;
|
||||
text-align: center;
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
.mailpoet_form_loading > span {
|
||||
width: 5px;
|
||||
height: 5px;
|
||||
background-color: #5b5b5b;
|
||||
}
|
||||
|
||||
h2.mailpoet-heading {
|
||||
margin: 0 0 20px 0;
|
||||
}
|
||||
|
||||
h1.mailpoet-heading {
|
||||
margin: 0 0 10px;
|
||||
}
|
||||
EOL;
|
||||
}
|
||||
}
|
351
lib/Form/Templates/Templates/Template18Popup.php
Normal file
351
lib/Form/Templates/Templates/Template18Popup.php
Normal file
@ -0,0 +1,351 @@
|
||||
<?php
|
||||
|
||||
namespace MailPoet\Form\Templates\Templates;
|
||||
|
||||
use MailPoet\Form\Templates\FormTemplate;
|
||||
|
||||
class Template18Popup extends FormTemplate {
|
||||
const ID = 'template_18_popup';
|
||||
|
||||
/** @var string */
|
||||
protected $assetsDirectory = 'template-18';
|
||||
|
||||
public function getName(): string {
|
||||
return _x('Black Friday', 'Form template name', 'mailpoet');
|
||||
}
|
||||
|
||||
public function getThumbnailUrl(): string {
|
||||
return $this->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' => '<strong><span style="font-family: Heebo" data-font="Heebo" class="mailpoet-has-font">' . _x('IT’S HERE! DON’T MISS OUT!', 'Text in a web form', 'mailpoet') . '</span></strong>',
|
||||
'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' => '<strong><span style="font-family: Fjalla One" data-font="Fjalla One" class="mailpoet-has-font">' . _x('B L A C K', 'Text in a web form (Black Friday).', 'mailpoet') . '<br>' . _x('F R I D A Y', 'Text in a web form (Black Friday).', 'mailpoet') . '</span></strong>',
|
||||
'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' => '<span style="font-family: Heebo" data-font="Heebo" class="mailpoet-has-font"><strong>' . _x('ENJOY 50% OFF ON ALL PRODUCTS', 'Text in a web form', 'mailpoet') . '<br></strong>' . _x('PLUS FREE SHIPPING = ORDERS OVER $100', 'Text in a web form', 'mailpoet') . '</span>',
|
||||
'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' => '<span style="font-family: Heebo" data-font="Heebo" class="mailpoet-has-font">' . $this->replaceLinkTags(_x('We don’t spam! Read our [link]privacy policy[/link] for more info.', 'Text in a web form.', 'mailpoet'), '#') . '</span>',
|
||||
'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 <<<EOL
|
||||
/* form */
|
||||
.mailpoet_form {
|
||||
}
|
||||
|
||||
form {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
/* columns */
|
||||
.mailpoet_column_with_background {
|
||||
padding: 10px;
|
||||
}
|
||||
/* space between columns */
|
||||
.mailpoet_form_column:not(:first-child) {
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
/* input wrapper (label + input) */
|
||||
.mailpoet_paragraph {
|
||||
line-height:20px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.mailpoet_form_paragraph last {
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
/* labels */
|
||||
.mailpoet_segment_label,
|
||||
.mailpoet_text_label,
|
||||
.mailpoet_textarea_label,
|
||||
.mailpoet_select_label,
|
||||
.mailpoet_radio_label,
|
||||
.mailpoet_checkbox_label,
|
||||
.mailpoet_list_label,
|
||||
.mailpoet_date_label {
|
||||
display:block;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
/* inputs */
|
||||
.mailpoet_text,
|
||||
.mailpoet_textarea,
|
||||
.mailpoet_select,
|
||||
.mailpoet_date_month,
|
||||
.mailpoet_date_day,
|
||||
.mailpoet_date_year,
|
||||
.mailpoet_date {
|
||||
display:block;
|
||||
}
|
||||
|
||||
.mailpoet_text,
|
||||
.mailpoet_textarea {
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.mailpoet_checkbox {
|
||||
}
|
||||
|
||||
.mailpoet_submit {
|
||||
}
|
||||
|
||||
.mailpoet_divider {
|
||||
}
|
||||
|
||||
.mailpoet_message {
|
||||
}
|
||||
|
||||
.mailpoet_form_loading {
|
||||
width: 30px;
|
||||
text-align: center;
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
.mailpoet_form_loading > span {
|
||||
width: 5px;
|
||||
height: 5px;
|
||||
background-color: #5b5b5b;
|
||||
}
|
||||
|
||||
h2.mailpoet-heading {
|
||||
margin: 0 0 20px 0;
|
||||
}
|
||||
|
||||
h1.mailpoet-heading {
|
||||
margin: 0 0 10px;
|
||||
}
|
||||
EOL;
|
||||
}
|
||||
}
|
360
lib/Form/Templates/Templates/Template18SlideIn.php
Normal file
360
lib/Form/Templates/Templates/Template18SlideIn.php
Normal file
@ -0,0 +1,360 @@
|
||||
<?php
|
||||
|
||||
namespace MailPoet\Form\Templates\Templates;
|
||||
|
||||
use MailPoet\Form\Templates\FormTemplate;
|
||||
|
||||
class Template18SlideIn extends FormTemplate {
|
||||
const ID = 'tempalete_18_slide_in';
|
||||
|
||||
/** @var string */
|
||||
protected $assetsDirectory = 'template-18';
|
||||
|
||||
public function getName(): string {
|
||||
return _x('Black Friday', 'Form template name', 'mailpoet');
|
||||
}
|
||||
|
||||
public function getThumbnailUrl(): string {
|
||||
return $this->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' => '<strong><span style="font-family: Heebo" data-font="Heebo" class="mailpoet-has-font">' . _x('IT’S HERE! DON’T MISS OUT!', 'Text in a web form', 'mailpoet') . '</span></strong>',
|
||||
'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' => '<strong><span style="font-family: Fjalla One" data-font="Fjalla One" class="mailpoet-has-font">' . _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') . '</span></strong>',
|
||||
'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' => '<span style="font-family: Heebo" data-font="Heebo" class="mailpoet-has-font"><strong>' . _x('ENJOY 50% OFF ON ALL PRODUCTS', 'Text in a web form', 'mailpoet') . '<br></strong>' . _x('PLUS FREE SHIPPING = ORDERS OVER $100', 'Text in a web form', 'mailpoet') . '</span>',
|
||||
'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' => '<span style="font-family: Heebo" data-font="Heebo" class="mailpoet-has-font">' . $this->replaceLinkTags(_x('We don’t spam! Read our [link]privacy policy[/link] for more info.', 'Text in a web form.', 'mailpoet'), '#') . '</span>',
|
||||
'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 <<<EOL
|
||||
/* form */
|
||||
.mailpoet_form {
|
||||
}
|
||||
|
||||
form {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
/* columns */
|
||||
.mailpoet_column_with_background {
|
||||
padding: 10px;
|
||||
}
|
||||
/* space between columns */
|
||||
.mailpoet_form_column:not(:first-child) {
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
/* input wrapper (label + input) */
|
||||
.mailpoet_paragraph {
|
||||
line-height:20px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.mailpoet_form_paragraph last {
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
/* labels */
|
||||
.mailpoet_segment_label,
|
||||
.mailpoet_text_label,
|
||||
.mailpoet_textarea_label,
|
||||
.mailpoet_select_label,
|
||||
.mailpoet_radio_label,
|
||||
.mailpoet_checkbox_label,
|
||||
.mailpoet_list_label,
|
||||
.mailpoet_date_label {
|
||||
display:block;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
/* inputs */
|
||||
.mailpoet_text,
|
||||
.mailpoet_textarea,
|
||||
.mailpoet_select,
|
||||
.mailpoet_date_month,
|
||||
.mailpoet_date_day,
|
||||
.mailpoet_date_year,
|
||||
.mailpoet_date {
|
||||
display:block;
|
||||
}
|
||||
|
||||
.mailpoet_text,
|
||||
.mailpoet_textarea {
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.mailpoet_checkbox {
|
||||
}
|
||||
|
||||
.mailpoet_submit {
|
||||
}
|
||||
|
||||
.mailpoet_divider {
|
||||
}
|
||||
|
||||
.mailpoet_message {
|
||||
}
|
||||
|
||||
.mailpoet_form_loading {
|
||||
width: 30px;
|
||||
text-align: center;
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
.mailpoet_form_loading > span {
|
||||
width: 5px;
|
||||
height: 5px;
|
||||
background-color: #5b5b5b;
|
||||
}
|
||||
|
||||
h2.mailpoet-heading {
|
||||
margin: 0 0 20px 0;
|
||||
}
|
||||
|
||||
h1.mailpoet-heading {
|
||||
margin: 0 0 10px;
|
||||
}
|
||||
EOL;
|
||||
}
|
||||
}
|
322
lib/Form/Templates/Templates/Template18Widget.php
Normal file
322
lib/Form/Templates/Templates/Template18Widget.php
Normal file
@ -0,0 +1,322 @@
|
||||
<?php
|
||||
|
||||
namespace MailPoet\Form\Templates\Templates;
|
||||
|
||||
use MailPoet\Form\Templates\FormTemplate;
|
||||
|
||||
class Template18Widget extends FormTemplate {
|
||||
const ID = 'template_18_widget';
|
||||
|
||||
/** @var string */
|
||||
protected $assetsDirectory = 'template-18';
|
||||
|
||||
public function getName(): string {
|
||||
return _x('Black Friday', 'Form template name', 'mailpoet');
|
||||
}
|
||||
|
||||
public function getThumbnailUrl(): string {
|
||||
return $this->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' => '<strong><span style="font-family: Heebo" data-font="Heebo" class="mailpoet-has-font">' . _x('IT’S HERE! DON’T MISS OUT!', 'Text in a web form', 'mailpoet') . '</span></strong>',
|
||||
'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' => '<strong><span style="font-family: Fjalla One" data-font="Fjalla One" class="mailpoet-has-font">' . _x('B L A C K', 'Text in a web form (Black Friday).', 'mailpoet') . '<br>' . _x('F R I D A Y', 'Text in a web form (Black Friday).', 'mailpoet') . '</span></strong>', // @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' => '<span style="font-family: Heebo" data-font="Heebo" class="mailpoet-has-font"><strong>' . _x('ENJOY 50% OFF ON ALL PRODUCTS', 'Text in a web form', 'mailpoet') . '<br></strong>' . _x('PLUS FREE SHIPPING = ORDERS OVER $100', 'Text in a web form', 'mailpoet') . '</span>',
|
||||
'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' => '<span style="font-family: Heebo" data-font="Heebo" class="mailpoet-has-font">' . $this->replaceLinkTags(_x('We don’t spam! Read our [link]privacy policy[/link] for more info.', 'Text in a web form.', 'mailpoet'), '#') . '</span>',
|
||||
'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 <<<EOL
|
||||
/* form */
|
||||
.mailpoet_form {
|
||||
}
|
||||
|
||||
form {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
/* columns */
|
||||
.mailpoet_column_with_background {
|
||||
padding: 10px;
|
||||
}
|
||||
/* space between columns */
|
||||
.mailpoet_form_column:not(:first-child) {
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
/* input wrapper (label + input) */
|
||||
.mailpoet_paragraph {
|
||||
line-height:20px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.mailpoet_form_paragraph last {
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
/* labels */
|
||||
.mailpoet_segment_label,
|
||||
.mailpoet_text_label,
|
||||
.mailpoet_textarea_label,
|
||||
.mailpoet_select_label,
|
||||
.mailpoet_radio_label,
|
||||
.mailpoet_checkbox_label,
|
||||
.mailpoet_list_label,
|
||||
.mailpoet_date_label {
|
||||
display:block;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
/* inputs */
|
||||
.mailpoet_text,
|
||||
.mailpoet_textarea,
|
||||
.mailpoet_select,
|
||||
.mailpoet_date_month,
|
||||
.mailpoet_date_day,
|
||||
.mailpoet_date_year,
|
||||
.mailpoet_date {
|
||||
display:block;
|
||||
}
|
||||
|
||||
.mailpoet_text,
|
||||
.mailpoet_textarea {
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.mailpoet_checkbox {
|
||||
}
|
||||
|
||||
.mailpoet_submit {
|
||||
}
|
||||
|
||||
.mailpoet_divider {
|
||||
}
|
||||
|
||||
.mailpoet_message {
|
||||
}
|
||||
|
||||
.mailpoet_form_loading {
|
||||
width: 30px;
|
||||
text-align: center;
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
.mailpoet_form_loading > span {
|
||||
width: 5px;
|
||||
height: 5px;
|
||||
background-color: #5b5b5b;
|
||||
}
|
||||
|
||||
h2.mailpoet-heading {
|
||||
margin: 0 0 20px 0;
|
||||
}
|
||||
|
||||
h1.mailpoet-heading {
|
||||
margin: 0 0 10px;
|
||||
}
|
||||
EOL;
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 48 KiB |
Binary file not shown.
After Width: | Height: | Size: 47 KiB |
BIN
plugin_repository/assets/form-templates/template-18/fixedbar.png
Normal file
BIN
plugin_repository/assets/form-templates/template-18/fixedbar.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 42 KiB |
BIN
plugin_repository/assets/form-templates/template-18/popup.png
Normal file
BIN
plugin_repository/assets/form-templates/template-18/popup.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 47 KiB |
BIN
plugin_repository/assets/form-templates/template-18/slidein.png
Normal file
BIN
plugin_repository/assets/form-templates/template-18/slidein.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 45 KiB |
BIN
plugin_repository/assets/form-templates/template-18/widget.png
Normal file
BIN
plugin_repository/assets/form-templates/template-18/widget.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 46 KiB |
Reference in New Issue
Block a user