init
This commit is contained in:
@@ -0,0 +1,114 @@
|
||||
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
|
||||
|
||||
namespace MailPoet\Config;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
use MailPoet\Automation\Engine\Engine;
|
||||
use MailPoet\WP\Functions as WPFunctions;
|
||||
|
||||
class AccessControl {
|
||||
const PERMISSION_ACCESS_PLUGIN_ADMIN = 'mailpoet_access_plugin_admin';
|
||||
const PERMISSION_MANAGE_SETTINGS = 'mailpoet_manage_settings';
|
||||
const PERMISSION_MANAGE_FEATURES = 'mailpoet_manage_features';
|
||||
const PERMISSION_MANAGE_EMAILS = 'mailpoet_manage_emails';
|
||||
const PERMISSION_MANAGE_SUBSCRIBERS = 'mailpoet_manage_subscribers';
|
||||
const PERMISSION_MANAGE_FORMS = 'mailpoet_manage_forms';
|
||||
const PERMISSION_MANAGE_SEGMENTS = 'mailpoet_manage_segments';
|
||||
const PERMISSION_MANAGE_AUTOMATIONS = Engine::CAPABILITY_MANAGE_AUTOMATIONS;
|
||||
const PERMISSION_MANAGE_HELP = 'mailpoet_manage_help';
|
||||
const NO_ACCESS_RESTRICTION = 'mailpoet_no_access_restriction';
|
||||
const ALL_ROLES_ACCESS = 'mailpoet_all_roles_access';
|
||||
|
||||
public function getDefaultPermissions() {
|
||||
return [
|
||||
self::PERMISSION_ACCESS_PLUGIN_ADMIN => WPFunctions::get()->applyFilters(
|
||||
'mailpoet_permission_access_plugin_admin',
|
||||
[
|
||||
'administrator',
|
||||
'editor',
|
||||
]
|
||||
),
|
||||
self::PERMISSION_MANAGE_SETTINGS => WPFunctions::get()->applyFilters(
|
||||
'mailpoet_permission_manage_settings',
|
||||
[
|
||||
'administrator',
|
||||
]
|
||||
),
|
||||
self::PERMISSION_MANAGE_FEATURES => WPFunctions::get()->applyFilters(
|
||||
'mailpoet_permission_manage_features',
|
||||
[
|
||||
'administrator',
|
||||
]
|
||||
),
|
||||
self::PERMISSION_MANAGE_EMAILS => WPFunctions::get()->applyFilters(
|
||||
'mailpoet_permission_manage_emails',
|
||||
[
|
||||
'administrator',
|
||||
'editor',
|
||||
]
|
||||
),
|
||||
self::PERMISSION_MANAGE_SUBSCRIBERS => WPFunctions::get()->applyFilters(
|
||||
'mailpoet_permission_manage_subscribers',
|
||||
[
|
||||
'administrator',
|
||||
]
|
||||
),
|
||||
self::PERMISSION_MANAGE_FORMS => WPFunctions::get()->applyFilters(
|
||||
'mailpoet_permission_manage_forms',
|
||||
[
|
||||
'administrator',
|
||||
]
|
||||
),
|
||||
self::PERMISSION_MANAGE_SEGMENTS => WPFunctions::get()->applyFilters(
|
||||
'mailpoet_permission_manage_segments',
|
||||
[
|
||||
'administrator',
|
||||
]
|
||||
),
|
||||
self::PERMISSION_MANAGE_AUTOMATIONS => WPFunctions::get()->applyFilters(
|
||||
'mailpoet_permission_manage_automations',
|
||||
[
|
||||
'administrator',
|
||||
'editor',
|
||||
]
|
||||
),
|
||||
self::PERMISSION_MANAGE_HELP => WPFunctions::get()->applyFilters(
|
||||
'mailpoet_permission_manage_help',
|
||||
[
|
||||
'administrator',
|
||||
'editor',
|
||||
]
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
public function getPermissionLabels() {
|
||||
return [
|
||||
self::PERMISSION_ACCESS_PLUGIN_ADMIN => __('Admin menu item', 'mailpoet'),
|
||||
self::PERMISSION_MANAGE_SETTINGS => __('Manage settings', 'mailpoet'),
|
||||
self::PERMISSION_MANAGE_FEATURES => __('Manage features', 'mailpoet'),
|
||||
self::PERMISSION_MANAGE_EMAILS => __('Manage emails', 'mailpoet'),
|
||||
self::PERMISSION_MANAGE_SUBSCRIBERS => __('Manage subscribers', 'mailpoet'),
|
||||
self::PERMISSION_MANAGE_FORMS => __('Manage forms', 'mailpoet'),
|
||||
self::PERMISSION_MANAGE_SEGMENTS => __('Manage segments', 'mailpoet'),
|
||||
self::PERMISSION_MANAGE_AUTOMATIONS => __('Manage automations', 'mailpoet'),
|
||||
self::PERMISSION_MANAGE_HELP => __('Manage help', 'mailpoet'),
|
||||
];
|
||||
}
|
||||
|
||||
public function validatePermission($permission) {
|
||||
if ($permission === self::NO_ACCESS_RESTRICTION) return true;
|
||||
if ($permission === self::ALL_ROLES_ACCESS) {
|
||||
$capabilities = array_keys($this->getDefaultPermissions());
|
||||
foreach ($capabilities as $capability) {
|
||||
if (WPFunctions::get()->currentUserCan($capability)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return WPFunctions::get()->currentUserCan($permission);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,169 @@
|
||||
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
|
||||
|
||||
namespace MailPoet\Config;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
use MailPoet\Cron\ActionScheduler\ActionScheduler as CronActionScheduler;
|
||||
use MailPoet\Cron\CronTrigger;
|
||||
use MailPoet\InvalidStateException;
|
||||
use MailPoet\Migrator\Migrator;
|
||||
use MailPoet\Settings\SettingsController;
|
||||
use MailPoet\Util\Notices\DisabledMailFunctionNotice;
|
||||
use MailPoet\WP\Functions as WPFunctions;
|
||||
use MailPoetVendor\Doctrine\DBAL\Connection;
|
||||
|
||||
class Activator {
|
||||
public const TRANSIENT_ACTIVATE_KEY = 'mailpoet_activator_activate';
|
||||
private const TRANSIENT_EXPIRATION = 120; // seconds
|
||||
|
||||
/** @var Connection */
|
||||
private $connection;
|
||||
|
||||
/** @var SettingsController */
|
||||
private $settings;
|
||||
|
||||
/** @var Populator */
|
||||
private $populator;
|
||||
|
||||
/** @var WPFunctions */
|
||||
private $wp;
|
||||
|
||||
/** @var Migrator */
|
||||
private $migrator;
|
||||
|
||||
/** @var CronActionScheduler */
|
||||
private $cronActionSchedulerRunner;
|
||||
|
||||
public function __construct(
|
||||
Connection $connection,
|
||||
SettingsController $settings,
|
||||
Populator $populator,
|
||||
WPFunctions $wp,
|
||||
Migrator $migrator,
|
||||
CronActionScheduler $cronActionSchedulerRunner
|
||||
) {
|
||||
$this->connection = $connection;
|
||||
$this->settings = $settings;
|
||||
$this->populator = $populator;
|
||||
$this->wp = $wp;
|
||||
$this->migrator = $migrator;
|
||||
$this->cronActionSchedulerRunner = $cronActionSchedulerRunner;
|
||||
}
|
||||
|
||||
public function activate() {
|
||||
$isRunning = $this->wp->getTransient(self::TRANSIENT_ACTIVATE_KEY);
|
||||
if ($isRunning === false) {
|
||||
$this->lockActivation();
|
||||
try {
|
||||
$this->processActivate();
|
||||
} finally {
|
||||
$this->unlockActivation();
|
||||
}
|
||||
} else {
|
||||
throw new InvalidStateException(__('MailPoet version update is in progress, please refresh the page in a minute.', 'mailpoet'));
|
||||
}
|
||||
}
|
||||
|
||||
private function lockActivation(): void {
|
||||
$this->wp->setTransient(self::TRANSIENT_ACTIVATE_KEY, '1', self::TRANSIENT_EXPIRATION);
|
||||
}
|
||||
|
||||
private function unlockActivation(): void {
|
||||
$this->wp->deleteTransient(self::TRANSIENT_ACTIVATE_KEY);
|
||||
}
|
||||
|
||||
private function processActivate(): void {
|
||||
$this->migrator->run();
|
||||
$this->deactivateCronActions();
|
||||
$this->populator->up();
|
||||
$this->updateDbVersion();
|
||||
|
||||
$caps = new Capabilities();
|
||||
$caps->setupWPCapabilities();
|
||||
|
||||
$localizer = new Localizer();
|
||||
$localizer->forceInstallLanguagePacks($this->wp);
|
||||
|
||||
$this->checkForDisabledMailFunction();
|
||||
}
|
||||
|
||||
public function deactivate() {
|
||||
$this->lockActivation();
|
||||
$this->deleteAllMailPoetTablesAndData();
|
||||
|
||||
$caps = new Capabilities();
|
||||
$caps->removeWPCapabilities();
|
||||
$this->unlockActivation();
|
||||
}
|
||||
|
||||
/**
|
||||
* Deactivate action scheduler cron actions when the migration run.
|
||||
* This should prevent processing actions during migrations.
|
||||
* They are later re-activated in CronTrigger
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function deactivateCronActions(): void {
|
||||
$currentMethod = $this->settings->get(CronTrigger::SETTING_NAME . '.method');
|
||||
if ($currentMethod !== CronTrigger::METHOD_ACTION_SCHEDULER) {
|
||||
return;
|
||||
}
|
||||
$this->cronActionSchedulerRunner->unscheduleAllCronActions();
|
||||
}
|
||||
|
||||
public function updateDbVersion() {
|
||||
try {
|
||||
$currentDbVersion = $this->settings->get('db_version');
|
||||
} catch (\Exception $e) {
|
||||
$currentDbVersion = null;
|
||||
}
|
||||
|
||||
$this->settings->set('db_version', Env::$version);
|
||||
|
||||
// if current db version and plugin version differ, log an update
|
||||
if (version_compare((string)$currentDbVersion, Env::$version) !== 0) {
|
||||
$updatesLog = (array)$this->settings->get('updates_log', []);
|
||||
$updatesLog[] = [
|
||||
'previous_version' => $currentDbVersion,
|
||||
'new_version' => Env::$version,
|
||||
'date' => date('Y-m-d H:i:s'),
|
||||
];
|
||||
$this->settings->set('updates_log', $updatesLog);
|
||||
}
|
||||
}
|
||||
|
||||
private function checkForDisabledMailFunction() {
|
||||
$version = $this->settings->get('version');
|
||||
|
||||
if (!is_null($version)) return; // not a new user
|
||||
|
||||
// check for valid mail function on new installs
|
||||
$this->settings->set(DisabledMailFunctionNotice::QUEUE_DISABLED_MAIL_FUNCTION_CHECK, true);
|
||||
}
|
||||
|
||||
private function deleteAllMailPoetTablesAndData(): void {
|
||||
$prefix = Env::$dbPrefix;
|
||||
if (!$prefix) {
|
||||
throw InvalidStateException::create()->withMessage('No database table prefix was set.');
|
||||
}
|
||||
|
||||
// list all MailPoet tables by prefix
|
||||
$prefixSql = $this->wp->escSql($prefix);
|
||||
$tables = $this->connection->executeQuery("SHOW TABLES LIKE '$prefixSql%'")->fetchFirstColumn();
|
||||
|
||||
// drop all MailPoet tables in a single query
|
||||
$tablesSql = implode(
|
||||
',',
|
||||
array_map(function ($table): string {
|
||||
/** @var string $table */
|
||||
return $this->wp->escSql(strval($table));
|
||||
}, $tables)
|
||||
);
|
||||
|
||||
$this->connection->executeStatement('SET foreign_key_checks = 0');
|
||||
$this->connection->executeStatement("DROP TABLE IF EXISTS $tablesSql");
|
||||
$this->connection->executeStatement('SET foreign_key_checks = 1');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
|
||||
|
||||
namespace MailPoet\Config;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
use MailPoet\WP\Functions as WPFunctions;
|
||||
|
||||
class AssetsLoader {
|
||||
|
||||
/** @var Renderer */
|
||||
private $renderer;
|
||||
|
||||
/** @var WPFunctions */
|
||||
private $wp;
|
||||
|
||||
public function __construct(
|
||||
RendererFactory $rendererFactory,
|
||||
WPFunctions $wp
|
||||
) {
|
||||
$this->renderer = $rendererFactory->getRenderer();
|
||||
$this->wp = $wp;
|
||||
}
|
||||
|
||||
public function loadStyles(): void {
|
||||
// MailPoet plugin style should be loaded on all mailpoet sites
|
||||
$page = isset($_GET['page']) ? sanitize_text_field(wp_unslash($_GET['page'])) : null;
|
||||
if ($page && strpos($page, 'mailpoet-') === 0) {
|
||||
$this->enqueueStyle('mailpoet-plugin', [
|
||||
'forms', // To prevent conflict in CSS with WP forms we need to add dependency
|
||||
'buttons',
|
||||
]);
|
||||
}
|
||||
if ($page === 'mailpoet-form-editor') {
|
||||
// Form-editor CSS has to be loaded after plugin style because it contains @wordpress/components dependency
|
||||
$this->enqueueStyle('mailpoet-form-editor', ['mailpoet-plugin']);
|
||||
$this->enqueueStyle('mailpoet-public');
|
||||
}
|
||||
// We reuse a part of CSS in the newsletter editor
|
||||
if ($page === 'mailpoet-newsletter-editor') {
|
||||
// Newsletter-editor CSS has to be loaded after plugin style because it contains @wordpress/components dependency
|
||||
$this->enqueueStyle('mailpoet-form-editor', ['mailpoet-plugin']);
|
||||
}
|
||||
}
|
||||
|
||||
private function enqueueStyle(string $name, array $deps = []): void {
|
||||
$this->wp->wpEnqueueStyle(
|
||||
$name,
|
||||
Env::$assetsUrl . '/dist/css/' . $this->renderer->getCssAsset("{$name}.css"),
|
||||
$deps
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
|
||||
|
||||
namespace MailPoet\Config;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
use MailPoet\WP\Functions as WPFunctions;
|
||||
use WP_Role;
|
||||
|
||||
class Capabilities {
|
||||
const MEMBERS_CAP_GROUP_NAME = 'mailpoet';
|
||||
|
||||
private $renderer = null;
|
||||
/** @var WPFunctions */
|
||||
private $wp;
|
||||
/** @var AccessControl */
|
||||
private $accessControl;
|
||||
|
||||
public function __construct(
|
||||
$renderer = null,
|
||||
WPFunctions $wp = null
|
||||
) {
|
||||
if ($renderer !== null) {
|
||||
$this->renderer = $renderer;
|
||||
}
|
||||
if ($wp == null) {
|
||||
$wp = new WPFunctions;
|
||||
}
|
||||
$this->wp = $wp;
|
||||
$this->accessControl = new AccessControl;
|
||||
}
|
||||
|
||||
public function init() {
|
||||
$this->setupMembersCapabilities();
|
||||
}
|
||||
|
||||
public function setupWPCapabilities() {
|
||||
$permissions = $this->accessControl->getDefaultPermissions();
|
||||
$roleObjects = [];
|
||||
foreach ($permissions as $name => $roles) {
|
||||
foreach ($roles as $role) {
|
||||
if (!isset($roleObjects[$role])) {
|
||||
$roleObjects[$role] = WPFunctions::get()->getRole($role);
|
||||
}
|
||||
if (!$roleObjects[$role] instanceof WP_Role) continue;
|
||||
$roleObjects[$role]->add_cap($name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function removeWPCapabilities() {
|
||||
$permissions = $this->accessControl->getDefaultPermissions();
|
||||
$roleObjects = [];
|
||||
foreach ($permissions as $name => $roles) {
|
||||
foreach ($roles as $role) {
|
||||
if (!isset($roleObjects[$role])) {
|
||||
$roleObjects[$role] = WPFunctions::get()->getRole($role);
|
||||
}
|
||||
if (!$roleObjects[$role] instanceof WP_Role) continue;
|
||||
$roleObjects[$role]->remove_cap($name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function setupMembersCapabilities() {
|
||||
$this->wp->addAction('admin_enqueue_scripts', [$this, 'enqueueMembersStyles']);
|
||||
$this->wp->addAction('members_register_cap_groups', [$this, 'registerMembersCapGroup']);
|
||||
$this->wp->addAction('members_register_caps', [$this, 'registerMembersCapabilities']);
|
||||
}
|
||||
|
||||
public function enqueueMembersStyles() {
|
||||
WPFunctions::get()->wpEnqueueStyle(
|
||||
'mailpoet-admin-global',
|
||||
Env::$assetsUrl . '/dist/css/' . $this->renderer->getCssAsset('mailpoet-admin.css')
|
||||
);
|
||||
}
|
||||
|
||||
public function registerMembersCapGroup() {
|
||||
members_register_cap_group(
|
||||
self::MEMBERS_CAP_GROUP_NAME,
|
||||
[
|
||||
'label' => __('MailPoet', 'mailpoet'),
|
||||
'caps' => [],
|
||||
'icon' => 'mailpoet-icon-logo',
|
||||
'priority' => 30,
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
public function registerMembersCapabilities() {
|
||||
$permissions = $this->accessControl->getPermissionLabels();
|
||||
foreach ($permissions as $name => $label) {
|
||||
$this->registerMembersCapability($name, $label);
|
||||
}
|
||||
}
|
||||
|
||||
public function registerMembersCapability($name, $label) {
|
||||
members_register_cap(
|
||||
$name,
|
||||
[
|
||||
'label' => $label,
|
||||
'group' => self::MEMBERS_CAP_GROUP_NAME,
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,177 @@
|
||||
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
|
||||
|
||||
namespace MailPoet\Config;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
use MailPoet\Settings\SettingsController;
|
||||
use MailPoet\Settings\TrackingConfig;
|
||||
use MailPoet\Util\Url;
|
||||
use MailPoet\WooCommerce\Helper;
|
||||
use MailPoet\WP\Functions as WPFunctions;
|
||||
|
||||
class Changelog {
|
||||
/** @var WPFunctions */
|
||||
private $wp;
|
||||
|
||||
/** @var SettingsController */
|
||||
private $settings;
|
||||
|
||||
/** @var Helper */
|
||||
private $wooCommerceHelper;
|
||||
|
||||
/** @var Url */
|
||||
private $urlHelper;
|
||||
|
||||
/** @var TrackingConfig */
|
||||
private $trackingConfig;
|
||||
|
||||
public function __construct(
|
||||
SettingsController $settings,
|
||||
WPFunctions $wp,
|
||||
Helper $wooCommerceHelper,
|
||||
Url $urlHelper,
|
||||
TrackingConfig $trackingConfig
|
||||
) {
|
||||
$this->wooCommerceHelper = $wooCommerceHelper;
|
||||
$this->settings = $settings;
|
||||
$this->wp = $wp;
|
||||
$this->urlHelper = $urlHelper;
|
||||
$this->trackingConfig = $trackingConfig;
|
||||
}
|
||||
|
||||
public function init() {
|
||||
$doingAjax = (bool)(defined('DOING_AJAX') && DOING_AJAX);
|
||||
|
||||
// don't run any check when it's an ajax request
|
||||
if ($doingAjax) {
|
||||
return;
|
||||
}
|
||||
|
||||
// don't run any check when we're not on our pages
|
||||
if (
|
||||
!(isset($_GET['page']))
|
||||
or
|
||||
(isset($_GET['page']) && strpos(
|
||||
sanitize_text_field(wp_unslash($_GET['page'])),
|
||||
'mailpoet'
|
||||
) !== 0)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
WPFunctions::get()->addAction(
|
||||
'admin_init',
|
||||
[$this, 'check']
|
||||
);
|
||||
}
|
||||
|
||||
public function check() {
|
||||
$version = $this->settings->get('version');
|
||||
if ($version === null) {
|
||||
$this->setupNewInstallation();
|
||||
$this->maybeRedirectToLandingPage();
|
||||
}
|
||||
$this->checkWooCommerceListImportPage();
|
||||
$this->checkRevenueTrackingPermissionPage();
|
||||
}
|
||||
|
||||
public function shouldShowWelcomeWizard() {
|
||||
if ($this->wp->applyFilters('mailpoet_skip_welcome_wizard', false)) {
|
||||
return false;
|
||||
}
|
||||
return $this->settings->get('version') === null;
|
||||
}
|
||||
|
||||
public function shouldShowLandingPage(): bool {
|
||||
return $this->shouldShowWelcomeWizard();
|
||||
}
|
||||
|
||||
public function shouldShowWooCommerceListImportPage() {
|
||||
if ($this->wp->applyFilters('mailpoet_skip_woocommerce_import_page', false)) {
|
||||
return false;
|
||||
}
|
||||
return !$this->settings->get('woocommerce_import_screen_displayed')
|
||||
&& $this->wooCommerceHelper->isWooCommerceActive()
|
||||
&& $this->wooCommerceHelper->getOrdersCountCreatedBefore($this->settings->get('installed_at')) > 0
|
||||
&& $this->wp->currentUserCan('administrator');
|
||||
}
|
||||
|
||||
public function shouldShowRevenueTrackingPermissionPage() {
|
||||
return ($this->settings->get('woocommerce.accept_cookie_revenue_tracking.set') === null)
|
||||
&& $this->trackingConfig->isEmailTrackingEnabled()
|
||||
&& $this->wooCommerceHelper->isWooCommerceActive()
|
||||
&& $this->wp->currentUserCan('administrator');
|
||||
}
|
||||
|
||||
public function redirectToLandingPage() {
|
||||
if (isset($_GET['activate-multi'])) return; // do not redirect when activated with bulk activation mode
|
||||
|
||||
if ($this->shouldShowLandingPage() && !$this->isLandingPage()) {
|
||||
$this->urlHelper->redirectTo(
|
||||
$this->wp->adminUrl('admin.php?page=mailpoet-landingpage')
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public function maybeRedirectToLandingPage() {
|
||||
if ($this->isWelcomeWizardPage()) return; // do not redirect when on welcome wizard page
|
||||
|
||||
if ($this->isExperimentalPage()) return; // do not redirect when on experimental page
|
||||
|
||||
$this->redirectToLandingPage();
|
||||
}
|
||||
|
||||
private function setupNewInstallation() {
|
||||
$this->settings->set('show_congratulate_after_first_newsletter', true);
|
||||
}
|
||||
|
||||
private function isWelcomeWizardPage() {
|
||||
return isset($_GET['page']) && sanitize_text_field(wp_unslash($_GET['page'])) === Menu::WELCOME_WIZARD_PAGE_SLUG;
|
||||
}
|
||||
|
||||
private function isLandingPage() {
|
||||
return isset($_GET['page']) && sanitize_text_field(wp_unslash($_GET['page'])) === Menu::LANDINGPAGE_PAGE_SLUG;
|
||||
}
|
||||
|
||||
private function isExperimentalPage() {
|
||||
return isset($_GET['page']) && sanitize_text_field(wp_unslash($_GET['page'])) === Menu::EXPERIMENTS_PAGE_SLUG;
|
||||
}
|
||||
|
||||
private function checkWooCommerceListImportPage() {
|
||||
if (
|
||||
!isset($_GET['page']) ||
|
||||
!in_array(
|
||||
sanitize_text_field(wp_unslash($_GET['page'])),
|
||||
[
|
||||
'mailpoet-woocommerce-setup',
|
||||
'mailpoet-welcome-wizard',
|
||||
'mailpoet-migration',
|
||||
'mailpoet-landingpage',
|
||||
]
|
||||
)
|
||||
&& $this->shouldShowWooCommerceListImportPage()
|
||||
) {
|
||||
$this->urlHelper->redirectTo($this->wp->adminUrl('admin.php?page=mailpoet-woocommerce-setup'));
|
||||
}
|
||||
}
|
||||
|
||||
private function checkRevenueTrackingPermissionPage() {
|
||||
if (
|
||||
!isset($_GET['page']) ||
|
||||
!in_array(
|
||||
sanitize_text_field(wp_unslash($_GET['page'])),
|
||||
[
|
||||
'mailpoet-woocommerce-setup',
|
||||
'mailpoet-welcome-wizard',
|
||||
'mailpoet-migration',
|
||||
'mailpoet-landingpage',
|
||||
]
|
||||
)
|
||||
&& $this->shouldShowRevenueTrackingPermissionPage()
|
||||
) {
|
||||
$this->urlHelper->redirectTo($this->wp->adminUrl('admin.php?page=mailpoet-woocommerce-setup'));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace MailPoet\Config;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
use MailPoet\WP\Functions as WPFunctions;
|
||||
|
||||
class DeactivationPoll {
|
||||
|
||||
/** @var WPFunctions */
|
||||
private $wp;
|
||||
|
||||
/** @var Renderer */
|
||||
private $renderer;
|
||||
|
||||
public function __construct(
|
||||
WPFunctions $wp,
|
||||
Renderer $renderer
|
||||
) {
|
||||
$this->wp = $wp;
|
||||
$this->renderer = $renderer;
|
||||
}
|
||||
|
||||
public function init() {
|
||||
$this->wp->addAction('admin_print_scripts', [$this, 'css']);
|
||||
$this->wp->addAction('admin_footer', [$this, 'modal']);
|
||||
}
|
||||
|
||||
private function shouldShow(): bool {
|
||||
if (!function_exists('get_current_screen')) {
|
||||
return false;
|
||||
}
|
||||
$screen = $this->wp->getCurrentScreen();
|
||||
if (is_null($screen)) {
|
||||
return false;
|
||||
}
|
||||
return in_array($screen->id, ['plugins', 'plugins-network'], true);
|
||||
}
|
||||
|
||||
public function css(): void {
|
||||
if (!$this->shouldShow()) {
|
||||
return;
|
||||
}
|
||||
$this->render('deactivationPoll/css.html');
|
||||
}
|
||||
|
||||
public function modal(): void {
|
||||
if (!$this->shouldShow()) {
|
||||
return;
|
||||
}
|
||||
$this->render('deactivationPoll/index.html');
|
||||
}
|
||||
|
||||
private function render($template): void {
|
||||
try {
|
||||
// phpcs:disable -- because we use echo here, WordPress sniffs reported a warning
|
||||
echo $this->renderer->render($template);
|
||||
// phpcs:enable
|
||||
} catch (\Exception $e) {
|
||||
// if the website fails to render we have other places to catch and display the error
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
|
||||
|
||||
namespace MailPoet\Config;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
use MailPoet\WP\Functions as WPFunctions;
|
||||
use MailPoet\WP\Notice;
|
||||
|
||||
class DeferredAdminNotices {
|
||||
|
||||
const OPTIONS_KEY_NAME = 'mailpoet_deferred_admin_notices';
|
||||
|
||||
/**
|
||||
* @param string $message
|
||||
*/
|
||||
public function addNetworkAdminNotice($message) {
|
||||
$notices = WPFunctions::get()->getOption(DeferredAdminNotices::OPTIONS_KEY_NAME, []);
|
||||
$notices[] = [
|
||||
"message" => $message,
|
||||
"networkAdmin" => true,// if we'll need to display the notice to anyone else
|
||||
];
|
||||
WPFunctions::get()->updateOption(DeferredAdminNotices::OPTIONS_KEY_NAME, $notices);
|
||||
}
|
||||
|
||||
public function printAndClean() {
|
||||
$notices = WPFunctions::get()->getOption(DeferredAdminNotices::OPTIONS_KEY_NAME, []);
|
||||
|
||||
foreach ($notices as $notice) {
|
||||
$notice = new Notice(Notice::TYPE_WARNING, $notice["message"]);
|
||||
WPFunctions::get()->addAction('network_admin_notices', [$notice, 'displayWPNotice']);
|
||||
}
|
||||
|
||||
if (!empty($notices)) {
|
||||
WPFunctions::get()->deleteOption(DeferredAdminNotices::OPTIONS_KEY_NAME);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
|
||||
|
||||
namespace MailPoet\Config;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
use MailPoet\WP\Functions as WPFunctions;
|
||||
|
||||
class Env {
|
||||
const NEWSLETTER_CONTENT_WIDTH = 1320;
|
||||
|
||||
public static $version;
|
||||
public static $pluginName;
|
||||
public static $pluginPath;
|
||||
public static $baseUrl;
|
||||
public static $file;
|
||||
public static $path;
|
||||
public static $viewsPath;
|
||||
public static $assetsPath;
|
||||
public static $assetsUrl;
|
||||
public static $utilPath;
|
||||
public static $tempPath;
|
||||
public static $cachePath;
|
||||
public static $tempUrl;
|
||||
public static $languagesPath;
|
||||
public static $libPath;
|
||||
public static $pluginPrefix;
|
||||
/** @var string WP DB prefix + plugin prefix */
|
||||
public static $dbPrefix;
|
||||
/** @var string WP DB prefix only */
|
||||
public static $wpDbPrefix;
|
||||
public static $dbHost;
|
||||
public static $dbIsIpv6;
|
||||
public static $dbSocket;
|
||||
public static $dbPort;
|
||||
public static $dbName;
|
||||
public static $dbUsername;
|
||||
public static $dbPassword;
|
||||
public static $dbCharset;
|
||||
public static $dbCollation;
|
||||
public static $dbCharsetCollate;
|
||||
public static $dbTimezoneOffset;
|
||||
|
||||
// back compatibility for older Premium plugin with underscore naming
|
||||
// (we need to allow it to activate so it can render an update notice)
|
||||
public static $plugin_name; // phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
|
||||
public static $temp_path; // phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
|
||||
|
||||
public static function init($file, $version, $dbHost, $dbUser, $dbPassword, $dbName) {
|
||||
self::$version = $version;
|
||||
self::$file = $file;
|
||||
self::$path = dirname(self::$file);
|
||||
self::$pluginName = 'mailpoet';
|
||||
self::$pluginPath = 'mailpoet/mailpoet.php';
|
||||
self::$baseUrl = WPFunctions::get()->pluginsUrl('', $file);
|
||||
self::$viewsPath = self::$path . '/views';
|
||||
self::$assetsPath = self::$path . '/assets';
|
||||
self::$assetsUrl = WPFunctions::get()->pluginsUrl('/assets', $file);
|
||||
self::$utilPath = self::$path . '/lib/Util';
|
||||
$wpUploadDir = WPFunctions::get()->wpUploadDir();
|
||||
self::$tempPath = $wpUploadDir['basedir'] . '/' . self::$pluginName;
|
||||
self::$cachePath = self::$path . '/generated/twig/';
|
||||
self::$tempUrl = $wpUploadDir['baseurl'] . '/' . self::$pluginName;
|
||||
self::$languagesPath = self::$path . '/../../languages/plugins/';
|
||||
self::$libPath = self::$path . '/lib';
|
||||
self::$pluginPrefix = WPFunctions::get()->applyFilters('mailpoet_db_prefix', 'mailpoet_');
|
||||
self::initDbParameters($dbHost, $dbUser, $dbPassword, $dbName);
|
||||
|
||||
// back compatibility for older Premium plugin with underscore naming
|
||||
self::$plugin_name = self::$pluginName; // phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
|
||||
self::$temp_path = self::$tempPath; // phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
|
||||
}
|
||||
|
||||
/**
|
||||
* @see https://codex.wordpress.org/Editing_wp-config.php#Set_Database_Host for possible DB_HOSTS values
|
||||
*/
|
||||
private static function initDbParameters($dbHost, $dbUser, $dbPassword, $dbName) {
|
||||
$parsedHost = WPFunctions::get()->parseDbHost($dbHost);
|
||||
if ($parsedHost === false) {
|
||||
throw new \InvalidArgumentException('Invalid db host configuration.');
|
||||
}
|
||||
[$host, $port, $socket, $isIpv6] = $parsedHost;
|
||||
|
||||
global $wpdb;
|
||||
self::$dbPrefix = $wpdb->prefix . self::$pluginPrefix;
|
||||
self::$wpDbPrefix = $wpdb->prefix;
|
||||
self::$dbHost = $host;
|
||||
self::$dbIsIpv6 = $isIpv6;
|
||||
self::$dbPort = $port;
|
||||
self::$dbSocket = $socket;
|
||||
self::$dbName = $dbName;
|
||||
self::$dbUsername = $dbUser;
|
||||
self::$dbPassword = $dbPassword;
|
||||
self::$dbCharset = $wpdb->charset;
|
||||
self::$dbCollation = $wpdb->collate;
|
||||
self::$dbCharsetCollate = $wpdb->get_charset_collate();
|
||||
self::$dbTimezoneOffset = self::getDbTimezoneOffset();
|
||||
}
|
||||
|
||||
public static function getDbTimezoneOffset($offset = false) {
|
||||
$offset = ($offset) ? $offset : WPFunctions::get()->getOption('gmt_offset');
|
||||
$offset = (float)($offset);
|
||||
$mins = $offset * 60;
|
||||
$sgn = ($mins < 0 ? -1 : 1);
|
||||
$mins = abs($mins);
|
||||
$hrs = floor($mins / 60);
|
||||
$mins -= $hrs * 60;
|
||||
return sprintf('%+03d:%02d', $hrs * $sgn, $mins);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,724 @@
|
||||
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
|
||||
|
||||
namespace MailPoet\Config;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
use MailPoet\Captcha\CaptchaHooks;
|
||||
use MailPoet\Captcha\ReCaptchaHooks;
|
||||
use MailPoet\Cron\CronTrigger;
|
||||
use MailPoet\Form\DisplayFormInWPContent;
|
||||
use MailPoet\Mailer\WordPress\WordpressMailerReplacer;
|
||||
use MailPoet\Newsletter\Scheduler\PostNotificationScheduler;
|
||||
use MailPoet\Segments\WP;
|
||||
use MailPoet\Settings\SettingsController;
|
||||
use MailPoet\Statistics\Track\SubscriberHandler;
|
||||
use MailPoet\Subscription\Comment;
|
||||
use MailPoet\Subscription\Form;
|
||||
use MailPoet\Subscription\Manage;
|
||||
use MailPoet\Subscription\Registration;
|
||||
use MailPoet\WooCommerce\Helper as WooHelper;
|
||||
use MailPoet\WooCommerce\Integrations\AutomateWooHooks;
|
||||
use MailPoet\WooCommerce\Subscription;
|
||||
use MailPoet\WooCommerce\WooSystemInfoController;
|
||||
use MailPoet\WP\Functions as WPFunctions;
|
||||
use MailPoet\WPCOM\DotcomLicenseProvisioner;
|
||||
|
||||
class Hooks {
|
||||
const OPTIN_POSITION_AFTER_BILLING_INFO = 'after_billing_info';
|
||||
const OPTIN_POSITION_AFTER_ORDER_NOTES = 'after_order_notes';
|
||||
const OPTIN_POSITION_AFTER_TERMS_AND_CONDITIONS = 'after_terms_and_conditions';
|
||||
const OPTIN_POSITION_BEFORE_PAYMENT_METHODS = 'before_payment_methods';
|
||||
const OPTIN_POSITION_BEFORE_TERMS_AND_CONDITIONS = 'before_terms_and_conditions';
|
||||
const DEFAULT_OPTIN_POSITION = self::OPTIN_POSITION_AFTER_BILLING_INFO;
|
||||
const OPTIN_HOOKS = [
|
||||
self::OPTIN_POSITION_AFTER_BILLING_INFO => 'woocommerce_after_checkout_billing_form',
|
||||
self::OPTIN_POSITION_AFTER_ORDER_NOTES => 'woocommerce_after_order_notes',
|
||||
self::OPTIN_POSITION_AFTER_TERMS_AND_CONDITIONS => 'woocommerce_checkout_after_terms_and_conditions',
|
||||
self::OPTIN_POSITION_BEFORE_PAYMENT_METHODS => 'woocommerce_review_order_before_payment',
|
||||
self::OPTIN_POSITION_BEFORE_TERMS_AND_CONDITIONS => 'woocommerce_checkout_before_terms_and_conditions',
|
||||
];
|
||||
|
||||
/** @var Form */
|
||||
private $subscriptionForm;
|
||||
|
||||
/** @var Comment */
|
||||
private $subscriptionComment;
|
||||
|
||||
/** @var Manage */
|
||||
private $subscriptionManage;
|
||||
|
||||
/** @var Registration */
|
||||
private $subscriptionRegistration;
|
||||
|
||||
/** @var SettingsController */
|
||||
private $settings;
|
||||
|
||||
/** @var WPFunctions */
|
||||
private $wp;
|
||||
|
||||
/** @var PostNotificationScheduler */
|
||||
private $postNotificationScheduler;
|
||||
|
||||
/** @var WordpressMailerReplacer */
|
||||
private $wordpressMailerReplacer;
|
||||
|
||||
/** @var DisplayFormInWPContent */
|
||||
private $displayFormInWPContent;
|
||||
|
||||
/** @var WP */
|
||||
private $wpSegment;
|
||||
|
||||
/** @var SubscriberHandler */
|
||||
private $subscriberHandler;
|
||||
|
||||
/** @var HooksWooCommerce */
|
||||
private $hooksWooCommerce;
|
||||
|
||||
/** @var SubscriberChangesNotifier */
|
||||
private $subscriberChangesNotifier;
|
||||
|
||||
/** @var DotcomLicenseProvisioner */
|
||||
private $dotcomLicenseProvisioner;
|
||||
|
||||
/** @var AutomateWooHooks */
|
||||
private $automateWooHooks;
|
||||
|
||||
/** @var CaptchaHooks */
|
||||
private $captchaHooks;
|
||||
|
||||
/** @var ReCaptchaHooks */
|
||||
private $reCaptchaHooks;
|
||||
|
||||
/** @var WooSystemInfoController */
|
||||
private $wooSystemInfoController;
|
||||
|
||||
/** @var CronTrigger */
|
||||
private $cronTrigger;
|
||||
|
||||
/** @var WooHelper */
|
||||
private $wooHelper;
|
||||
|
||||
public function __construct(
|
||||
Form $subscriptionForm,
|
||||
Comment $subscriptionComment,
|
||||
Manage $subscriptionManage,
|
||||
Registration $subscriptionRegistration,
|
||||
SettingsController $settings,
|
||||
WPFunctions $wp,
|
||||
PostNotificationScheduler $postNotificationScheduler,
|
||||
WordpressMailerReplacer $wordpressMailerReplacer,
|
||||
DisplayFormInWPContent $displayFormInWPContent,
|
||||
HooksWooCommerce $hooksWooCommerce,
|
||||
CaptchaHooks $captchaHooks,
|
||||
ReCaptchaHooks $reCaptchaHooks,
|
||||
SubscriberHandler $subscriberHandler,
|
||||
SubscriberChangesNotifier $subscriberChangesNotifier,
|
||||
WP $wpSegment,
|
||||
DotcomLicenseProvisioner $dotcomLicenseProvisioner,
|
||||
AutomateWooHooks $automateWooHooks,
|
||||
WooSystemInfoController $wooSystemInfoController,
|
||||
CronTrigger $cronTrigger,
|
||||
WooHelper $wooHelper
|
||||
) {
|
||||
$this->subscriptionForm = $subscriptionForm;
|
||||
$this->subscriptionComment = $subscriptionComment;
|
||||
$this->subscriptionManage = $subscriptionManage;
|
||||
$this->subscriptionRegistration = $subscriptionRegistration;
|
||||
$this->settings = $settings;
|
||||
$this->wp = $wp;
|
||||
$this->postNotificationScheduler = $postNotificationScheduler;
|
||||
$this->wordpressMailerReplacer = $wordpressMailerReplacer;
|
||||
$this->displayFormInWPContent = $displayFormInWPContent;
|
||||
$this->wpSegment = $wpSegment;
|
||||
$this->subscriberHandler = $subscriberHandler;
|
||||
$this->hooksWooCommerce = $hooksWooCommerce;
|
||||
$this->captchaHooks = $captchaHooks;
|
||||
$this->reCaptchaHooks = $reCaptchaHooks;
|
||||
$this->subscriberChangesNotifier = $subscriberChangesNotifier;
|
||||
$this->dotcomLicenseProvisioner = $dotcomLicenseProvisioner;
|
||||
$this->automateWooHooks = $automateWooHooks;
|
||||
$this->wooSystemInfoController = $wooSystemInfoController;
|
||||
$this->cronTrigger = $cronTrigger;
|
||||
$this->wooHelper = $wooHelper;
|
||||
}
|
||||
|
||||
public function init() {
|
||||
$this->setupWPUsers();
|
||||
$this->setupWooCommerceUsers();
|
||||
$this->setupWooCommercePurchases();
|
||||
$this->setupWooCommerceSubscriberEngagement();
|
||||
$this->setupWooCommerceTracking();
|
||||
$this->setupListing();
|
||||
$this->setupSubscriptionEvents();
|
||||
$this->setupWooCommerceSubscriptionEvents();
|
||||
$this->setupAutomateWooSubscriptionEvents();
|
||||
$this->setupPostNotifications();
|
||||
$this->setupWooCommerceSettings();
|
||||
$this->setupWoocommerceSystemInfo();
|
||||
$this->setupFooter();
|
||||
$this->setupSettingsLinkInPluginPage();
|
||||
$this->setupChangeNotifications();
|
||||
$this->setupLicenseProvisioning();
|
||||
$this->setupCaptchaOnRegisterForm();
|
||||
$this->deactivateMailPoetCronBeforePluginUpgrade();
|
||||
}
|
||||
|
||||
public function initEarlyHooks() {
|
||||
$this->setupMailer();
|
||||
}
|
||||
|
||||
public function setupSubscriptionEvents() {
|
||||
// In some cases on multisite instance, this code may run before DB migrator and settings table is not ready at that time
|
||||
try {
|
||||
$subscribe = $this->settings->get('subscribe', []);
|
||||
} catch (\Exception $e) {
|
||||
$subscribe = [];
|
||||
}
|
||||
// Subscribe in comments
|
||||
if (
|
||||
isset($subscribe['on_comment']['enabled'])
|
||||
&&
|
||||
(bool)$subscribe['on_comment']['enabled']
|
||||
) {
|
||||
if ($this->wp->isUserLoggedIn()) {
|
||||
$this->wp->addAction(
|
||||
'comment_form_field_comment',
|
||||
[$this->subscriptionComment, 'extendLoggedInForm']
|
||||
);
|
||||
} else {
|
||||
$this->wp->addAction(
|
||||
'comment_form_after_fields',
|
||||
[$this->subscriptionComment, 'extendLoggedOutForm']
|
||||
);
|
||||
}
|
||||
|
||||
$this->wp->addAction(
|
||||
'comment_post',
|
||||
[$this->subscriptionComment, 'onSubmit'],
|
||||
60,
|
||||
2
|
||||
);
|
||||
|
||||
$this->wp->addAction(
|
||||
'wp_set_comment_status',
|
||||
[$this->subscriptionComment, 'onStatusUpdate'],
|
||||
60,
|
||||
2
|
||||
);
|
||||
}
|
||||
|
||||
// Subscribe in registration form
|
||||
if (
|
||||
isset($subscribe['on_register']['enabled'])
|
||||
&&
|
||||
(bool)$subscribe['on_register']['enabled']
|
||||
) {
|
||||
if (is_multisite()) {
|
||||
$this->wp->addAction(
|
||||
'signup_extra_fields',
|
||||
[$this->subscriptionRegistration, 'extendForm']
|
||||
);
|
||||
$this->wp->addAction(
|
||||
'wpmu_validate_user_signup',
|
||||
[$this->subscriptionRegistration, 'onMultiSiteRegister'],
|
||||
60,
|
||||
1
|
||||
);
|
||||
} else {
|
||||
$this->wp->addAction(
|
||||
'register_form',
|
||||
[$this->subscriptionRegistration, 'extendForm']
|
||||
);
|
||||
// we need to process new users while they are registered.
|
||||
// We used `register_post` before but that is too soon
|
||||
// because if registration fails during `registration_errors` we will keep the user as subscriber.
|
||||
// So we are hooking to `registration_error` with a low priority.
|
||||
$this->wp->addFilter(
|
||||
'registration_errors',
|
||||
[$this->subscriptionRegistration, 'onRegister'],
|
||||
60,
|
||||
3
|
||||
);
|
||||
}
|
||||
$this->wp->addAction(
|
||||
'woocommerce_register_form',
|
||||
[$this->hooksWooCommerce, 'extendForm']
|
||||
);
|
||||
$this->wp->addFilter(
|
||||
'woocommerce_registration_errors',
|
||||
[$this->hooksWooCommerce, 'onRegister'],
|
||||
60,
|
||||
3
|
||||
);
|
||||
}
|
||||
|
||||
// Manage subscription
|
||||
$this->wp->addAction(
|
||||
'admin_post_mailpoet_subscription_update',
|
||||
[$this->subscriptionManage, 'onSave']
|
||||
);
|
||||
$this->wp->addAction(
|
||||
'admin_post_nopriv_mailpoet_subscription_update',
|
||||
[$this->subscriptionManage, 'onSave']
|
||||
);
|
||||
|
||||
// Subscription form
|
||||
$this->wp->addAction(
|
||||
'admin_post_mailpoet_subscription_form',
|
||||
[$this->subscriptionForm, 'onSubmit']
|
||||
);
|
||||
$this->wp->addAction(
|
||||
'admin_post_nopriv_mailpoet_subscription_form',
|
||||
[$this->subscriptionForm, 'onSubmit']
|
||||
);
|
||||
$this->wp->addFilter(
|
||||
'the_content',
|
||||
[$this->displayFormInWPContent, 'contentDisplay']
|
||||
);
|
||||
$this->wp->addFilter(
|
||||
'woocommerce_product_loop_end',
|
||||
[$this->displayFormInWPContent, 'wooProductListDisplay']
|
||||
);
|
||||
$this->wp->addAction(
|
||||
'wp_footer',
|
||||
[$this->displayFormInWPContent, 'maybeRenderFormsInFooter']
|
||||
);
|
||||
}
|
||||
|
||||
public function setupMailer() {
|
||||
$this->wp->addAction('plugins_loaded', [
|
||||
$this->wordpressMailerReplacer,
|
||||
'replaceWordPressMailer',
|
||||
]);
|
||||
$this->wp->addAction('login_init', [
|
||||
$this->wordpressMailerReplacer,
|
||||
'replaceWordPressMailer',
|
||||
]);
|
||||
$this->wp->addAction('lostpassword_post', [
|
||||
$this->wordpressMailerReplacer,
|
||||
'replaceWordPressMailer',
|
||||
]);
|
||||
}
|
||||
|
||||
public function setupWooCommerceSubscriptionEvents() {
|
||||
// In some cases on multisite instance, this code may run before DB migrator and settings table is not ready at that time
|
||||
try {
|
||||
$optInEnabled = (bool)$this->settings->get(Subscription::OPTIN_ENABLED_SETTING_NAME, false);
|
||||
} catch (\Exception $e) {
|
||||
$optInEnabled = false;
|
||||
}
|
||||
// WooCommerce: subscribe on checkout
|
||||
if ($optInEnabled) {
|
||||
$optInPosition = $this->settings->get(Subscription::OPTIN_POSITION_SETTING_NAME, self::DEFAULT_OPTIN_POSITION);
|
||||
$optInHook = self::OPTIN_HOOKS[$optInPosition] ?? self::OPTIN_HOOKS[self::DEFAULT_OPTIN_POSITION];
|
||||
$this->wp->addAction(
|
||||
$optInHook,
|
||||
[$this->hooksWooCommerce, 'extendWooCommerceCheckoutForm']
|
||||
);
|
||||
|
||||
$this->wp->addAction(
|
||||
'woocommerce_checkout_after_terms_and_conditions',
|
||||
[$this->hooksWooCommerce, 'hideAutomateWooOptinCheckbox'],
|
||||
5,
|
||||
0
|
||||
);
|
||||
}
|
||||
|
||||
$this->wp->addAction(
|
||||
'woocommerce_checkout_update_order_meta',
|
||||
[$this->hooksWooCommerce, 'subscribeOnCheckout'],
|
||||
10, // this should execute after the WC sync call on the same hook
|
||||
2
|
||||
);
|
||||
|
||||
$this->wp->addAction(
|
||||
'woocommerce_before_pay_action',
|
||||
[$this->hooksWooCommerce, 'subscribeOnOrderPay'],
|
||||
10,
|
||||
1
|
||||
);
|
||||
}
|
||||
|
||||
public function setupAutomateWooSubscriptionEvents() {
|
||||
$this->automateWooHooks->setup();
|
||||
}
|
||||
|
||||
public function setupWPUsers() {
|
||||
// WP Users synchronization
|
||||
$this->wp->addAction(
|
||||
'user_register',
|
||||
[$this->wpSegment, 'synchronizeUser'],
|
||||
6
|
||||
);
|
||||
$this->wp->addAction(
|
||||
'added_existing_user',
|
||||
[$this->wpSegment, 'synchronizeUser'],
|
||||
6
|
||||
);
|
||||
$this->wp->addAction(
|
||||
'profile_update',
|
||||
[$this->wpSegment, 'synchronizeUser'],
|
||||
6,
|
||||
2
|
||||
);
|
||||
$this->wp->addAction(
|
||||
'add_user_role',
|
||||
[$this->wpSegment, 'synchronizeUser'],
|
||||
6,
|
||||
1
|
||||
);
|
||||
$this->wp->addAction(
|
||||
'set_user_role',
|
||||
[$this->wpSegment, 'synchronizeUser'],
|
||||
6,
|
||||
1
|
||||
);
|
||||
$this->wp->addAction(
|
||||
'delete_user',
|
||||
[$this->wpSegment, 'synchronizeUser'],
|
||||
1
|
||||
);
|
||||
// multisite
|
||||
$this->wp->addAction(
|
||||
'deleted_user',
|
||||
[$this->wpSegment, 'synchronizeUser'],
|
||||
1
|
||||
);
|
||||
$this->wp->addAction(
|
||||
'remove_user_from_blog',
|
||||
[$this->wpSegment, 'synchronizeUser'],
|
||||
1
|
||||
);
|
||||
|
||||
// login
|
||||
$this->wp->addAction(
|
||||
'wp_login',
|
||||
[$this->subscriberHandler, 'identifyByLogin'],
|
||||
10,
|
||||
1
|
||||
);
|
||||
}
|
||||
|
||||
public function setupWooCommerceSettings() {
|
||||
$this->wp->addAction('woocommerce_settings_start', [
|
||||
$this->hooksWooCommerce,
|
||||
'disableWooCommerceSettings',
|
||||
]);
|
||||
|
||||
$this->wp->addAction('before_woocommerce_init', [
|
||||
$this->hooksWooCommerce,
|
||||
'declareWooCompatibility',
|
||||
]);
|
||||
|
||||
$this->wp->addAction('init', [
|
||||
$this->hooksWooCommerce,
|
||||
'addMailPoetTaskToWooHomePage',
|
||||
]);
|
||||
|
||||
$this->wp->addFilter(
|
||||
'woocommerce_marketing_channels',
|
||||
[$this->hooksWooCommerce, 'addMailPoetMarketingMultiChannel'],
|
||||
10,
|
||||
1
|
||||
);
|
||||
}
|
||||
|
||||
public function setupWoocommerceSystemInfo() {
|
||||
$this->wp->addAction(
|
||||
'woocommerce_system_status_report',
|
||||
[
|
||||
$this->wooSystemInfoController,
|
||||
'render',
|
||||
]
|
||||
);
|
||||
$this->wp->addAction(
|
||||
'woocommerce_rest_prepare_system_status',
|
||||
[
|
||||
$this->wooSystemInfoController,
|
||||
'addFields',
|
||||
]
|
||||
);
|
||||
$this->wp->addAction(
|
||||
'woocommerce_rest_system_status_schema',
|
||||
[
|
||||
$this->wooSystemInfoController,
|
||||
'addSchema',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
public function setupWooCommerceUsers() {
|
||||
// WooCommerce Customers synchronization
|
||||
$this->wp->addAction(
|
||||
'woocommerce_created_customer',
|
||||
[$this->hooksWooCommerce, 'synchronizeRegisteredCustomer'],
|
||||
7
|
||||
);
|
||||
$this->wp->addAction(
|
||||
'woocommerce_new_customer',
|
||||
[$this->hooksWooCommerce, 'synchronizeRegisteredCustomer'],
|
||||
7
|
||||
);
|
||||
$this->wp->addAction(
|
||||
'woocommerce_update_customer',
|
||||
[$this->hooksWooCommerce, 'synchronizeRegisteredCustomer'],
|
||||
7
|
||||
);
|
||||
$this->wp->addAction(
|
||||
'woocommerce_delete_customer',
|
||||
[$this->hooksWooCommerce, 'synchronizeRegisteredCustomer'],
|
||||
7
|
||||
);
|
||||
$this->wp->addAction(
|
||||
'woocommerce_checkout_update_order_meta',
|
||||
[$this->hooksWooCommerce, 'synchronizeGuestCustomer'],
|
||||
7
|
||||
);
|
||||
$this->wp->addAction(
|
||||
'woocommerce_process_shop_order_meta',
|
||||
[$this->hooksWooCommerce, 'synchronizeGuestCustomer'],
|
||||
7
|
||||
);
|
||||
}
|
||||
|
||||
public function setupWooCommercePurchases() {
|
||||
$this->wp->addAction(
|
||||
'woocommerce_order_status_changed',
|
||||
[$this->hooksWooCommerce, 'trackPurchase'],
|
||||
10,
|
||||
1
|
||||
);
|
||||
|
||||
$this->wp->addAction(
|
||||
'woocommerce_order_refunded',
|
||||
[$this->hooksWooCommerce, 'trackRefund'],
|
||||
10,
|
||||
1
|
||||
);
|
||||
}
|
||||
|
||||
public function setupWooCommerceSubscriberEngagement() {
|
||||
$this->wp->addAction(
|
||||
'woocommerce_new_order',
|
||||
[$this->hooksWooCommerce, 'updateSubscriberEngagement'],
|
||||
7
|
||||
);
|
||||
// See class-wc-order.php, which says this about this action
|
||||
// "Fires when the order progresses from a pending payment status to a paid one"
|
||||
$this->wp->addAction(
|
||||
'woocommerce_order_payment_status_changed',
|
||||
[$this->hooksWooCommerce, 'updateSubscriberLastPurchase']
|
||||
);
|
||||
}
|
||||
|
||||
public function setupWooCommerceTracking() {
|
||||
$this->wp->addFilter(
|
||||
'woocommerce_tracker_data',
|
||||
[$this->hooksWooCommerce, 'addTrackingData'],
|
||||
10
|
||||
);
|
||||
}
|
||||
|
||||
public function setupListing() {
|
||||
$this->wp->addFilter(
|
||||
'set-screen-option',
|
||||
[$this, 'setScreenOption'],
|
||||
10,
|
||||
3
|
||||
);
|
||||
}
|
||||
|
||||
public function setScreenOption($status, $option, $value) {
|
||||
if (preg_match('/^mailpoet_(.*)_per_page$/', $option)) {
|
||||
return $value;
|
||||
} else {
|
||||
return $status;
|
||||
}
|
||||
}
|
||||
|
||||
public function setupPostNotifications() {
|
||||
$this->wp->addAction(
|
||||
'transition_post_status',
|
||||
[$this->postNotificationScheduler, 'transitionHook'],
|
||||
10,
|
||||
3
|
||||
);
|
||||
}
|
||||
|
||||
public function setupFooter() {
|
||||
if (!Menu::isOnMailPoetAdminPage()) {
|
||||
return;
|
||||
}
|
||||
$this->wp->addFilter(
|
||||
'admin_footer_text',
|
||||
[$this, 'setFooter'],
|
||||
1,
|
||||
1
|
||||
);
|
||||
}
|
||||
|
||||
public function setFooter(): string {
|
||||
if (Menu::isOnMailPoetAutomationPage()) {
|
||||
return '';
|
||||
}
|
||||
return '<a href="https://feedback.mailpoet.com/" rel="noopener noreferrer" target="_blank">' . esc_html__('Give feedback', 'mailpoet') . '</a>';
|
||||
}
|
||||
|
||||
public function setupSettingsLinkInPluginPage() {
|
||||
$this->wp->addFilter(
|
||||
'plugin_action_links_' . Env::$pluginPath,
|
||||
[$this, 'setSettingsLinkInPluginPage']
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, string> $actionLinks
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function setSettingsLinkInPluginPage(array $actionLinks): array {
|
||||
$customLinks = [
|
||||
'settings' => '<a href="' . $this->wp->adminUrl('admin.php?page=mailpoet-settings') . '" aria-label="' . $this->wp->escAttr(__('View MailPoet settings', 'mailpoet')) . '">' . $this->wp->escHtml(__('Settings', 'mailpoet')) . '</a>',
|
||||
];
|
||||
|
||||
return array_merge($customLinks, $actionLinks);
|
||||
}
|
||||
|
||||
public function setupChangeNotifications(): void {
|
||||
$this->wp->addAction(
|
||||
'shutdown',
|
||||
[$this->subscriberChangesNotifier, 'notify']
|
||||
);
|
||||
}
|
||||
|
||||
public function setupLicenseProvisioning(): void {
|
||||
$this->wp->addFilter(
|
||||
'wpcom_marketplace_webhook_response_mailpoet-business',
|
||||
[$this->dotcomLicenseProvisioner, 'provisionLicense'],
|
||||
10,
|
||||
3
|
||||
);
|
||||
}
|
||||
|
||||
// CAPTCHA on WP & WC registration forms
|
||||
public function setupCaptchaOnRegisterForm(): void {
|
||||
if ($this->captchaHooks->isEnabled()) {
|
||||
$this->wp->addAction(
|
||||
'register_form',
|
||||
[$this->captchaHooks, 'renderInWPRegisterForm']
|
||||
);
|
||||
|
||||
$this->wp->addAction(
|
||||
'registration_errors',
|
||||
[$this->captchaHooks, 'validate'],
|
||||
10,
|
||||
3
|
||||
);
|
||||
|
||||
if ($this->wooHelper->isWooCommerceActive()) {
|
||||
$this->wp->addAction(
|
||||
'woocommerce_register_form',
|
||||
[$this->captchaHooks, 'renderInWCRegisterForm']
|
||||
);
|
||||
|
||||
$this->wp->addFilter(
|
||||
'woocommerce_process_registration_errors',
|
||||
[$this->captchaHooks, 'validate'],
|
||||
10,
|
||||
3
|
||||
);
|
||||
}
|
||||
} else if ($this->reCaptchaHooks->isEnabled()) {
|
||||
$this->wp->addAction(
|
||||
'login_enqueue_scripts',
|
||||
[$this->reCaptchaHooks, 'enqueueScripts']
|
||||
);
|
||||
|
||||
$this->wp->addAction(
|
||||
'register_form',
|
||||
[$this->reCaptchaHooks, 'render']
|
||||
);
|
||||
|
||||
$this->wp->addFilter(
|
||||
'registration_errors',
|
||||
[$this->reCaptchaHooks, 'validate'],
|
||||
10,
|
||||
3
|
||||
);
|
||||
|
||||
if ($this->wooHelper->isWooCommerceActive()) {
|
||||
$this->wp->addAction(
|
||||
'woocommerce_before_customer_login_form',
|
||||
[$this->reCaptchaHooks, 'enqueueScripts']
|
||||
);
|
||||
|
||||
$this->wp->addAction(
|
||||
'woocommerce_register_form',
|
||||
[$this->reCaptchaHooks, 'render']
|
||||
);
|
||||
|
||||
$this->wp->addAction(
|
||||
'woocommerce_process_registration_errors',
|
||||
[$this->reCaptchaHooks, 'validate']
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function deactivateMailPoetCronBeforePluginUpgrade(): void {
|
||||
$this->wp->addFilter(
|
||||
'upgrader_pre_install',
|
||||
[$this, 'deactivateCronActions'],
|
||||
10,
|
||||
2
|
||||
);
|
||||
|
||||
$this->wp->addAction(
|
||||
'action_scheduler_before_process_queue',
|
||||
[$this, 'deactivateCronWhenInMaintenanceMode']
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deactivates the MailPoet Cron actions.
|
||||
*
|
||||
* Hooked to the 'upgrader_pre_install' filter
|
||||
*
|
||||
* The cron will be reactivated automatically later in Initializer::initialize -> setupCronTrigger()
|
||||
*
|
||||
* @param bool|\WP_Error $response The installation response before the installation has started.
|
||||
* @param array $plugin Plugin package arguments.
|
||||
* @return bool|\WP_Error The original `$response` parameter or WP_Error.
|
||||
*/
|
||||
public function deactivateCronActions($response, array $plugin) {
|
||||
if (is_wp_error($response)) { // skip
|
||||
return $response;
|
||||
}
|
||||
|
||||
$pluginId = $plugin['plugin'] ?? '';
|
||||
|
||||
if ($pluginId !== Env::$pluginPath) {
|
||||
// not updating MailPoet;
|
||||
return $response;
|
||||
}
|
||||
|
||||
$this->cronTrigger->disable();
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
public function deactivateCronWhenInMaintenanceMode(): void {
|
||||
if (!$this->wp->wpIsMaintenanceMode()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->wp->addFilter('action_scheduler_queue_runner_batch_size', function () {
|
||||
// return 0 batch sizes to prevent the queue runner from running;
|
||||
// this is the fastest way to stop the current running cron
|
||||
return 0;
|
||||
});
|
||||
|
||||
$this->cronTrigger->disable();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,223 @@
|
||||
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
|
||||
|
||||
namespace MailPoet\Config;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
use Automattic\WooCommerce\Admin\Features\OnboardingTasks\Task;
|
||||
use Automattic\WooCommerce\Admin\Features\OnboardingTasks\TaskLists;
|
||||
use MailPoet\Logging\LoggerFactory;
|
||||
use MailPoet\Segments\WooCommerce as WooCommerceSegment;
|
||||
use MailPoet\Statistics\Track\WooCommercePurchases;
|
||||
use MailPoet\Subscription\Registration;
|
||||
use MailPoet\WooCommerce\MailPoetTask;
|
||||
use MailPoet\WooCommerce\MultichannelMarketing\MPMarketingChannelController;
|
||||
use MailPoet\WooCommerce\Settings as WooCommerceSettings;
|
||||
use MailPoet\WooCommerce\SubscriberEngagement;
|
||||
use MailPoet\WooCommerce\Subscription as WooCommerceSubscription;
|
||||
use MailPoet\WooCommerce\Tracker;
|
||||
|
||||
class HooksWooCommerce {
|
||||
/** @var WooCommerceSubscription */
|
||||
private $woocommerceSubscription;
|
||||
|
||||
/** @var WooCommerceSegment */
|
||||
private $woocommerceSegment;
|
||||
|
||||
/** @var WooCommerceSettings */
|
||||
private $woocommerceSettings;
|
||||
|
||||
/** @var WooCommercePurchases */
|
||||
private $woocommercePurchases;
|
||||
|
||||
/** @var Registration */
|
||||
private $subscriberRegistration;
|
||||
|
||||
/** @var LoggerFactory */
|
||||
private $loggerFactory;
|
||||
|
||||
/** @var SubscriberEngagement */
|
||||
private $subscriberEngagement;
|
||||
|
||||
/** @var Tracker */
|
||||
private $tracker;
|
||||
|
||||
/** @var MPMarketingChannelController */
|
||||
private $marketingChannelController;
|
||||
|
||||
public function __construct(
|
||||
WooCommerceSubscription $woocommerceSubscription,
|
||||
WooCommerceSegment $woocommerceSegment,
|
||||
WooCommerceSettings $woocommerceSettings,
|
||||
WooCommercePurchases $woocommercePurchases,
|
||||
Registration $subscriberRegistration,
|
||||
LoggerFactory $loggerFactory,
|
||||
Tracker $tracker,
|
||||
SubscriberEngagement $subscriberEngagement,
|
||||
MPMarketingChannelController $marketingChannelController
|
||||
) {
|
||||
$this->woocommerceSubscription = $woocommerceSubscription;
|
||||
$this->woocommerceSegment = $woocommerceSegment;
|
||||
$this->woocommerceSettings = $woocommerceSettings;
|
||||
$this->woocommercePurchases = $woocommercePurchases;
|
||||
$this->loggerFactory = $loggerFactory;
|
||||
$this->subscriberRegistration = $subscriberRegistration;
|
||||
$this->tracker = $tracker;
|
||||
$this->subscriberEngagement = $subscriberEngagement;
|
||||
$this->marketingChannelController = $marketingChannelController;
|
||||
}
|
||||
|
||||
public function extendWooCommerceCheckoutForm() {
|
||||
try {
|
||||
$this->woocommerceSubscription->extendWooCommerceCheckoutForm();
|
||||
} catch (\Throwable $e) {
|
||||
$this->logError($e, 'WooCommerce Subscription');
|
||||
}
|
||||
}
|
||||
|
||||
public function hideAutomateWooOptinCheckbox() {
|
||||
try {
|
||||
$this->woocommerceSubscription->hideAutomateWooOptinCheckbox();
|
||||
} catch (\Throwable $e) {
|
||||
$this->logError($e, 'WooCommerce Subscription');
|
||||
}
|
||||
}
|
||||
|
||||
public function subscribeOnCheckout($orderId, $data) {
|
||||
try {
|
||||
$this->woocommerceSubscription->subscribeOnCheckout($orderId, $data);
|
||||
} catch (\Throwable $e) {
|
||||
$this->logError($e, 'WooCommerce Subscription');
|
||||
}
|
||||
}
|
||||
|
||||
public function subscribeOnOrderPay($orderId) {
|
||||
try {
|
||||
$this->woocommerceSubscription->subscribeOnOrderPay($orderId);
|
||||
} catch (\Throwable $e) {
|
||||
$this->logError($e, 'WooCommerce Subscription');
|
||||
}
|
||||
}
|
||||
|
||||
public function disableWooCommerceSettings() {
|
||||
try {
|
||||
$this->woocommerceSettings->disableWooCommerceSettings();
|
||||
} catch (\Throwable $e) {
|
||||
$this->logError($e, 'WooCommerce Settings');
|
||||
}
|
||||
}
|
||||
|
||||
public function synchronizeRegisteredCustomer($wpUserId, $currentFilter = null) {
|
||||
try {
|
||||
$this->woocommerceSegment->synchronizeRegisteredCustomer($wpUserId, $currentFilter);
|
||||
} catch (\Throwable $e) {
|
||||
$this->logError($e, 'WooCommerce Sync');
|
||||
}
|
||||
}
|
||||
|
||||
public function synchronizeGuestCustomer($orderId) {
|
||||
try {
|
||||
$this->woocommerceSegment->synchronizeGuestCustomer($orderId);
|
||||
} catch (\Throwable $e) {
|
||||
$this->logError($e, 'WooCommerce Sync');
|
||||
}
|
||||
}
|
||||
|
||||
public function trackPurchase($id, $useCookies = true) {
|
||||
try {
|
||||
$this->woocommercePurchases->trackPurchase($id, $useCookies);
|
||||
} catch (\Throwable $e) {
|
||||
$this->logError($e, 'WooCommerce Purchases');
|
||||
}
|
||||
}
|
||||
|
||||
public function trackRefund($id) {
|
||||
try {
|
||||
$this->woocommercePurchases->trackRefund($id);
|
||||
} catch (\Throwable $e) {
|
||||
$this->logError($e, 'WooCommerce Purchases Refund');
|
||||
}
|
||||
}
|
||||
|
||||
public function extendForm() {
|
||||
try {
|
||||
$this->subscriberRegistration->extendForm();
|
||||
} catch (\Throwable $e) {
|
||||
$this->logError($e, 'WooCommerce Extend Form');
|
||||
}
|
||||
}
|
||||
|
||||
public function onRegister($errors, string $userLogin, string $userEmail = null) {
|
||||
try {
|
||||
if (empty($errors->errors)) {
|
||||
$this->subscriberRegistration->onRegister($errors, $userLogin, $userEmail);
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
$this->logError($e, 'WooCommerce on Register');
|
||||
}
|
||||
return $errors;
|
||||
}
|
||||
|
||||
public function updateSubscriberEngagement($orderId) {
|
||||
try {
|
||||
$this->subscriberEngagement->updateSubscriberEngagement($orderId);
|
||||
} catch (\Throwable $e) {
|
||||
$this->logError($e, 'WooCommerce Update Subscriber Engagement');
|
||||
}
|
||||
}
|
||||
|
||||
public function updateSubscriberLastPurchase($orderId) {
|
||||
try {
|
||||
$this->subscriberEngagement->updateSubscriberLastPurchase($orderId);
|
||||
} catch (\Throwable $e) {
|
||||
$this->logError($e, 'WooCommerce Update Subscriber Last Purchase');
|
||||
}
|
||||
}
|
||||
|
||||
public function declareWooCompatibility() {
|
||||
|
||||
if (!class_exists('\Automattic\WooCommerce\Utilities\FeaturesUtil')) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility('custom_order_tables', Env::$pluginPath);
|
||||
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility('cart_checkout_blocks', Env::$pluginPath);
|
||||
} catch (\Throwable $e) {
|
||||
$this->logError($e, 'WooCommerce Compatibility');
|
||||
}
|
||||
}
|
||||
|
||||
public function addTrackingData($data) {
|
||||
if (!is_array($data)) {
|
||||
return $data;
|
||||
}
|
||||
return $this->tracker->addTrackingData($data);
|
||||
}
|
||||
|
||||
public function addMailPoetTaskToWooHomePage() {
|
||||
try {
|
||||
if (class_exists(TaskLists::class) && class_exists(Task::class)) {
|
||||
TaskLists::add_task('extended', new MailPoetTask());
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
$this->logError($e, 'Unable to add MailPoet task to WooCommerce homepage');
|
||||
}
|
||||
}
|
||||
|
||||
public function addMailPoetMarketingMultiChannel($registeredMarketingChannels) {
|
||||
if (!is_array($registeredMarketingChannels)) {
|
||||
return $registeredMarketingChannels;
|
||||
}
|
||||
|
||||
return $this->marketingChannelController->registerMarketingChannel($registeredMarketingChannels);
|
||||
}
|
||||
|
||||
private function logError(\Throwable $e, $name) {
|
||||
$logger = $this->loggerFactory->getLogger($name);
|
||||
$logger->error($e->getMessage(), [
|
||||
'file' => $e->getFile(),
|
||||
'line' => $e->getLine(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,583 @@
|
||||
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
|
||||
|
||||
namespace MailPoet\Config;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
use MailPoet\API\JSON\API;
|
||||
use MailPoet\API\REST\API as RestApi;
|
||||
use MailPoet\AutomaticEmails\AutomaticEmails;
|
||||
use MailPoet\Automation\Engine\Engine;
|
||||
use MailPoet\Automation\Engine\Hooks as AutomationHooks;
|
||||
use MailPoet\Automation\Integrations\MailPoet\MailPoetIntegration;
|
||||
use MailPoet\Automation\Integrations\WooCommerce\WooCommerceIntegration;
|
||||
use MailPoet\Cron\CronTrigger;
|
||||
use MailPoet\Cron\DaemonActionSchedulerRunner;
|
||||
use MailPoet\EmailEditor\Engine\Email_Editor;
|
||||
use MailPoet\EmailEditor\Integrations\Core\Initializer as CoreEmailEditorIntegration;
|
||||
use MailPoet\EmailEditor\Integrations\MailPoet\Blocks\BlockTypesController;
|
||||
use MailPoet\EmailEditor\Integrations\MailPoet\EmailEditor as MailpoetEmailEditorIntegration;
|
||||
use MailPoet\InvalidStateException;
|
||||
use MailPoet\Migrator\Cli as MigratorCli;
|
||||
use MailPoet\PostEditorBlocks\PostEditorBlock;
|
||||
use MailPoet\PostEditorBlocks\WooCommerceBlocksIntegration;
|
||||
use MailPoet\Router;
|
||||
use MailPoet\Settings\SettingsController;
|
||||
use MailPoet\Statistics\Track\SubscriberActivityTracker;
|
||||
use MailPoet\Util\ConflictResolver;
|
||||
use MailPoet\Util\LegacyDatabase;
|
||||
use MailPoet\Util\Notices\PermanentNotices;
|
||||
use MailPoet\Util\Url;
|
||||
use MailPoet\WooCommerce\Helper as WooCommerceHelper;
|
||||
use MailPoet\WooCommerce\TransactionalEmailHooks as WCTransactionalEmails;
|
||||
use MailPoet\WP\Functions as WPFunctions;
|
||||
use MailPoet\WP\Notice as WPNotice;
|
||||
|
||||
class Initializer {
|
||||
/** @var AccessControl */
|
||||
private $accessControl;
|
||||
|
||||
/** @var Renderer */
|
||||
private $renderer;
|
||||
|
||||
/** @var RendererFactory */
|
||||
private $rendererFactory;
|
||||
|
||||
/** @var API */
|
||||
private $api;
|
||||
|
||||
/** @var RestApi */
|
||||
private $restApi;
|
||||
|
||||
/** @var Activator */
|
||||
private $activator;
|
||||
|
||||
/** @var SettingsController */
|
||||
private $settings;
|
||||
|
||||
/** @var MigratorCli */
|
||||
private $migratorCli;
|
||||
|
||||
/** @var Router\Router */
|
||||
private $router;
|
||||
|
||||
/** @var Hooks */
|
||||
private $hooks;
|
||||
|
||||
/** @var Changelog */
|
||||
private $changelog;
|
||||
|
||||
/** @var Menu */
|
||||
private $menu;
|
||||
|
||||
/** @var CronTrigger */
|
||||
private $cronTrigger;
|
||||
|
||||
/** @var PermanentNotices */
|
||||
private $permanentNotices;
|
||||
|
||||
/** @var Shortcodes */
|
||||
private $shortcodes;
|
||||
|
||||
/** @var WCTransactionalEmails */
|
||||
private $wcTransactionalEmails;
|
||||
|
||||
/** @var WooCommerceHelper */
|
||||
private $wcHelper;
|
||||
|
||||
/** @var \MailPoet\PostEditorBlocks\PostEditorBlock */
|
||||
private $postEditorBlock;
|
||||
|
||||
/** @var \MailPoet\PostEditorBlocks\WooCommerceBlocksIntegration */
|
||||
private $woocommerceBlocksIntegration;
|
||||
|
||||
/** @var Localizer */
|
||||
private $localizer;
|
||||
|
||||
/** @var AutomaticEmails */
|
||||
private $automaticEmails;
|
||||
|
||||
/** @var WPFunctions */
|
||||
private $wpFunctions;
|
||||
|
||||
/** @var AssetsLoader */
|
||||
private $assetsLoader;
|
||||
|
||||
/** @var SubscriberActivityTracker */
|
||||
private $subscriberActivityTracker;
|
||||
|
||||
/** @var Engine */
|
||||
private $automationEngine;
|
||||
|
||||
/** @var MailPoetIntegration */
|
||||
private $automationMailPoetIntegration;
|
||||
|
||||
/** @var WooCommerceIntegration */
|
||||
private $woocommerceIntegration;
|
||||
|
||||
/** @var PersonalDataExporters */
|
||||
private $personalDataExporters;
|
||||
|
||||
/** @var DaemonActionSchedulerRunner */
|
||||
private $actionSchedulerRunner;
|
||||
|
||||
/** @var Email_Editor */
|
||||
private $emailEditor;
|
||||
|
||||
/** @var MailpoetEmailEditorIntegration */
|
||||
private $mailpoetEmailEditorIntegration;
|
||||
|
||||
/** @var CoreEmailEditorIntegration */
|
||||
private $coreEmailEditorIntegration;
|
||||
|
||||
/** @var BlockTypesController */
|
||||
private $blockTypesController;
|
||||
|
||||
/** @var Url */
|
||||
private $urlHelper;
|
||||
|
||||
const INITIALIZED = 'MAILPOET_INITIALIZED';
|
||||
|
||||
const PLUGIN_ACTIVATED = 'mailpoet_plugin_activated';
|
||||
|
||||
public function __construct(
|
||||
RendererFactory $rendererFactory,
|
||||
AccessControl $accessControl,
|
||||
API $api,
|
||||
RestApi $restApi,
|
||||
Activator $activator,
|
||||
SettingsController $settings,
|
||||
MigratorCli $migratorCli,
|
||||
Router\Router $router,
|
||||
Hooks $hooks,
|
||||
Changelog $changelog,
|
||||
Menu $menu,
|
||||
CronTrigger $cronTrigger,
|
||||
PermanentNotices $permanentNotices,
|
||||
Shortcodes $shortcodes,
|
||||
WCTransactionalEmails $wcTransactionalEmails,
|
||||
PostEditorBlock $postEditorBlock,
|
||||
WooCommerceBlocksIntegration $woocommerceBlocksIntegration,
|
||||
WooCommerceHelper $wcHelper,
|
||||
Localizer $localizer,
|
||||
AutomaticEmails $automaticEmails,
|
||||
SubscriberActivityTracker $subscriberActivityTracker,
|
||||
WPFunctions $wpFunctions,
|
||||
AssetsLoader $assetsLoader,
|
||||
Engine $automationEngine,
|
||||
MailPoetIntegration $automationMailPoetIntegration,
|
||||
WooCommerceIntegration $woocommerceIntegration,
|
||||
PersonalDataExporters $personalDataExporters,
|
||||
DaemonActionSchedulerRunner $actionSchedulerRunner,
|
||||
Email_Editor $emailEditor,
|
||||
BlockTypesController $blockTypesController,
|
||||
MailpoetEmailEditorIntegration $mailpoetEmailEditorIntegration,
|
||||
CoreEmailEditorIntegration $coreEmailEditorIntegration,
|
||||
Url $urlHelper
|
||||
) {
|
||||
$this->rendererFactory = $rendererFactory;
|
||||
$this->accessControl = $accessControl;
|
||||
$this->api = $api;
|
||||
$this->restApi = $restApi;
|
||||
$this->activator = $activator;
|
||||
$this->settings = $settings;
|
||||
$this->migratorCli = $migratorCli;
|
||||
$this->router = $router;
|
||||
$this->hooks = $hooks;
|
||||
$this->changelog = $changelog;
|
||||
$this->menu = $menu;
|
||||
$this->cronTrigger = $cronTrigger;
|
||||
$this->permanentNotices = $permanentNotices;
|
||||
$this->shortcodes = $shortcodes;
|
||||
$this->wcTransactionalEmails = $wcTransactionalEmails;
|
||||
$this->wcHelper = $wcHelper;
|
||||
$this->postEditorBlock = $postEditorBlock;
|
||||
$this->woocommerceBlocksIntegration = $woocommerceBlocksIntegration;
|
||||
$this->localizer = $localizer;
|
||||
$this->automaticEmails = $automaticEmails;
|
||||
$this->subscriberActivityTracker = $subscriberActivityTracker;
|
||||
$this->wpFunctions = $wpFunctions;
|
||||
$this->assetsLoader = $assetsLoader;
|
||||
$this->automationEngine = $automationEngine;
|
||||
$this->automationMailPoetIntegration = $automationMailPoetIntegration;
|
||||
$this->woocommerceIntegration = $woocommerceIntegration;
|
||||
$this->personalDataExporters = $personalDataExporters;
|
||||
$this->actionSchedulerRunner = $actionSchedulerRunner;
|
||||
$this->emailEditor = $emailEditor;
|
||||
$this->mailpoetEmailEditorIntegration = $mailpoetEmailEditorIntegration;
|
||||
$this->coreEmailEditorIntegration = $coreEmailEditorIntegration;
|
||||
$this->blockTypesController = $blockTypesController;
|
||||
$this->urlHelper = $urlHelper;
|
||||
}
|
||||
|
||||
public function init() {
|
||||
// Initialize Action Scheduler. It needs to be called early because it hooks into `plugins_loaded`.
|
||||
require_once __DIR__ . '/../../vendor/woocommerce/action-scheduler/action-scheduler.php';
|
||||
|
||||
// define legacy constants for DB tables - for back compatibility
|
||||
LegacyDatabase::defineTableConstants();
|
||||
|
||||
// load translations and setup translations update/download
|
||||
$this->setupLocalizer();
|
||||
|
||||
// activation function
|
||||
$this->wpFunctions->registerActivationHook(
|
||||
Env::$file,
|
||||
[
|
||||
$this,
|
||||
'runActivator',
|
||||
]
|
||||
);
|
||||
|
||||
// deactivation function
|
||||
$this->wpFunctions->registerDeactivationHook(
|
||||
Env::$file,
|
||||
[
|
||||
$this,
|
||||
'runDeactivation',
|
||||
]
|
||||
);
|
||||
|
||||
$this->wpFunctions->addAction('activated_plugin', [
|
||||
new PluginActivatedHook(new DeferredAdminNotices),
|
||||
'action',
|
||||
], 10, 2);
|
||||
|
||||
$this->wpFunctions->addAction('plugins_loaded', [
|
||||
$this,
|
||||
'pluginsLoaded',
|
||||
], 0);
|
||||
|
||||
$this->wpFunctions->addAction('init', [
|
||||
$this,
|
||||
'preInitialize',
|
||||
], 0);
|
||||
|
||||
$this->wpFunctions->addAction('init', [
|
||||
$this,
|
||||
'initialize',
|
||||
]);
|
||||
|
||||
$this->wpFunctions->addAction(
|
||||
'init',
|
||||
[$this, 'maybeRunActivator'],
|
||||
PHP_INT_MIN
|
||||
);
|
||||
|
||||
$this->wpFunctions->addAction('admin_init', [
|
||||
$this,
|
||||
'setupPrivacyPolicy',
|
||||
]);
|
||||
|
||||
$this->wpFunctions->addAction('wp_loaded', [
|
||||
$this,
|
||||
'postInitialize',
|
||||
]);
|
||||
|
||||
$this->wpFunctions->addAction('admin_init', [
|
||||
new DeferredAdminNotices,
|
||||
'printAndClean',
|
||||
]);
|
||||
|
||||
$this->wpFunctions->addFilter('wpmu_drop_tables', [
|
||||
$this,
|
||||
'multisiteDropTables',
|
||||
]);
|
||||
|
||||
$this->wpFunctions->addFilter('mailpoet_email_editor_initialized', [
|
||||
$this,
|
||||
'setupEmailEditorIntegrations',
|
||||
]);
|
||||
|
||||
WPFunctions::get()->addAction(AutomationHooks::INITIALIZE, [
|
||||
$this->automationMailPoetIntegration,
|
||||
'register',
|
||||
]);
|
||||
WPFunctions::get()->addAction(AutomationHooks::INITIALIZE, [
|
||||
$this->woocommerceIntegration,
|
||||
'register',
|
||||
]);
|
||||
|
||||
WPFunctions::get()->addAction('admin_init', [
|
||||
$this,
|
||||
'afterPluginActivation',
|
||||
]);
|
||||
|
||||
$this->hooks->initEarlyHooks();
|
||||
}
|
||||
|
||||
public function runActivator() {
|
||||
try {
|
||||
$this->wpFunctions->addOption(self::PLUGIN_ACTIVATED, true); // used in afterPluginActivation
|
||||
$this->activator->activate();
|
||||
} catch (InvalidStateException $e) {
|
||||
return $this->handleRunningMigration($e);
|
||||
} catch (\Exception $e) {
|
||||
return $this->handleFailedInitialization($e);
|
||||
}
|
||||
}
|
||||
|
||||
public function pluginsLoaded() {
|
||||
$this->hooks->init();
|
||||
}
|
||||
|
||||
public function preInitialize() {
|
||||
try {
|
||||
$this->renderer = $this->rendererFactory->getRenderer();
|
||||
$this->setupWidget();
|
||||
$this->setupWoocommerceTransactionalEmails();
|
||||
$this->assetsLoader->loadStyles();
|
||||
} catch (\Exception $e) {
|
||||
$this->handleFailedInitialization($e);
|
||||
}
|
||||
}
|
||||
|
||||
public function setupWidget() {
|
||||
$this->wpFunctions->registerWidget('\MailPoet\Form\Widget');
|
||||
}
|
||||
|
||||
public function initialize() {
|
||||
try {
|
||||
$this->migratorCli->initialize();
|
||||
$this->setupInstaller();
|
||||
$this->setupUpdater();
|
||||
|
||||
$this->setupCapabilities();
|
||||
$this->menu->init();
|
||||
$this->setupShortcodes();
|
||||
$this->setupImages();
|
||||
$this->setupPersonalDataExporters();
|
||||
$this->setupPersonalDataErasers();
|
||||
|
||||
$this->changelog->init();
|
||||
$this->setupCronTrigger();
|
||||
$this->setupConflictResolver();
|
||||
|
||||
$this->setupPages();
|
||||
|
||||
$this->setupPermanentNotices();
|
||||
$this->setupAutomaticEmails();
|
||||
$this->setupWoocommerceBlocksIntegration();
|
||||
$this->setupDeactivationPoll();
|
||||
$this->subscriberActivityTracker->trackActivity();
|
||||
$this->postEditorBlock->init();
|
||||
$this->automationEngine->initialize();
|
||||
$this->blockTypesController->initialize();
|
||||
$this->emailEditor->initialize();
|
||||
$this->wpFunctions->doAction('mailpoet_initialized', MAILPOET_VERSION);
|
||||
} catch (InvalidStateException $e) {
|
||||
return $this->handleRunningMigration($e);
|
||||
} catch (\Exception $e) {
|
||||
return $this->handleFailedInitialization($e);
|
||||
}
|
||||
|
||||
define(self::INITIALIZED, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Walk around for getting this to work correctly
|
||||
*
|
||||
* Read more here: https://developer.wordpress.org/reference/functions/register_activation_hook/
|
||||
* and https://github.com/mailpoet/mailpoet/pull/4620#discussion_r1058210174
|
||||
* @return void
|
||||
*/
|
||||
public function afterPluginActivation() {
|
||||
if (!$this->wpFunctions->isAdmin() || !defined(self::INITIALIZED) || !$this->wpFunctions->getOption(self::PLUGIN_ACTIVATED)) return;
|
||||
|
||||
$currentUrl = $this->urlHelper->getCurrentUrl();
|
||||
|
||||
// wp automatically redirect to `wp-admin/plugins.php?activate=true&...` after plugin activation
|
||||
$activatedByWpAdmin = !empty(strpos($currentUrl, 'plugins.php')) && isset($_GET['activate']) && (bool)$_GET['activate'];
|
||||
|
||||
// We want to run this only once immediately after activation.
|
||||
// Delete the flag to prevent triggering on subsequent page loads.
|
||||
$this->wpFunctions->deleteOption(self::PLUGIN_ACTIVATED);
|
||||
|
||||
// If not activated by wp. Do not redirect e.g WooCommerce NUX
|
||||
if ($activatedByWpAdmin) {
|
||||
$this->changelog->redirectToLandingPage();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the plugin was updated and runs the activator if needed. The activator
|
||||
* will run the database migrations and update the db version among a few other things.
|
||||
*
|
||||
* @return void
|
||||
* @throws InvalidStateException
|
||||
*/
|
||||
public function maybeRunActivator() {
|
||||
try {
|
||||
$currentDbVersion = $this->settings->get('db_version');
|
||||
} catch (\Exception $e) {
|
||||
$currentDbVersion = null;
|
||||
}
|
||||
|
||||
if (version_compare((string)$currentDbVersion, Env::$version) === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// if current db version and plugin version differ
|
||||
try {
|
||||
$this->activator->activate();
|
||||
} catch (InvalidStateException $e) {
|
||||
$this->handleRunningMigration($e);
|
||||
} catch (\Exception $e) {
|
||||
$this->handleFailedInitialization($e);
|
||||
}
|
||||
}
|
||||
|
||||
public function setupInstaller() {
|
||||
$installer = new Installer(
|
||||
Installer::PREMIUM_PLUGIN_SLUG
|
||||
);
|
||||
$installer->init();
|
||||
}
|
||||
|
||||
public function setupUpdater() {
|
||||
$premiumSlug = Installer::PREMIUM_PLUGIN_SLUG;
|
||||
$premiumPluginFile = Installer::getPluginFile($premiumSlug);
|
||||
$premiumVersion = defined('MAILPOET_PREMIUM_VERSION') ? MAILPOET_PREMIUM_VERSION : null;
|
||||
|
||||
if (empty($premiumPluginFile) || !$premiumVersion) {
|
||||
return false;
|
||||
}
|
||||
$updater = new Updater(
|
||||
$premiumPluginFile,
|
||||
$premiumSlug,
|
||||
MAILPOET_PREMIUM_VERSION
|
||||
);
|
||||
$updater->init();
|
||||
}
|
||||
|
||||
public function setupLocalizer() {
|
||||
$this->localizer->init($this->wpFunctions);
|
||||
}
|
||||
|
||||
public function setupCapabilities() {
|
||||
$caps = new Capabilities($this->renderer);
|
||||
$caps->init();
|
||||
}
|
||||
|
||||
public function setupShortcodes() {
|
||||
$this->shortcodes->init();
|
||||
}
|
||||
|
||||
public function setupImages() {
|
||||
$this->wpFunctions->addImageSize('mailpoet_newsletter_max', Env::NEWSLETTER_CONTENT_WIDTH);
|
||||
}
|
||||
|
||||
public function setupCronTrigger() {
|
||||
$this->cronTrigger->init((string)php_sapi_name());
|
||||
}
|
||||
|
||||
public function setupConflictResolver() {
|
||||
$conflictResolver = new ConflictResolver();
|
||||
$conflictResolver->init();
|
||||
}
|
||||
|
||||
public function postInitialize() {
|
||||
if (!defined(self::INITIALIZED)) return;
|
||||
try {
|
||||
$this->api->init();
|
||||
$this->restApi->init();
|
||||
$this->router->init();
|
||||
$this->setupUserLocale();
|
||||
} catch (\Exception $e) {
|
||||
$this->handleFailedInitialization($e);
|
||||
}
|
||||
}
|
||||
|
||||
public function setupUserLocale() {
|
||||
if (get_user_locale() === $this->wpFunctions->getLocale()) return;
|
||||
$this->wpFunctions->unloadTextdomain(Env::$pluginName);
|
||||
$this->localizer->init($this->wpFunctions);
|
||||
}
|
||||
|
||||
public function setupPages() {
|
||||
$pages = new \MailPoet\Settings\Pages();
|
||||
$pages->init();
|
||||
}
|
||||
|
||||
public function setupPrivacyPolicy() {
|
||||
$privacyPolicy = new PrivacyPolicy();
|
||||
$privacyPolicy->init();
|
||||
}
|
||||
|
||||
public function setupPersonalDataExporters() {
|
||||
$this->personalDataExporters->init();
|
||||
}
|
||||
|
||||
public function setupPersonalDataErasers() {
|
||||
$erasers = new PersonalDataErasers();
|
||||
$erasers->init();
|
||||
}
|
||||
|
||||
public function setupPermanentNotices() {
|
||||
$this->permanentNotices->init();
|
||||
}
|
||||
|
||||
public function handleFailedInitialization($exception) {
|
||||
// check if we are able to add pages at this point
|
||||
if (function_exists('wp_get_current_user')) {
|
||||
Menu::addErrorPage($this->accessControl);
|
||||
}
|
||||
return WPNotice::displayError($exception);
|
||||
}
|
||||
|
||||
private function handleRunningMigration(InvalidStateException $exception) {
|
||||
if (function_exists('wp_get_current_user')) {
|
||||
Menu::addErrorPage($this->accessControl);
|
||||
}
|
||||
return WPNotice::displayWarning($exception->getMessage());
|
||||
}
|
||||
|
||||
public function setupAutomaticEmails() {
|
||||
$this->automaticEmails->init();
|
||||
$this->automaticEmails->getAutomaticEmails();
|
||||
}
|
||||
|
||||
public function multisiteDropTables($tables) {
|
||||
global $wpdb;
|
||||
$tablePrefix = $wpdb->prefix . Env::$pluginPrefix;
|
||||
$mailpoetTables = $wpdb->get_col(
|
||||
$wpdb->prepare(
|
||||
"SHOW TABLES LIKE %s",
|
||||
$wpdb->esc_like($tablePrefix) . '%'
|
||||
)
|
||||
);
|
||||
return array_merge($tables, $mailpoetTables);
|
||||
}
|
||||
|
||||
public function setupEmailEditorIntegrations() {
|
||||
$this->mailpoetEmailEditorIntegration->initialize();
|
||||
$this->coreEmailEditorIntegration->initialize();
|
||||
}
|
||||
|
||||
public function runDeactivation() {
|
||||
$this->actionSchedulerRunner->deactivate();
|
||||
}
|
||||
|
||||
private function setupWoocommerceTransactionalEmails() {
|
||||
$wcEnabled = $this->wcHelper->isWooCommerceActive();
|
||||
$optInEnabled = $this->settings->get('woocommerce.use_mailpoet_editor', false);
|
||||
if ($wcEnabled && $optInEnabled) {
|
||||
$this->wcTransactionalEmails->overrideStylesForWooEmails();
|
||||
$this->wcTransactionalEmails->useTemplateForWoocommerceEmails();
|
||||
}
|
||||
}
|
||||
|
||||
private function setupWoocommerceBlocksIntegration() {
|
||||
$wcEnabled = $this->wcHelper->isWooCommerceActive();
|
||||
$wcBlocksEnabled = $this->wcHelper->isWooCommerceBlocksActive('8.0.0');
|
||||
if ($wcEnabled && $wcBlocksEnabled) {
|
||||
$this->woocommerceBlocksIntegration->init();
|
||||
}
|
||||
}
|
||||
|
||||
private function setupDeactivationPoll(): void {
|
||||
$deactivationPoll = new DeactivationPoll($this->wpFunctions, $this->renderer);
|
||||
$deactivationPoll->init();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
|
||||
|
||||
namespace MailPoet\Config;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
use MailPoet\Services\Bridge;
|
||||
use MailPoet\Services\Release\API;
|
||||
use MailPoet\Settings\SettingsController;
|
||||
use MailPoet\Util\License\License;
|
||||
use MailPoet\WP\Functions as WPFunctions;
|
||||
|
||||
class Installer {
|
||||
const PREMIUM_PLUGIN_SLUG = 'mailpoet-premium';
|
||||
const PREMIUM_PLUGIN_PATH = 'mailpoet-premium/mailpoet-premium.php';
|
||||
|
||||
private $slug;
|
||||
|
||||
/** @var SettingsController */
|
||||
private $settings;
|
||||
|
||||
public function __construct(
|
||||
$slug
|
||||
) {
|
||||
$this->slug = $slug;
|
||||
$this->settings = SettingsController::getInstance();
|
||||
}
|
||||
|
||||
public function init() {
|
||||
WPFunctions::get()->addFilter('plugins_api', [$this, 'getPluginInformation'], 10, 3);
|
||||
}
|
||||
|
||||
public function generatePluginDownloadUrl(): string {
|
||||
$premiumKey = $this->settings->get(Bridge::PREMIUM_KEY_SETTING_NAME);
|
||||
return "https://release.mailpoet.com/downloads/mailpoet-premium/$premiumKey/latest/mailpoet-premium.zip";
|
||||
}
|
||||
|
||||
public function generatePluginActivationUrl(string $plugin): string {
|
||||
return WPFunctions::get()->adminUrl('plugins.php?' . implode('&', [
|
||||
'action=activate',
|
||||
'plugin=' . urlencode($plugin),
|
||||
'_wpnonce=' . WPFunctions::get()->wpCreateNonce('activate-plugin_' . $plugin),
|
||||
]));
|
||||
}
|
||||
|
||||
public function getPluginInformation($data, $action = '', $args = null) {
|
||||
if (
|
||||
$action === 'plugin_information'
|
||||
&& isset($args->slug)
|
||||
&& $args->slug === $this->slug
|
||||
) {
|
||||
$data = $this->retrievePluginInformation();
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public static function getPremiumStatus() {
|
||||
$slug = self::PREMIUM_PLUGIN_SLUG;
|
||||
|
||||
$premiumPluginActive = License::getLicense();
|
||||
$premiumPluginInstalled = $premiumPluginActive || self::isPluginInstalled($slug);
|
||||
$premiumPluginInitialized = defined('MAILPOET_PREMIUM_INITIALIZED') && MAILPOET_PREMIUM_INITIALIZED;
|
||||
$installer = new Installer(self::PREMIUM_PLUGIN_SLUG);
|
||||
$pluginInformation = $installer->retrievePluginInformation();
|
||||
|
||||
return [
|
||||
'premium_plugin_active' => $premiumPluginActive,
|
||||
'premium_plugin_installed' => $premiumPluginInstalled,
|
||||
'premium_plugin_initialized' => $premiumPluginInitialized,
|
||||
'premium_plugin_info' => $pluginInformation,
|
||||
];
|
||||
}
|
||||
|
||||
public static function isPluginInstalled($slug) {
|
||||
$installedPlugin = self::getInstalledPlugin($slug);
|
||||
return !empty($installedPlugin);
|
||||
}
|
||||
|
||||
private static function getInstalledPlugin($slug) {
|
||||
$installedPlugin = [];
|
||||
if (is_dir(WP_PLUGIN_DIR . '/' . $slug)) {
|
||||
$installedPlugin = WPFunctions::get()->getPlugins('/' . $slug);
|
||||
}
|
||||
return $installedPlugin;
|
||||
}
|
||||
|
||||
public static function getPluginFile($slug) {
|
||||
$pluginFile = false;
|
||||
$installedPlugin = self::getInstalledPlugin($slug);
|
||||
if (!empty($installedPlugin)) {
|
||||
$pluginFile = $slug . '/' . key($installedPlugin);
|
||||
}
|
||||
return $pluginFile;
|
||||
}
|
||||
|
||||
public function retrievePluginInformation() {
|
||||
$key = $this->settings->get(Bridge::PREMIUM_KEY_SETTING_NAME);
|
||||
$api = new API($key);
|
||||
return $api->getPluginInformation($this->slug);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
|
||||
|
||||
namespace MailPoet\Config;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
use MailPoet\WP\Functions as WPFunctions;
|
||||
|
||||
class Localizer {
|
||||
public function init(WPFunctions $wpFunctions) {
|
||||
$this->loadGlobalText();
|
||||
$this->setupTranslationsUpdater($wpFunctions);
|
||||
}
|
||||
|
||||
private function setupTranslationsUpdater(WPFunctions $wpFunctions) {
|
||||
$translationUpdater = $this->getUpdater($wpFunctions);
|
||||
$translationUpdater->init();
|
||||
}
|
||||
|
||||
public function loadGlobalText() {
|
||||
$languagePath = sprintf(
|
||||
'%s/%s-%s.mo',
|
||||
Env::$languagesPath,
|
||||
Env::$pluginName,
|
||||
$this->locale()
|
||||
);
|
||||
WPFunctions::get()->loadTextdomain(Env::$pluginName, $languagePath);
|
||||
}
|
||||
|
||||
public function locale() {
|
||||
$locale = WPFunctions::get()->applyFilters(
|
||||
'plugin_locale',
|
||||
WPFunctions::get()->getUserLocale(),
|
||||
Env::$pluginName
|
||||
);
|
||||
return $locale;
|
||||
}
|
||||
|
||||
public function forceInstallLanguagePacks(WPFunctions $wpFunctions) {
|
||||
$translationUpdater = $this->getUpdater($wpFunctions);
|
||||
// Add MailPoet translation update to the update_plugins site transient via inner hook
|
||||
$transient = $translationUpdater->checkForTranslations(new \stdClass());
|
||||
$mailpoetTranslations = [];
|
||||
$translationUpdates = $transient->translations ?? [];
|
||||
foreach ($translationUpdates as $translationUpdate) {
|
||||
$mailpoetTranslations[] = (object)$translationUpdate;
|
||||
}
|
||||
|
||||
if (!empty($mailpoetTranslations)) {
|
||||
require_once ABSPATH . '/wp-admin/includes/file.php';
|
||||
require_once ABSPATH . '/wp-admin/includes/class-wp-upgrader.php';
|
||||
$upgrader = new \Language_Pack_Upgrader(new SilentUpgraderSkin());
|
||||
$upgrader->bulk_upgrade($mailpoetTranslations);
|
||||
}
|
||||
}
|
||||
|
||||
public function forceLoadWebsiteLocaleText() {
|
||||
$languagePath = sprintf(
|
||||
'%s/%s-%s.mo',
|
||||
Env::$languagesPath,
|
||||
Env::$pluginName,
|
||||
WPFunctions::get()->getLocale()
|
||||
);
|
||||
WPFunctions::get()->unloadTextdomain(Env::$pluginName);
|
||||
WPFunctions::get()->loadTextdomain(Env::$pluginName, $languagePath);
|
||||
}
|
||||
|
||||
private function getUpdater(WPFunctions $wp): TranslationUpdater {
|
||||
$premiumSlug = Installer::PREMIUM_PLUGIN_SLUG;
|
||||
$premiumVersion = defined('MAILPOET_PREMIUM_VERSION') ? MAILPOET_PREMIUM_VERSION : null;
|
||||
$freeSlug = Env::$pluginName;
|
||||
$freeVersion = MAILPOET_VERSION;
|
||||
|
||||
return new TranslationUpdater(
|
||||
$wp,
|
||||
$freeSlug,
|
||||
$freeVersion,
|
||||
$premiumSlug,
|
||||
$premiumVersion
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,782 @@
|
||||
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
|
||||
|
||||
namespace MailPoet\Config;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
use MailPoet\AdminPages\Pages\Automation;
|
||||
use MailPoet\AdminPages\Pages\AutomationAnalytics;
|
||||
use MailPoet\AdminPages\Pages\AutomationEditor;
|
||||
use MailPoet\AdminPages\Pages\AutomationTemplates;
|
||||
use MailPoet\AdminPages\Pages\DynamicSegments;
|
||||
use MailPoet\AdminPages\Pages\ExperimentalFeatures;
|
||||
use MailPoet\AdminPages\Pages\FormEditor;
|
||||
use MailPoet\AdminPages\Pages\Forms;
|
||||
use MailPoet\AdminPages\Pages\Help;
|
||||
use MailPoet\AdminPages\Pages\Homepage;
|
||||
use MailPoet\AdminPages\Pages\Landingpage;
|
||||
use MailPoet\AdminPages\Pages\Logs;
|
||||
use MailPoet\AdminPages\Pages\NewsletterEditor;
|
||||
use MailPoet\AdminPages\Pages\Newsletters;
|
||||
use MailPoet\AdminPages\Pages\Settings;
|
||||
use MailPoet\AdminPages\Pages\StaticSegments;
|
||||
use MailPoet\AdminPages\Pages\Subscribers;
|
||||
use MailPoet\AdminPages\Pages\SubscribersExport;
|
||||
use MailPoet\AdminPages\Pages\SubscribersImport;
|
||||
use MailPoet\AdminPages\Pages\Upgrade;
|
||||
use MailPoet\AdminPages\Pages\WelcomeWizard;
|
||||
use MailPoet\AdminPages\Pages\WooCommerceSetup;
|
||||
use MailPoet\DI\ContainerWrapper;
|
||||
use MailPoet\EmailEditor\Integrations\MailPoet\EmailEditor;
|
||||
use MailPoet\Form\Util\CustomFonts;
|
||||
use MailPoet\Util\License\Features\CapabilitiesManager;
|
||||
use MailPoet\WP\Functions as WPFunctions;
|
||||
|
||||
class Menu {
|
||||
const MAIN_PAGE_SLUG = self::HOMEPAGE_PAGE_SLUG;
|
||||
const NO_PARENT_PAGE_SLUG = 'mailpoet-no-parent';
|
||||
|
||||
const EMAILS_PAGE_SLUG = 'mailpoet-newsletters';
|
||||
const FORMS_PAGE_SLUG = 'mailpoet-forms';
|
||||
const EMAIL_EDITOR_PAGE_SLUG = 'mailpoet-newsletter-editor';
|
||||
const FORM_EDITOR_PAGE_SLUG = 'mailpoet-form-editor';
|
||||
const HOMEPAGE_PAGE_SLUG = 'mailpoet-homepage';
|
||||
const FORM_TEMPLATES_PAGE_SLUG = 'mailpoet-form-editor-template-selection';
|
||||
const SUBSCRIBERS_PAGE_SLUG = 'mailpoet-subscribers';
|
||||
const IMPORT_PAGE_SLUG = 'mailpoet-import';
|
||||
const EXPORT_PAGE_SLUG = 'mailpoet-export';
|
||||
const LISTS_PAGE_SLUG = 'mailpoet-lists';
|
||||
const SEGMENTS_PAGE_SLUG = 'mailpoet-segments';
|
||||
const SETTINGS_PAGE_SLUG = 'mailpoet-settings';
|
||||
const HELP_PAGE_SLUG = 'mailpoet-help';
|
||||
const UPGRADE_PAGE_SLUG = 'mailpoet-upgrade';
|
||||
const WELCOME_WIZARD_PAGE_SLUG = 'mailpoet-welcome-wizard';
|
||||
const WOOCOMMERCE_SETUP_PAGE_SLUG = 'mailpoet-woocommerce-setup';
|
||||
const EXPERIMENTS_PAGE_SLUG = 'mailpoet-experimental';
|
||||
const LOGS_PAGE_SLUG = 'mailpoet-logs';
|
||||
const AUTOMATIONS_PAGE_SLUG = 'mailpoet-automation';
|
||||
const AUTOMATION_EDITOR_PAGE_SLUG = 'mailpoet-automation-editor';
|
||||
const AUTOMATION_ANALYTICS_PAGE_SLUG = 'mailpoet-automation-analytics';
|
||||
const AUTOMATION_TEMPLATES_PAGE_SLUG = 'mailpoet-automation-templates';
|
||||
|
||||
const LANDINGPAGE_PAGE_SLUG = 'mailpoet-landingpage';
|
||||
|
||||
const ICON_BASE64_SVG = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNTIuMDIgMTU2LjQiPjxwYXRoIGZpbGw9IiNhN2FhYWQiIGQ9Ik0zNy43MSw4OS4xYzMuNSwwLDUuOS0uOCw3LjItMi4zYTgsOCwwLDAsMCwyLTUuNFYzNS43bDE3LDQ1LjFhMTIuNjgsMTIuNjgsMCwwLDAsMy43LDUuNGMxLjYsMS4zLDQsMiw3LjIsMmExMi41NCwxMi41NCwwLDAsMCw1LjktMS40LDguNDEsOC40MSwwLDAsMCwzLjktNWwxOC4xLTUwVjgxYTguNTMsOC41MywwLDAsMCwyLjEsNi4xYzEuNCwxLjQsMy43LDIuMiw2LjksMi4yLDMuNSwwLDUuOS0uOCw3LjItMi4zYTgsOCwwLDAsMCwyLTUuNFY4LjdhNy40OCw3LjQ4LDAsMCwwLTMuMy02LjZjLTIuMS0xLjQtNS0yLjEtOC42LTIuMWExOS4zLDE5LjMsMCwwLDAtOS40LDIsMTEuNjMsMTEuNjMsMCwwLDAtNS4xLDYuOEw3NC45MSw2Ny4xLDU0LjQxLDguNGExMi40LDEyLjQsMCwwLDAtNC41LTYuMmMtMi4xLTEuNS01LTIuMi04LjgtMi4yYTE2LjUxLDE2LjUxLDAsMCwwLTguOSwyLjFjLTIuMywxLjUtMy41LDMuOS0zLjUsNy4yVjgwLjhjMCwyLjguNyw0LjgsMiw2LjJDMzIuMjEsODguNCwzNC40MSw4OS4xLDM3LjcxLDg5LjFaIi8+PHBhdGggZmlsbD0iI2E3YWFhZCIgZD0iTTE0OSwxMTYuNmwtMi40LTEuOWE3LjQsNy40LDAsMCwwLTkuNC4zLDE5LjY1LDE5LjY1LDAsMCwxLTEyLjUsNC42aC0yMS40QTM3LjA4LDM3LjA4LDAsMCwwLDc3LDEzMC41bC0xLjEsMS4yLTEuMS0xLjFhMzcuMjUsMzcuMjUsMCwwLDAtMjYuMy0xMC45SDI3YTE5LjU5LDE5LjU5LDAsMCwxLTEyLjQtNC42LDcuMjgsNy4yOCwwLDAsMC05LjQtLjNsLTIuNCwxLjlBNy40Myw3LjQzLDAsMCwwLDAsMTIyLjJhNy4xNCw3LjE0LDAsMCwwLDIuNCw1LjdBMzcuMjgsMzcuMjgsMCwwLDAsMjcsMTM3LjRoMjEuNmExOS41OSwxOS41OSwwLDAsMSwxOC45LDE0LjR2LjJjLjEuNywxLjIsNC40LDguNSw0LjRzOC40LTMuNyw4LjUtNC40di0uMmExOS41OSwxOS41OSwwLDAsMSwxOC45LTE0LjRIMTI1YTM3LjI4LDM3LjI4LDAsMCwwLDI0LjYtOS41LDcuNDIsNy40MiwwLDAsMCwyLjQtNS43QTcuODYsNy44NiwwLDAsMCwxNDksMTE2LjZaIi8+PC9zdmc+';
|
||||
|
||||
public $mpApiKeyValid;
|
||||
public $premiumKeyValid;
|
||||
|
||||
/** @var AccessControl */
|
||||
private $accessControl;
|
||||
|
||||
/** @var WPFunctions */
|
||||
private $wp;
|
||||
|
||||
/** @var ServicesChecker */
|
||||
private $servicesChecker;
|
||||
|
||||
/** @var ContainerWrapper */
|
||||
private $container;
|
||||
|
||||
/** @var Router */
|
||||
private $router;
|
||||
|
||||
/** @var CustomFonts */
|
||||
private $customFonts;
|
||||
|
||||
/** @var EmailEditor */
|
||||
private $emailEditor;
|
||||
|
||||
private CapabilitiesManager $capabilitiesManager;
|
||||
|
||||
public function __construct(
|
||||
AccessControl $accessControl,
|
||||
WPFunctions $wp,
|
||||
ServicesChecker $servicesChecker,
|
||||
ContainerWrapper $container,
|
||||
Router $router,
|
||||
CustomFonts $customFonts,
|
||||
CapabilitiesManager $capabilitiesManager,
|
||||
EmailEditor $emailEditor
|
||||
) {
|
||||
$this->accessControl = $accessControl;
|
||||
$this->wp = $wp;
|
||||
$this->servicesChecker = $servicesChecker;
|
||||
$this->container = $container;
|
||||
$this->router = $router;
|
||||
$this->customFonts = $customFonts;
|
||||
$this->capabilitiesManager = $capabilitiesManager;
|
||||
$this->emailEditor = $emailEditor;
|
||||
}
|
||||
|
||||
public function init() {
|
||||
$this->checkPremiumKey();
|
||||
|
||||
$this->wp->addAction(
|
||||
'admin_menu',
|
||||
[
|
||||
$this,
|
||||
'setup',
|
||||
]
|
||||
);
|
||||
|
||||
$this->wp->addFilter('parent_file', [$this, 'highlightNestedMailPoetSubmenus']);
|
||||
}
|
||||
|
||||
public function setup() {
|
||||
global $parent_file;
|
||||
$parent_file = self::EMAILS_PAGE_SLUG;
|
||||
if (!$this->accessControl->validatePermission(AccessControl::PERMISSION_ACCESS_PLUGIN_ADMIN)) return;
|
||||
|
||||
$this->router->checkRedirects();
|
||||
|
||||
$this->registerMailPoetMenu();
|
||||
|
||||
if (!self::isOnMailPoetAdminPage()) {
|
||||
return;
|
||||
}
|
||||
$this->wp->doAction('mailpoet_conflict_resolver_styles');
|
||||
$this->wp->doAction('mailpoet_conflict_resolver_scripts');
|
||||
|
||||
if (
|
||||
!isset($_REQUEST['page'])
|
||||
|| sanitize_text_field(wp_unslash($_REQUEST['page'])) !== 'mailpoet-newsletter-editor'
|
||||
) {
|
||||
return;
|
||||
}
|
||||
// Disable WP emojis to not interfere with the newsletter editor emoji handling
|
||||
$this->disableWPEmojis();
|
||||
if (!$this->customFonts->displayCustomFonts()) {
|
||||
return;
|
||||
}
|
||||
$this->wp->addAction('admin_head', function () {
|
||||
echo '<link href="https://fonts.googleapis.com/css?family='
|
||||
. 'Arvo:400,400i,700,700i'
|
||||
. '|Lato:400,400i,700,700i'
|
||||
. '|Lora:400,400i,700,700i'
|
||||
. '|Merriweather:400,400i,700,700i'
|
||||
. '|Merriweather+Sans:400,400i,700,700i'
|
||||
. '|Noticia+Text:400,400i,700,700i'
|
||||
. '|Open+Sans:400,400i,700,700i'
|
||||
. '|Playfair+Display:400,400i,700,700i'
|
||||
. '|Roboto:400,400i,700,700i'
|
||||
. '|Source+Sans+Pro:400,400i,700,700i'
|
||||
. '|Oswald:400,400i,700,700i'
|
||||
. '|Raleway:400,400i,700,700i'
|
||||
. '|Permanent+Marker:400,400i,700,700i'
|
||||
. '|Pacifico:400,400i,700,700i'
|
||||
. '" rel="stylesheet">';
|
||||
});
|
||||
}
|
||||
|
||||
private function registerMailPoetMenu() {
|
||||
|
||||
// Main page
|
||||
$this->wp->addMenuPage(
|
||||
'MailPoet',
|
||||
'MailPoet',
|
||||
AccessControl::PERMISSION_ACCESS_PLUGIN_ADMIN,
|
||||
self::MAIN_PAGE_SLUG,
|
||||
'',
|
||||
self::ICON_BASE64_SVG,
|
||||
30
|
||||
);
|
||||
|
||||
// Welcome wizard page
|
||||
$this->wp->addSubmenuPage(
|
||||
self::NO_PARENT_PAGE_SLUG,
|
||||
$this->setPageTitle(__('Welcome Wizard', 'mailpoet')),
|
||||
esc_html__('Welcome Wizard', 'mailpoet'),
|
||||
AccessControl::PERMISSION_ACCESS_PLUGIN_ADMIN,
|
||||
self::WELCOME_WIZARD_PAGE_SLUG,
|
||||
[
|
||||
$this,
|
||||
'welcomeWizard',
|
||||
]
|
||||
);
|
||||
|
||||
// Landingpage
|
||||
$this->wp->addSubmenuPage(
|
||||
self::NO_PARENT_PAGE_SLUG,
|
||||
$this->setPageTitle(__('MailPoet', 'mailpoet')),
|
||||
esc_html__('MailPoet', 'mailpoet'),
|
||||
AccessControl::PERMISSION_ACCESS_PLUGIN_ADMIN,
|
||||
self::LANDINGPAGE_PAGE_SLUG,
|
||||
[
|
||||
$this,
|
||||
'landingPage',
|
||||
]
|
||||
);
|
||||
|
||||
$this->registerMailPoetSubMenuEntries();
|
||||
}
|
||||
|
||||
private function registerMailPoetSubMenuEntries() {
|
||||
// Homepage
|
||||
$this->wp->addSubmenuPage(
|
||||
self::MAIN_PAGE_SLUG,
|
||||
$this->setPageTitle(__('Home', 'mailpoet')),
|
||||
esc_html__('Home', 'mailpoet'),
|
||||
AccessControl::PERMISSION_ACCESS_PLUGIN_ADMIN,
|
||||
self::HOMEPAGE_PAGE_SLUG,
|
||||
[
|
||||
$this,
|
||||
'homepage',
|
||||
]
|
||||
);
|
||||
|
||||
// Emails page
|
||||
$newslettersPage = $this->wp->addSubmenuPage(
|
||||
self::MAIN_PAGE_SLUG,
|
||||
$this->setPageTitle(__('Emails', 'mailpoet')),
|
||||
esc_html__('Emails', 'mailpoet'),
|
||||
AccessControl::PERMISSION_MANAGE_EMAILS,
|
||||
self::EMAILS_PAGE_SLUG,
|
||||
[
|
||||
$this,
|
||||
'newsletters',
|
||||
]
|
||||
);
|
||||
|
||||
// add limit per page to screen options
|
||||
$this->wp->addAction('load-' . $newslettersPage, function() {
|
||||
$this->wp->addScreenOption('per_page', [
|
||||
'label' => _x(
|
||||
'Number of newsletters per page',
|
||||
'newsletters per page (screen options)',
|
||||
'mailpoet'
|
||||
),
|
||||
'option' => 'mailpoet_newsletters_per_page',
|
||||
]);
|
||||
});
|
||||
|
||||
// newsletter editor
|
||||
$this->wp->addSubmenuPage(
|
||||
self::EMAILS_PAGE_SLUG,
|
||||
$this->setPageTitle(__('Newsletter', 'mailpoet')),
|
||||
esc_html__('Newsletter Editor', 'mailpoet'),
|
||||
AccessControl::PERMISSION_MANAGE_EMAILS,
|
||||
self::EMAIL_EDITOR_PAGE_SLUG,
|
||||
[
|
||||
$this,
|
||||
'newletterEditor',
|
||||
]
|
||||
);
|
||||
|
||||
$this->registerAutomationMenu();
|
||||
|
||||
// Forms page
|
||||
$formsPage = $this->wp->addSubmenuPage(
|
||||
self::MAIN_PAGE_SLUG,
|
||||
$this->setPageTitle(__('Forms', 'mailpoet')),
|
||||
esc_html__('Forms', 'mailpoet'),
|
||||
AccessControl::PERMISSION_MANAGE_FORMS,
|
||||
self::FORMS_PAGE_SLUG,
|
||||
[
|
||||
$this,
|
||||
'forms',
|
||||
]
|
||||
);
|
||||
|
||||
// add limit per page to screen options
|
||||
$this->wp->addAction('load-' . $formsPage, function() {
|
||||
$this->wp->addScreenOption('per_page', [
|
||||
'label' => _x(
|
||||
'Number of forms per page',
|
||||
'forms per page (screen options)',
|
||||
'mailpoet'
|
||||
),
|
||||
'option' => 'mailpoet_forms_per_page',
|
||||
]);
|
||||
});
|
||||
|
||||
// form editor
|
||||
$formEditorPage = $this->wp->addSubmenuPage(
|
||||
self::FORMS_PAGE_SLUG,
|
||||
$this->setPageTitle(__('Form Editor', 'mailpoet')),
|
||||
esc_html__('Form Editor', 'mailpoet'),
|
||||
AccessControl::PERMISSION_MANAGE_FORMS,
|
||||
self::FORM_EDITOR_PAGE_SLUG,
|
||||
[
|
||||
$this,
|
||||
'formEditor',
|
||||
]
|
||||
);
|
||||
|
||||
// add body class for form editor page
|
||||
$this->wp->addAction('load-' . $formEditorPage, function() {
|
||||
$this->wp->addFilter('admin_body_class', function ($classes) {
|
||||
return ltrim($classes . ' block-editor-page');
|
||||
});
|
||||
});
|
||||
|
||||
// form editor templates
|
||||
$formTemplateSelectionEditorPage = $this->wp->addSubmenuPage(
|
||||
self::FORMS_PAGE_SLUG,
|
||||
$this->setPageTitle(__('Select Form Template', 'mailpoet')),
|
||||
esc_html__('Select Form Template', 'mailpoet'),
|
||||
AccessControl::PERMISSION_MANAGE_FORMS,
|
||||
self::FORM_TEMPLATES_PAGE_SLUG,
|
||||
[
|
||||
$this,
|
||||
'formEditorTemplateSelection',
|
||||
]
|
||||
);
|
||||
|
||||
// Subscribers page
|
||||
$subscribersPage = $this->wp->addSubmenuPage(
|
||||
self::MAIN_PAGE_SLUG,
|
||||
$this->setPageTitle(__('Subscribers', 'mailpoet')),
|
||||
esc_html__('Subscribers', 'mailpoet'),
|
||||
AccessControl::PERMISSION_MANAGE_SUBSCRIBERS,
|
||||
self::SUBSCRIBERS_PAGE_SLUG,
|
||||
[
|
||||
$this,
|
||||
'subscribers',
|
||||
]
|
||||
);
|
||||
|
||||
// add limit per page to screen options
|
||||
$this->wp->addAction('load-' . $subscribersPage, function() {
|
||||
$this->wp->addScreenOption('per_page', [
|
||||
'label' => _x(
|
||||
'Number of subscribers per page',
|
||||
'subscribers per page (screen options)',
|
||||
'mailpoet'
|
||||
),
|
||||
'option' => 'mailpoet_subscribers_per_page',
|
||||
]);
|
||||
});
|
||||
|
||||
// import
|
||||
$this->wp->addSubmenuPage(
|
||||
self::SUBSCRIBERS_PAGE_SLUG,
|
||||
$this->setPageTitle(__('Import', 'mailpoet')),
|
||||
esc_html__('Import', 'mailpoet'),
|
||||
AccessControl::PERMISSION_MANAGE_SUBSCRIBERS,
|
||||
self::IMPORT_PAGE_SLUG,
|
||||
[
|
||||
$this,
|
||||
'import',
|
||||
]
|
||||
);
|
||||
|
||||
// export
|
||||
$this->wp->addSubmenuPage(
|
||||
self::SUBSCRIBERS_PAGE_SLUG,
|
||||
$this->setPageTitle(__('Export', 'mailpoet')),
|
||||
esc_html__('Export', 'mailpoet'),
|
||||
AccessControl::PERMISSION_MANAGE_SUBSCRIBERS,
|
||||
self::EXPORT_PAGE_SLUG,
|
||||
[
|
||||
$this,
|
||||
'export',
|
||||
]
|
||||
);
|
||||
|
||||
// Lists page
|
||||
$listsPage = $this->wp->addSubmenuPage(
|
||||
self::MAIN_PAGE_SLUG,
|
||||
$this->setPageTitle(__('Lists', 'mailpoet')),
|
||||
esc_html__('Lists', 'mailpoet'),
|
||||
AccessControl::PERMISSION_MANAGE_SEGMENTS,
|
||||
self::LISTS_PAGE_SLUG,
|
||||
[
|
||||
$this,
|
||||
'lists',
|
||||
]
|
||||
);
|
||||
|
||||
// add limit per page to screen options
|
||||
$this->wp->addAction('load-' . $listsPage, function() {
|
||||
$this->wp->addScreenOption('per_page', [
|
||||
'label' => _x(
|
||||
'Number of lists per page',
|
||||
'lists per page (screen options)',
|
||||
'mailpoet'
|
||||
),
|
||||
'option' => 'mailpoet_lists_per_page',
|
||||
]);
|
||||
});
|
||||
|
||||
// Segments page
|
||||
$segmentsPage = $this->wp->addSubmenuPage(
|
||||
self::MAIN_PAGE_SLUG,
|
||||
$this->setPageTitle(__('Segments', 'mailpoet')),
|
||||
esc_html__('Segments', 'mailpoet'),
|
||||
AccessControl::PERMISSION_MANAGE_SEGMENTS,
|
||||
self::SEGMENTS_PAGE_SLUG,
|
||||
[
|
||||
$this,
|
||||
'segments',
|
||||
]
|
||||
);
|
||||
|
||||
// add limit per page to screen options
|
||||
$this->wp->addAction('load-' . $segmentsPage, function() {
|
||||
$this->wp->addScreenOption('per_page', [
|
||||
'label' => _x(
|
||||
'Number of segments per page',
|
||||
'segments per page (screen options)',
|
||||
'mailpoet'
|
||||
),
|
||||
'option' => 'mailpoet_segments_per_page',
|
||||
]);
|
||||
});
|
||||
|
||||
// Settings page
|
||||
$this->wp->addSubmenuPage(
|
||||
self::MAIN_PAGE_SLUG,
|
||||
$this->setPageTitle(__('Settings', 'mailpoet')),
|
||||
esc_html__('Settings', 'mailpoet'),
|
||||
AccessControl::PERMISSION_MANAGE_SETTINGS,
|
||||
self::SETTINGS_PAGE_SLUG,
|
||||
[
|
||||
$this,
|
||||
'settings',
|
||||
]
|
||||
);
|
||||
|
||||
// Help page
|
||||
$this->wp->addSubmenuPage(
|
||||
self::MAIN_PAGE_SLUG,
|
||||
$this->setPageTitle(__('Help', 'mailpoet')),
|
||||
esc_html__('Help', 'mailpoet'),
|
||||
AccessControl::PERMISSION_MANAGE_HELP,
|
||||
self::HELP_PAGE_SLUG,
|
||||
[
|
||||
$this,
|
||||
'help',
|
||||
]
|
||||
);
|
||||
|
||||
// Upgrade page
|
||||
if ($this->capabilitiesManager->showUpgradePage()) {
|
||||
$this->wp->addSubmenuPage(
|
||||
self::MAIN_PAGE_SLUG,
|
||||
$this->setPageTitle(__('Upgrade', 'mailpoet')),
|
||||
esc_html__('Upgrade', 'mailpoet'),
|
||||
AccessControl::PERMISSION_ACCESS_PLUGIN_ADMIN,
|
||||
self::UPGRADE_PAGE_SLUG,
|
||||
[
|
||||
$this,
|
||||
'upgrade',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
// WooCommerce Setup
|
||||
$this->wp->addSubmenuPage(
|
||||
self::NO_PARENT_PAGE_SLUG,
|
||||
$this->setPageTitle(__('WooCommerce Setup', 'mailpoet')),
|
||||
esc_html__('WooCommerce Setup', 'mailpoet'),
|
||||
AccessControl::PERMISSION_ACCESS_PLUGIN_ADMIN,
|
||||
self::WOOCOMMERCE_SETUP_PAGE_SLUG,
|
||||
[
|
||||
$this,
|
||||
'wooCommerceSetup',
|
||||
]
|
||||
);
|
||||
|
||||
// Experimental page
|
||||
$this->wp->addSubmenuPage(
|
||||
self::SETTINGS_PAGE_SLUG,
|
||||
$this->setPageTitle(__('Experimental Features', 'mailpoet')),
|
||||
'',
|
||||
AccessControl::PERMISSION_MANAGE_FEATURES,
|
||||
self::EXPERIMENTS_PAGE_SLUG,
|
||||
[$this, 'experimentalFeatures']
|
||||
);
|
||||
|
||||
// display logs page
|
||||
$this->wp->addSubmenuPage(
|
||||
self::SETTINGS_PAGE_SLUG,
|
||||
$this->setPageTitle(__('Logs', 'mailpoet')),
|
||||
'',
|
||||
AccessControl::PERMISSION_ACCESS_PLUGIN_ADMIN,
|
||||
self::LOGS_PAGE_SLUG,
|
||||
[$this, 'logs']
|
||||
);
|
||||
}
|
||||
|
||||
private function registerAutomationMenu() {
|
||||
$automationPage = $this->wp->addSubmenuPage(
|
||||
self::MAIN_PAGE_SLUG,
|
||||
$this->setPageTitle(__('Automations', 'mailpoet')),
|
||||
esc_html__('Automations', 'mailpoet'),
|
||||
AccessControl::PERMISSION_MANAGE_EMAILS,
|
||||
self::AUTOMATIONS_PAGE_SLUG,
|
||||
[$this, 'automation']
|
||||
);
|
||||
|
||||
// Automation editor
|
||||
$automationEditorPage = $this->wp->addSubmenuPage(
|
||||
self::AUTOMATIONS_PAGE_SLUG,
|
||||
$this->setPageTitle(__('Automation Editor', 'mailpoet')),
|
||||
esc_html__('Automation Editor', 'mailpoet'),
|
||||
AccessControl::PERMISSION_MANAGE_AUTOMATIONS,
|
||||
self::AUTOMATION_EDITOR_PAGE_SLUG,
|
||||
[$this, 'automationEditor']
|
||||
);
|
||||
|
||||
// Automation analytics
|
||||
$this->wp->addSubmenuPage(
|
||||
self::AUTOMATIONS_PAGE_SLUG,
|
||||
$this->setPageTitle(__('Automation Analytics', 'mailpoet')),
|
||||
esc_html__('Automation Analytics', 'mailpoet'),
|
||||
AccessControl::PERMISSION_MANAGE_AUTOMATIONS,
|
||||
self::AUTOMATION_ANALYTICS_PAGE_SLUG,
|
||||
[$this, 'automationAnalytics']
|
||||
);
|
||||
|
||||
// Automation templates
|
||||
$this->wp->addSubmenuPage(
|
||||
self::AUTOMATIONS_PAGE_SLUG,
|
||||
$this->setPageTitle(__('Automation Templates', 'mailpoet')),
|
||||
esc_html__('Automation Templates', 'mailpoet'),
|
||||
AccessControl::PERMISSION_MANAGE_AUTOMATIONS,
|
||||
self::AUTOMATION_TEMPLATES_PAGE_SLUG,
|
||||
[$this, 'automationTemplates']
|
||||
);
|
||||
|
||||
// add body class for automation editor page
|
||||
$this->wp->addAction('load-' . $automationPage, function() {
|
||||
$this->wp->addFilter('admin_body_class', function ($classes) {
|
||||
return ltrim($classes . ' mailpoet-automation-is-onboarding');
|
||||
});
|
||||
});
|
||||
$this->wp->addAction('load-' . $automationEditorPage, function() {
|
||||
$this->wp->addFilter('admin_body_class', function ($classes) {
|
||||
return ltrim($classes . ' site-editor-php');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
public function disableWPEmojis() {
|
||||
$this->wp->removeAction('admin_print_scripts', 'print_emoji_detection_script');
|
||||
$this->wp->removeAction('admin_print_styles', 'print_emoji_styles');
|
||||
}
|
||||
|
||||
public function welcomeWizard() {
|
||||
$this->container->get(WelcomeWizard::class)->render();
|
||||
}
|
||||
|
||||
public function landingPage() {
|
||||
$this->container->get(Landingpage::class)->render();
|
||||
}
|
||||
|
||||
public function wooCommerceSetup() {
|
||||
$this->container->get(WooCommerceSetup::class)->render();
|
||||
}
|
||||
|
||||
public function upgrade() {
|
||||
$this->container->get(Upgrade::class)->render();
|
||||
}
|
||||
|
||||
public function settings() {
|
||||
$this->container->get(Settings::class)->render();
|
||||
}
|
||||
|
||||
public function help() {
|
||||
$this->container->get(Help::class)->render();
|
||||
}
|
||||
|
||||
public function homepage() {
|
||||
$this->container->get(Homepage::class)->render();
|
||||
}
|
||||
|
||||
public function automation() {
|
||||
$this->container->get(Automation::class)->render();
|
||||
}
|
||||
|
||||
public function automationTemplates() {
|
||||
$this->container->get(AutomationTemplates::class)->render();
|
||||
}
|
||||
|
||||
public function automationEditor() {
|
||||
$this->container->get(AutomationEditor::class)->render();
|
||||
}
|
||||
|
||||
public function automationAnalytics() {
|
||||
$this->container->get(AutomationAnalytics::class)->render();
|
||||
}
|
||||
|
||||
public function experimentalFeatures() {
|
||||
$this->container->get(ExperimentalFeatures::class)->render();
|
||||
}
|
||||
|
||||
public function logs() {
|
||||
$this->container->get(Logs::class)->render();
|
||||
}
|
||||
|
||||
public function subscribers() {
|
||||
$this->container->get(Subscribers::class)->render();
|
||||
}
|
||||
|
||||
public function lists() {
|
||||
$this->container->get(StaticSegments::class)->render();
|
||||
}
|
||||
|
||||
public function segments() {
|
||||
$this->container->get(DynamicSegments::class)->render();
|
||||
}
|
||||
|
||||
public function forms() {
|
||||
$this->container->get(Forms::class)->render();
|
||||
}
|
||||
|
||||
public function newsletters() {
|
||||
$this->container->get(Newsletters::class)->render();
|
||||
}
|
||||
|
||||
public function newletterEditor() {
|
||||
$this->container->get(NewsletterEditor::class)->render();
|
||||
}
|
||||
|
||||
public function import() {
|
||||
$this->container->get(SubscribersImport::class)->render();
|
||||
}
|
||||
|
||||
public function export() {
|
||||
$this->container->get(SubscribersExport::class)->render();
|
||||
}
|
||||
|
||||
public function formEditor() {
|
||||
$this->container->get(FormEditor::class)->render();
|
||||
}
|
||||
|
||||
public function formEditorTemplateSelection() {
|
||||
$this->container->get(FormEditor::class)->renderTemplateSelection();
|
||||
}
|
||||
|
||||
public function setPageTitle($title) {
|
||||
return sprintf(
|
||||
'%s - %s',
|
||||
__('MailPoet', 'mailpoet'),
|
||||
$title
|
||||
);
|
||||
}
|
||||
|
||||
public function highlightNestedMailPoetSubmenus($parentFile) {
|
||||
global $plugin_page, $submenu, $submenu_file;
|
||||
|
||||
$page = $this->getPageFromContext();
|
||||
if ($page) {
|
||||
$plugin_page = $page;
|
||||
return $parentFile;
|
||||
}
|
||||
|
||||
// In case we are on the email editor page, we want to highlight the Emails menu item
|
||||
if ($this->emailEditor->isEditorPage(false)) {
|
||||
$plugin_page = self::EMAILS_PAGE_SLUG;
|
||||
$submenu_file = self::EMAILS_PAGE_SLUG;
|
||||
return self::EMAILS_PAGE_SLUG;
|
||||
}
|
||||
|
||||
if ($parentFile === self::MAIN_PAGE_SLUG || !self::isOnMailPoetAdminPage()) {
|
||||
return $parentFile;
|
||||
}
|
||||
|
||||
// find slug of the current submenu item
|
||||
$parentSlug = null;
|
||||
foreach ($submenu as $groupSlug => $group) {
|
||||
foreach ($group as $item) {
|
||||
if (($item[2] ?? null) === $plugin_page) {
|
||||
$parentSlug = $groupSlug;
|
||||
break 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($parentSlug && $parentSlug !== self::NO_PARENT_PAGE_SLUG) {
|
||||
// highlight parent submenu item
|
||||
$plugin_page = $parentSlug;
|
||||
} else {
|
||||
// no parent, hide MailPoet submenu for setup, wizards, error pages, etc.
|
||||
unset($submenu[self::MAIN_PAGE_SLUG]);
|
||||
$plugin_page = self::MAIN_PAGE_SLUG;
|
||||
}
|
||||
return $parentFile;
|
||||
}
|
||||
|
||||
public static function isOnMailPoetAutomationPage(): bool {
|
||||
$screenId = isset($_REQUEST['page']) ? sanitize_text_field(wp_unslash($_REQUEST['page'])) : '';
|
||||
$automationPages = [
|
||||
'mailpoet-automation',
|
||||
'mailpoet-automation-templates',
|
||||
'mailpoet-automation-editor',
|
||||
];
|
||||
return in_array(
|
||||
$screenId,
|
||||
$automationPages,
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
public static function isOnMailPoetAdminPage(array $exclude = null, $screenId = null) {
|
||||
if (is_null($screenId)) {
|
||||
if (empty($_REQUEST['page'])) {
|
||||
return false;
|
||||
}
|
||||
$screenId = sanitize_text_field(wp_unslash($_REQUEST['page']));
|
||||
}
|
||||
if (!empty($exclude)) {
|
||||
foreach ($exclude as $slug) {
|
||||
if (stripos($screenId, $slug) !== false) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return (stripos($screenId, 'mailpoet-') !== false);
|
||||
}
|
||||
|
||||
/**
|
||||
* This error page is used when the initialization is failed
|
||||
* to display admin notices only
|
||||
*/
|
||||
public static function addErrorPage(AccessControl $accessControl) {
|
||||
if (!self::isOnMailPoetAdminPage() || !isset($_REQUEST['page'])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$page = sanitize_text_field(wp_unslash($_REQUEST['page']));
|
||||
// Check if page already exists
|
||||
if (
|
||||
get_plugin_page_hook($page, '')
|
||||
|| WPFunctions::get()->getPluginPageHook($page, self::MAIN_PAGE_SLUG)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
WPFunctions::get()->addSubmenuPage(
|
||||
self::NO_PARENT_PAGE_SLUG,
|
||||
'MailPoet',
|
||||
'MailPoet',
|
||||
AccessControl::PERMISSION_ACCESS_PLUGIN_ADMIN,
|
||||
$page,
|
||||
[
|
||||
__CLASS__,
|
||||
'errorPageCallback',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
public static function errorPageCallback() {
|
||||
// Used for displaying admin notices only
|
||||
}
|
||||
|
||||
public function checkPremiumKey(ServicesChecker $checker = null) {
|
||||
$showNotices = isset($_SERVER['SCRIPT_NAME'])
|
||||
&& stripos(sanitize_text_field(wp_unslash($_SERVER['SCRIPT_NAME'])), 'plugins.php') !== false;
|
||||
$checker = $checker ?: $this->servicesChecker;
|
||||
$this->premiumKeyValid = $checker->isPremiumKeyValid($showNotices);
|
||||
}
|
||||
|
||||
public function getPageFromContext(): ?string {
|
||||
$context = isset($_GET['context']) ? sanitize_text_field(wp_unslash($_GET['context'])) : null;
|
||||
if ($context === 'automation') {
|
||||
return self::AUTOMATIONS_PAGE_SLUG;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
|
||||
|
||||
namespace MailPoet\Config;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
use MailPoet\DI\ContainerWrapper;
|
||||
use MailPoet\Subscribers\SubscriberPersonalDataEraser;
|
||||
use MailPoet\WP\Functions as WPFunctions;
|
||||
|
||||
class PersonalDataErasers {
|
||||
public function init() {
|
||||
WPFunctions::get()->addFilter('wp_privacy_personal_data_erasers', [$this, 'registerSubscriberEraser']);
|
||||
}
|
||||
|
||||
public function registerSubscriberEraser($erasers) {
|
||||
$erasers['mailpet-subscriber'] = [
|
||||
'eraser_friendly_name' => __('MailPoet Subscribers', 'mailpoet'),
|
||||
'callback' => [ContainerWrapper::getInstance()->get(SubscriberPersonalDataEraser::class), 'erase'],
|
||||
];
|
||||
|
||||
return $erasers;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
|
||||
|
||||
namespace MailPoet\Config;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
use MailPoet\CustomFields\CustomFieldsRepository;
|
||||
use MailPoet\DI\ContainerWrapper;
|
||||
use MailPoet\Subscribers\ImportExport\PersonalDataExporters\NewsletterClicksExporter;
|
||||
use MailPoet\Subscribers\ImportExport\PersonalDataExporters\NewsletterOpensExporter;
|
||||
use MailPoet\Subscribers\ImportExport\PersonalDataExporters\NewslettersExporter;
|
||||
use MailPoet\Subscribers\ImportExport\PersonalDataExporters\SegmentsExporter;
|
||||
use MailPoet\Subscribers\ImportExport\PersonalDataExporters\SubscriberExporter;
|
||||
use MailPoet\Subscribers\SubscribersRepository;
|
||||
use MailPoet\WP\Functions as WPFunctions;
|
||||
|
||||
class PersonalDataExporters {
|
||||
|
||||
/*** @var SubscribersRepository */
|
||||
private $subscribersRepository;
|
||||
|
||||
/**
|
||||
* @var CustomFieldsRepository
|
||||
*/
|
||||
private $customFieldsRepository;
|
||||
|
||||
public function __construct(
|
||||
SubscribersRepository $subscribersRepository,
|
||||
CustomFieldsRepository $customFieldsRepository
|
||||
) {
|
||||
$this->subscribersRepository = $subscribersRepository;
|
||||
$this->customFieldsRepository = $customFieldsRepository;
|
||||
}
|
||||
|
||||
public function init() {
|
||||
WPFunctions::get()->addFilter('wp_privacy_personal_data_exporters', [$this, 'registerSubscriberExporter']);
|
||||
WPFunctions::get()->addFilter('wp_privacy_personal_data_exporters', [$this, 'registerSegmentsExporter']);
|
||||
WPFunctions::get()->addFilter('wp_privacy_personal_data_exporters', [$this, 'registerNewslettersExporter']);
|
||||
WPFunctions::get()->addFilter('wp_privacy_personal_data_exporters', [$this, 'registerNewsletterClicksExporter']);
|
||||
WPFunctions::get()->addFilter('wp_privacy_personal_data_exporters', [$this, 'registerNewsletterOpensExporter']);
|
||||
}
|
||||
|
||||
public function registerSegmentsExporter($exporters) {
|
||||
$exporters[] = [
|
||||
'exporter_friendly_name' => __('MailPoet Lists', 'mailpoet'),
|
||||
'callback' => [new SegmentsExporter($this->subscribersRepository), 'export'],
|
||||
];
|
||||
return $exporters;
|
||||
}
|
||||
|
||||
public function registerSubscriberExporter($exporters) {
|
||||
$exporters[] = [
|
||||
'exporter_friendly_name' => __('MailPoet Subscriber Data', 'mailpoet'),
|
||||
'callback' => [new SubscriberExporter($this->subscribersRepository, $this->customFieldsRepository), 'export'],
|
||||
];
|
||||
return $exporters;
|
||||
}
|
||||
|
||||
public function registerNewslettersExporter($exporters) {
|
||||
$newsletterExporter = ContainerWrapper::getInstance()->get(NewslettersExporter::class);
|
||||
$exporters[] = [
|
||||
'exporter_friendly_name' => __('MailPoet Emails', 'mailpoet'),
|
||||
'callback' => [$newsletterExporter, 'export'],
|
||||
];
|
||||
return $exporters;
|
||||
}
|
||||
|
||||
public function registerNewsletterClicksExporter($exporters) {
|
||||
$exporters[] = [
|
||||
'exporter_friendly_name' => __('MailPoet Email Clicks', 'mailpoet'),
|
||||
'callback' => [ContainerWrapper::getInstance()->get(NewsletterClicksExporter::class), 'export'],
|
||||
];
|
||||
return $exporters;
|
||||
}
|
||||
|
||||
public function registerNewsletterOpensExporter($exporters) {
|
||||
$exporters[] = [
|
||||
'exporter_friendly_name' => __('MailPoet Email Opens', 'mailpoet'),
|
||||
'callback' => [ContainerWrapper::getInstance()->get(NewsletterOpensExporter::class), 'export'],
|
||||
];
|
||||
return $exporters;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
|
||||
|
||||
namespace MailPoet\Config;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
use MailPoet\WP\Functions as WPFunctions;
|
||||
|
||||
class PluginActivatedHook {
|
||||
private $deferredAdminNotices;
|
||||
|
||||
public function __construct(
|
||||
DeferredAdminNotices $deferredAdminNotices
|
||||
) {
|
||||
$this->deferredAdminNotices = $deferredAdminNotices;
|
||||
}
|
||||
|
||||
public function action($plugin, $networkWide) {
|
||||
if ($plugin === WPFunctions::get()->pluginBasename(Env::$file) && $networkWide) {
|
||||
$this->deferredAdminNotices->addNetworkAdminNotice(__("We noticed that you're using an unsupported environment. While MailPoet might work within a MultiSite environment, we don’t support it.", 'mailpoet'));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,746 @@
|
||||
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
|
||||
|
||||
namespace MailPoet\Config;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
use MailPoet\Captcha\CaptchaConstants;
|
||||
use MailPoet\Captcha\CaptchaRenderer;
|
||||
use MailPoet\Cron\CronTrigger;
|
||||
use MailPoet\Cron\Workers\AuthorizedSendingEmailsCheck;
|
||||
use MailPoet\Cron\Workers\BackfillEngagementData;
|
||||
use MailPoet\Cron\Workers\InactiveSubscribers;
|
||||
use MailPoet\Cron\Workers\Mixpanel;
|
||||
use MailPoet\Cron\Workers\NewsletterTemplateThumbnails;
|
||||
use MailPoet\Cron\Workers\StatsNotifications\Worker;
|
||||
use MailPoet\Cron\Workers\SubscriberLinkTokens;
|
||||
use MailPoet\Cron\Workers\SubscribersLastEngagement;
|
||||
use MailPoet\Cron\Workers\UnsubscribeTokens;
|
||||
use MailPoet\Doctrine\WPDB\Connection;
|
||||
use MailPoet\Entities\NewsletterEntity;
|
||||
use MailPoet\Entities\NewsletterOptionFieldEntity;
|
||||
use MailPoet\Entities\NewsletterTemplateEntity;
|
||||
use MailPoet\Entities\ScheduledTaskEntity;
|
||||
use MailPoet\Entities\SegmentEntity;
|
||||
use MailPoet\Entities\StatisticsFormEntity;
|
||||
use MailPoet\Entities\SubscriberEntity;
|
||||
use MailPoet\Entities\UserFlagEntity;
|
||||
use MailPoet\Mailer\MailerLog;
|
||||
use MailPoet\Newsletter\Sending\ScheduledTasksRepository;
|
||||
use MailPoet\Referrals\ReferralDetector;
|
||||
use MailPoet\Segments\SegmentsRepository;
|
||||
use MailPoet\Segments\WP;
|
||||
use MailPoet\Services\Bridge;
|
||||
use MailPoet\Settings\Pages;
|
||||
use MailPoet\Settings\SettingsController;
|
||||
use MailPoet\Settings\UserFlagsRepository;
|
||||
use MailPoet\Subscribers\NewSubscriberNotificationMailer;
|
||||
use MailPoet\Subscribers\Source;
|
||||
use MailPoet\WP\Functions as WPFunctions;
|
||||
use MailPoetVendor\Carbon\Carbon;
|
||||
use MailPoetVendor\Doctrine\ORM\EntityManager;
|
||||
|
||||
class Populator {
|
||||
public $prefix;
|
||||
public $templates;
|
||||
/** @var SettingsController */
|
||||
private $settings;
|
||||
/** @var WPFunctions */
|
||||
private $wp;
|
||||
/** @var CaptchaRenderer */
|
||||
private $captchaRenderer;
|
||||
/** @var ReferralDetector */
|
||||
private $referralDetector;
|
||||
const TEMPLATES_NAMESPACE = '\MailPoet\Config\PopulatorData\Templates\\';
|
||||
/** @var WP */
|
||||
private $wpSegment;
|
||||
/** @var EntityManager */
|
||||
private $entityManager;
|
||||
/** @var ScheduledTasksRepository */
|
||||
private $scheduledTasksRepository;
|
||||
/** @var SegmentsRepository */
|
||||
private $segmentsRepository;
|
||||
|
||||
public function __construct(
|
||||
SettingsController $settings,
|
||||
WPFunctions $wp,
|
||||
CaptchaRenderer $captchaRenderer,
|
||||
ReferralDetector $referralDetector,
|
||||
EntityManager $entityManager,
|
||||
WP $wpSegment,
|
||||
ScheduledTasksRepository $scheduledTasksRepository,
|
||||
SegmentsRepository $segmentsRepository
|
||||
) {
|
||||
$this->settings = $settings;
|
||||
$this->wp = $wp;
|
||||
$this->captchaRenderer = $captchaRenderer;
|
||||
$this->wpSegment = $wpSegment;
|
||||
$this->referralDetector = $referralDetector;
|
||||
$this->prefix = Env::$dbPrefix;
|
||||
$this->templates = [
|
||||
'WelcomeBlank1Column',
|
||||
'WelcomeBlank12Column',
|
||||
'GiftWelcome',
|
||||
'Minimal',
|
||||
'Phone',
|
||||
'Sunglasses',
|
||||
'RealEstate',
|
||||
'AppWelcome',
|
||||
'FoodBox',
|
||||
'Poet',
|
||||
'PostNotificationsBlank1Column',
|
||||
'ModularStyleStories',
|
||||
'RssSimpleNews',
|
||||
'NotSoMedium',
|
||||
'WideStoryLayout',
|
||||
'IndustryConference',
|
||||
'ScienceWeekly',
|
||||
'NewspaperTraditional',
|
||||
'ClearNews',
|
||||
'DogFood',
|
||||
'KidsClothing',
|
||||
'RockBand',
|
||||
'WineCity',
|
||||
'Fitness',
|
||||
'Motor',
|
||||
'Avocado',
|
||||
'BookStoreWithCoupon',
|
||||
'FlowersWithCoupon',
|
||||
'NewsletterBlank1Column',
|
||||
'NewsletterBlank12Column',
|
||||
'NewsletterBlank121Column',
|
||||
'NewsletterBlank13Column',
|
||||
'SimpleText',
|
||||
'TakeAHike',
|
||||
'NewsDay',
|
||||
'WorldCup',
|
||||
'FestivalEvent',
|
||||
'RetroComputingMagazine',
|
||||
'Shoes',
|
||||
'Music',
|
||||
'Hotels',
|
||||
'PieceOfCake',
|
||||
'BuddhistTemple',
|
||||
'Mosque',
|
||||
'Synagogue',
|
||||
'Faith',
|
||||
'College',
|
||||
'RenewableEnergy',
|
||||
'PrimarySchool',
|
||||
'ComputerRepair',
|
||||
'YogaStudio',
|
||||
'Retro',
|
||||
'Charity',
|
||||
'CityLocalNews',
|
||||
'Coffee',
|
||||
'Vlogger',
|
||||
'Birds',
|
||||
'Engineering',
|
||||
'BrandingAgencyNews',
|
||||
'WordPressTheme',
|
||||
'Drone',
|
||||
'FashionBlog',
|
||||
'FashionStore',
|
||||
'FashionBlogA',
|
||||
'Photography',
|
||||
'JazzClub',
|
||||
'Guitarist',
|
||||
'HealthyFoodBlog',
|
||||
'Software',
|
||||
'LifestyleBlogA',
|
||||
'FashionShop',
|
||||
'LifestyleBlogB',
|
||||
'Painter',
|
||||
'FarmersMarket',
|
||||
'ConfirmInterestBeforeDeactivation',
|
||||
'ConfirmInterestOrUnsubscribe',
|
||||
];
|
||||
$this->entityManager = $entityManager;
|
||||
$this->scheduledTasksRepository = $scheduledTasksRepository;
|
||||
$this->segmentsRepository = $segmentsRepository;
|
||||
}
|
||||
|
||||
public function up() {
|
||||
$localizer = new Localizer();
|
||||
$localizer->forceLoadWebsiteLocaleText();
|
||||
|
||||
$this->populateNewsletterOptionFields();
|
||||
$this->populateNewsletterTemplates();
|
||||
|
||||
$this->createDefaultSegment();
|
||||
$this->createDefaultSettings();
|
||||
$this->createDefaultUsersFlags();
|
||||
$this->createMailPoetPage();
|
||||
$this->createSourceForSubscribers();
|
||||
$this->scheduleInitialInactiveSubscribersCheck();
|
||||
$this->scheduleAuthorizedSendingEmailsCheck();
|
||||
|
||||
$this->scheduleUnsubscribeTokens();
|
||||
$this->scheduleSubscriberLinkTokens();
|
||||
$this->detectReferral();
|
||||
$this->scheduleSubscriberLastEngagementDetection();
|
||||
$this->scheduleNewsletterTemplateThumbnails();
|
||||
$this->scheduleBackfillEngagementData();
|
||||
$this->scheduleMixpanel();
|
||||
}
|
||||
|
||||
private function createMailPoetPage() {
|
||||
$page = Pages::getMailPoetPage(Pages::PAGE_SUBSCRIPTIONS);
|
||||
if ($page === null) {
|
||||
$mailpoetPageId = Pages::createMailPoetPage(Pages::PAGE_SUBSCRIPTIONS);
|
||||
} else {
|
||||
$mailpoetPageId = (int)$page->ID;
|
||||
}
|
||||
|
||||
$subscription = $this->settings->get('subscription.pages', []);
|
||||
if (empty($subscription)) {
|
||||
$this->settings->set('subscription.pages', [
|
||||
'unsubscribe' => $mailpoetPageId,
|
||||
'manage' => $mailpoetPageId,
|
||||
'confirmation' => $mailpoetPageId,
|
||||
'confirm_unsubscribe' => $mailpoetPageId,
|
||||
]);
|
||||
} else {
|
||||
// For existing installations
|
||||
$confirmUnsubPageSetting = empty($subscription['confirm_unsubscribe'])
|
||||
? $mailpoetPageId : $subscription['confirm_unsubscribe'];
|
||||
|
||||
$this->settings->set('subscription.pages', array_merge($subscription, [
|
||||
'confirm_unsubscribe' => $confirmUnsubPageSetting,
|
||||
]));
|
||||
}
|
||||
|
||||
$captchaPage = Pages::getMailPoetPage(Pages::PAGE_CAPTCHA);
|
||||
if ($captchaPage === null) {
|
||||
$captchaPageId = Pages::createMailPoetPage(Pages::PAGE_CAPTCHA);
|
||||
} else {
|
||||
$captchaPageId = $captchaPage->ID;
|
||||
}
|
||||
|
||||
$this->settings->set('subscription.pages.captcha', $captchaPageId);
|
||||
}
|
||||
|
||||
private function createDefaultSettings() {
|
||||
$settingsDbVersion = $this->settings->get('db_version');
|
||||
$currentUser = $this->wp->wpGetCurrentUser();
|
||||
|
||||
// set cron trigger option to default method
|
||||
if (!$this->settings->get(CronTrigger::SETTING_NAME)) {
|
||||
$this->settings->set(CronTrigger::SETTING_NAME, [
|
||||
'method' => CronTrigger::DEFAULT_METHOD,
|
||||
]);
|
||||
}
|
||||
|
||||
// set default sender info based on current user
|
||||
$currentUserName = $currentUser->display_name ?: ''; // phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
|
||||
// parse current user name if an email is used
|
||||
$senderName = explode('@', $currentUserName);
|
||||
$senderName = reset($senderName);
|
||||
// If current user is not set, default to admin email
|
||||
$senderAddress = $currentUser->user_email ?: $this->wp->getOption('admin_email'); // phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
|
||||
$defaultSender = [
|
||||
'name' => $senderName,
|
||||
'address' => $senderAddress ?: '',
|
||||
];
|
||||
$savedSender = $this->settings->get('sender', []);
|
||||
|
||||
/**
|
||||
* Set default from name & address
|
||||
* In some cases ( like when the plugin is getting activated other than from WP Admin ) user data may not
|
||||
* still be set at this stage, so setting the defaults for `sender` is postponed
|
||||
*/
|
||||
if (empty($savedSender) || empty($savedSender['address'])) {
|
||||
$this->settings->set('sender', $defaultSender);
|
||||
}
|
||||
|
||||
// enable signup confirmation by default
|
||||
if (!$this->settings->get('signup_confirmation')) {
|
||||
$this->settings->set('signup_confirmation', [
|
||||
'enabled' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
// set installation date
|
||||
if (!$this->settings->get('installed_at')) {
|
||||
$this->settings->set('installed_at', date("Y-m-d H:i:s"));
|
||||
}
|
||||
|
||||
// set captcha settings
|
||||
$captcha = $this->settings->get('captcha');
|
||||
$reCaptcha = $this->settings->get('re_captcha');
|
||||
if (empty($captcha)) {
|
||||
$captchaType = CaptchaConstants::TYPE_DISABLED;
|
||||
if (!empty($reCaptcha['enabled'])) {
|
||||
$captchaType = CaptchaConstants::TYPE_RECAPTCHA;
|
||||
} elseif ($this->captchaRenderer->isSupported()) {
|
||||
$captchaType = CaptchaConstants::TYPE_BUILTIN;
|
||||
}
|
||||
$this->settings->set('captcha', [
|
||||
'type' => $captchaType,
|
||||
'recaptcha_site_token' => !empty($reCaptcha['site_token']) ? $reCaptcha['site_token'] : '',
|
||||
'recaptcha_secret_token' => !empty($reCaptcha['secret_token']) ? $reCaptcha['secret_token'] : '',
|
||||
]);
|
||||
}
|
||||
|
||||
$subscriberEmailNotification = $this->settings->get(NewSubscriberNotificationMailer::SETTINGS_KEY);
|
||||
if (empty($subscriberEmailNotification)) {
|
||||
$sender = $this->settings->get('sender', []);
|
||||
$this->settings->set('subscriber_email_notification', [
|
||||
'enabled' => true,
|
||||
'automated' => true,
|
||||
'address' => isset($sender['address']) ? $sender['address'] : null,
|
||||
]);
|
||||
}
|
||||
|
||||
$statsNotifications = $this->settings->get(Worker::SETTINGS_KEY);
|
||||
if (empty($statsNotifications)) {
|
||||
$sender = $this->settings->get('sender', []);
|
||||
$this->settings->set(Worker::SETTINGS_KEY, [
|
||||
'enabled' => true,
|
||||
'address' => isset($sender['address']) ? $sender['address'] : null,
|
||||
]);
|
||||
}
|
||||
|
||||
$woocommerceOptinOnCheckout = $this->settings->get('woocommerce.optin_on_checkout');
|
||||
$legacyLabelText = _x('Yes, I would like to be added to your mailing list', "default email opt-in message displayed on checkout page for ecommerce websites", 'mailpoet');
|
||||
$currentLabelText = _x('I would like to receive exclusive emails with discounts and product information', "default email opt-in message displayed on checkout page for ecommerce websites", 'mailpoet');
|
||||
if (empty($woocommerceOptinOnCheckout)) {
|
||||
$this->settings->set('woocommerce.optin_on_checkout', [
|
||||
'enabled' => empty($settingsDbVersion), // enable on new installs only
|
||||
'message' => $currentLabelText,
|
||||
'position' => Hooks::DEFAULT_OPTIN_POSITION,
|
||||
]);
|
||||
} elseif (isset($woocommerceOptinOnCheckout['message']) && $woocommerceOptinOnCheckout['message'] === $legacyLabelText) {
|
||||
$this->settings->set('woocommerce.optin_on_checkout.message', $currentLabelText);
|
||||
}
|
||||
// reset mailer log
|
||||
MailerLog::resetMailerLog();
|
||||
}
|
||||
|
||||
private function createDefaultUsersFlags() {
|
||||
$prefix = 'user_seen_editor_tutorial';
|
||||
$prefixLength = strlen($prefix);
|
||||
foreach ($this->settings->getAll() as $name => $value) {
|
||||
if (substr($name, 0, $prefixLength) === $prefix) {
|
||||
$userId = substr($name, $prefixLength);
|
||||
$this->createOrUpdateUserFlag($userId, 'editor_tutorial_seen', $value);
|
||||
$this->settings->delete($name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function createOrUpdateUserFlag($userId, $name, $value) {
|
||||
$userFlagsRepository = \MailPoet\DI\ContainerWrapper::getInstance(WP_DEBUG)->get(UserFlagsRepository::class);
|
||||
$flag = $userFlagsRepository->findOneBy([
|
||||
'userId' => $userId,
|
||||
'name' => $name,
|
||||
]);
|
||||
|
||||
if (!$flag) {
|
||||
$flag = new UserFlagEntity();
|
||||
$flag->setUserId($userId);
|
||||
$flag->setName($name);
|
||||
$userFlagsRepository->persist($flag);
|
||||
}
|
||||
$flag->setValue($value);
|
||||
$userFlagsRepository->flush();
|
||||
}
|
||||
|
||||
private function createDefaultSegment() {
|
||||
// WP Users segment
|
||||
$this->segmentsRepository->getWPUsersSegment();
|
||||
// WooCommerce customers segment
|
||||
$this->segmentsRepository->getWooCommerceSegment();
|
||||
|
||||
// Synchronize WP Users
|
||||
$this->wpSegment->synchronizeUsers();
|
||||
|
||||
// Default segment
|
||||
$defaultSegment = $this->segmentsRepository->findOneBy(
|
||||
['type' => 'default'],
|
||||
['id' => 'ASC']
|
||||
);
|
||||
|
||||
if (!$defaultSegment instanceof SegmentEntity) {
|
||||
$defaultSegment = new SegmentEntity(
|
||||
__('Newsletter mailing list', 'mailpoet'),
|
||||
SegmentEntity::TYPE_DEFAULT,
|
||||
__('This list is automatically created when you install MailPoet.', 'mailpoet')
|
||||
);
|
||||
$this->segmentsRepository->persist($defaultSegment);
|
||||
$this->segmentsRepository->flush();
|
||||
}
|
||||
|
||||
return $defaultSegment;
|
||||
}
|
||||
|
||||
private function populateNewsletterOptionFields() {
|
||||
$optionFields = [
|
||||
[
|
||||
'name' => 'isScheduled',
|
||||
'newsletter_type' => 'standard',
|
||||
],
|
||||
[
|
||||
'name' => 'scheduledAt',
|
||||
'newsletter_type' => 'standard',
|
||||
],
|
||||
[
|
||||
'name' => 'event',
|
||||
'newsletter_type' => 'welcome',
|
||||
],
|
||||
[
|
||||
'name' => 'segment',
|
||||
'newsletter_type' => 'welcome',
|
||||
],
|
||||
[
|
||||
'name' => 'role',
|
||||
'newsletter_type' => 'welcome',
|
||||
],
|
||||
[
|
||||
'name' => 'afterTimeNumber',
|
||||
'newsletter_type' => 'welcome',
|
||||
],
|
||||
[
|
||||
'name' => 'afterTimeType',
|
||||
'newsletter_type' => 'welcome',
|
||||
],
|
||||
[
|
||||
'name' => 'intervalType',
|
||||
'newsletter_type' => 'notification',
|
||||
],
|
||||
[
|
||||
'name' => 'timeOfDay',
|
||||
'newsletter_type' => 'notification',
|
||||
],
|
||||
[
|
||||
'name' => 'weekDay',
|
||||
'newsletter_type' => 'notification',
|
||||
],
|
||||
[
|
||||
'name' => 'monthDay',
|
||||
'newsletter_type' => 'notification',
|
||||
],
|
||||
[
|
||||
'name' => 'nthWeekDay',
|
||||
'newsletter_type' => 'notification',
|
||||
],
|
||||
[
|
||||
'name' => 'schedule',
|
||||
'newsletter_type' => 'notification',
|
||||
],
|
||||
[
|
||||
'name' => 'group',
|
||||
'newsletter_type' => NewsletterEntity::TYPE_AUTOMATIC,
|
||||
],
|
||||
[
|
||||
'name' => 'group',
|
||||
'newsletter_type' => NewsletterEntity::TYPE_AUTOMATION,
|
||||
],
|
||||
[
|
||||
'name' => 'group',
|
||||
'newsletter_type' => NewsletterEntity::TYPE_AUTOMATION_TRANSACTIONAL,
|
||||
],
|
||||
[
|
||||
'name' => 'event',
|
||||
'newsletter_type' => NewsletterEntity::TYPE_AUTOMATIC,
|
||||
],
|
||||
[
|
||||
'name' => 'event',
|
||||
'newsletter_type' => NewsletterEntity::TYPE_AUTOMATION,
|
||||
],
|
||||
[
|
||||
'name' => 'event',
|
||||
'newsletter_type' => NewsletterEntity::TYPE_AUTOMATION_TRANSACTIONAL,
|
||||
],
|
||||
[
|
||||
'name' => 'sendTo',
|
||||
'newsletter_type' => NewsletterEntity::TYPE_AUTOMATIC,
|
||||
],
|
||||
[
|
||||
'name' => 'segment',
|
||||
'newsletter_type' => NewsletterEntity::TYPE_AUTOMATIC,
|
||||
],
|
||||
[
|
||||
'name' => 'afterTimeNumber',
|
||||
'newsletter_type' => NewsletterEntity::TYPE_AUTOMATIC,
|
||||
],
|
||||
[
|
||||
'name' => 'afterTimeType',
|
||||
'newsletter_type' => NewsletterEntity::TYPE_AUTOMATIC,
|
||||
],
|
||||
[
|
||||
'name' => 'meta',
|
||||
'newsletter_type' => NewsletterEntity::TYPE_AUTOMATIC,
|
||||
],
|
||||
[
|
||||
'name' => 'afterTimeNumber',
|
||||
'newsletter_type' => NewsletterEntity::TYPE_RE_ENGAGEMENT,
|
||||
],
|
||||
[
|
||||
'name' => 'afterTimeType',
|
||||
'newsletter_type' => NewsletterEntity::TYPE_RE_ENGAGEMENT,
|
||||
],
|
||||
[
|
||||
'name' => 'automationId',
|
||||
'newsletter_type' => NewsletterEntity::TYPE_AUTOMATION,
|
||||
],
|
||||
[
|
||||
'name' => 'automationStepId',
|
||||
'newsletter_type' => NewsletterEntity::TYPE_AUTOMATION,
|
||||
],
|
||||
[
|
||||
'name' => NewsletterOptionFieldEntity::NAME_FILTER_SEGMENT_ID,
|
||||
'newsletter_type' => NewsletterEntity::TYPE_STANDARD,
|
||||
],
|
||||
[
|
||||
'name' => NewsletterOptionFieldEntity::NAME_FILTER_SEGMENT_ID,
|
||||
'newsletter_type' => NewsletterEntity::TYPE_RE_ENGAGEMENT,
|
||||
],
|
||||
[
|
||||
'name' => NewsletterOptionFieldEntity::NAME_FILTER_SEGMENT_ID,
|
||||
'newsletter_type' => NewsletterEntity::TYPE_NOTIFICATION,
|
||||
],
|
||||
];
|
||||
|
||||
// 1. Load all existing option fields from the database.
|
||||
$tableName = $this->entityManager->getClassMetadata(NewsletterOptionFieldEntity::class)->getTableName();
|
||||
$connection = $this->entityManager->getConnection();
|
||||
$existingOptionFields = $connection->createQueryBuilder()
|
||||
->select('f.name, f.newsletter_type')
|
||||
->from($tableName, 'f')
|
||||
->executeQuery()
|
||||
->fetchAllAssociative();
|
||||
|
||||
// 2. Insert new option fields using a single query (good for first installs).
|
||||
$inserts = array_udiff(
|
||||
$optionFields,
|
||||
$existingOptionFields,
|
||||
fn($a, $b) => [$a['name'], $a['newsletter_type']] <=> [$b['name'], $b['newsletter_type']]
|
||||
);
|
||||
if ($inserts) {
|
||||
$placeholders = implode(',', array_fill(0, count($inserts), '(?, ?)'));
|
||||
$connection->executeStatement(
|
||||
"INSERT INTO $tableName (name, newsletter_type) VALUES $placeholders",
|
||||
array_merge(
|
||||
...array_map(
|
||||
fn($of) => [$of['name'], $of['newsletter_type']],
|
||||
$inserts
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
private function populateNewsletterTemplates(): void {
|
||||
// 1. Load templates from the file system.
|
||||
$templates = [];
|
||||
foreach ($this->templates as $template) {
|
||||
$template = self::TEMPLATES_NAMESPACE . $template;
|
||||
$template = new $template(Env::$assetsUrl);
|
||||
$templates[] = $template->get();
|
||||
}
|
||||
|
||||
// 2. Load existing corresponding (readonly) templates from the database.
|
||||
$tableName = $this->entityManager->getClassMetadata(NewsletterTemplateEntity::class)->getTableName();
|
||||
$connection = $this->entityManager->getConnection();
|
||||
$existingTemplates = $connection->createQueryBuilder()
|
||||
->select('t.name, t.categories, t.readonly, t.thumbnail, t.body')
|
||||
->from($tableName, 't')
|
||||
->where('t.readonly = 1')
|
||||
->executeQuery()
|
||||
->fetchAllAssociativeIndexed();
|
||||
|
||||
// 3. Compare the existing and file system templates.
|
||||
$inserts = [];
|
||||
$updates = [];
|
||||
foreach ($templates as $template) {
|
||||
$existing = $existingTemplates[$template['name']] ?? null;
|
||||
if (
|
||||
$existing
|
||||
&& $existing['categories'] === $template['categories']
|
||||
&& $existing['body'] === $template['body']
|
||||
&& $existing['thumbnail'] === $template['thumbnail']
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($existing) {
|
||||
$updates[] = $template;
|
||||
} else {
|
||||
$inserts[] = $template;
|
||||
}
|
||||
}
|
||||
|
||||
// 4. Update existing templates.
|
||||
foreach ($updates as $template) {
|
||||
$connection->update($tableName, $template, ['name' => $template['name']]);
|
||||
}
|
||||
|
||||
// 5. Insert new templates using a single query (good for first installs).
|
||||
if ($inserts) {
|
||||
$placeholders = implode(',', array_fill(0, count($inserts), '(?, ?, ?, ?, ?)'));
|
||||
$connection->executeStatement(
|
||||
"INSERT INTO $tableName (name, categories, readonly, thumbnail, body) VALUES $placeholders",
|
||||
array_merge(
|
||||
...array_map(
|
||||
fn($t) => [$t['name'], $t['categories'], $t['readonly'], $t['thumbnail'], $t['body']],
|
||||
$inserts
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// 6. Remove duplicates.
|
||||
// SQLite doesn't support JOIN in DELETE queries, we need to use a subquery.
|
||||
// MySQL doesn't support DELETE with subqueries reading from the same table.
|
||||
if (Connection::isSQLite()) {
|
||||
$connection->executeStatement("
|
||||
DELETE FROM $tableName WHERE id IN (
|
||||
SELECT t1.id
|
||||
FROM $tableName t1
|
||||
JOIN $tableName t2 ON t1.id < t2.id AND t1.name = t2.name
|
||||
WHERE t1.readonly = 1
|
||||
AND t2.readonly = 1
|
||||
)
|
||||
");
|
||||
} else {
|
||||
$connection->executeStatement("
|
||||
DELETE t1
|
||||
FROM $tableName t1, $tableName t2
|
||||
WHERE t1.id < t2.id AND t1.name = t2.name
|
||||
AND t1.readonly = 1
|
||||
AND t2.readonly = 1
|
||||
");
|
||||
}
|
||||
}
|
||||
|
||||
private function createSourceForSubscribers() {
|
||||
$statisticsFormTable = $this->entityManager->getClassMetadata(StatisticsFormEntity::class)->getTableName();
|
||||
$subscriberTable = $this->entityManager->getClassMetadata(SubscriberEntity::class)->getTableName();
|
||||
|
||||
// Temporarily skip the queries in WP Playground.
|
||||
// UPDATE with JOIN is not yet supported by the SQLite integration.
|
||||
if (Connection::isSQLite()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->entityManager->getConnection()->executeStatement(
|
||||
' UPDATE LOW_PRIORITY `' . $subscriberTable . '` subscriber ' .
|
||||
' JOIN `' . $statisticsFormTable . '` stats ON stats.subscriber_id=subscriber.id ' .
|
||||
" SET `source` = '" . Source::FORM . "'" .
|
||||
" WHERE `source` = '" . Source::UNKNOWN . "'"
|
||||
);
|
||||
|
||||
$this->entityManager->getConnection()->executeStatement(
|
||||
'UPDATE LOW_PRIORITY `' . $subscriberTable . '`' .
|
||||
" SET `source` = '" . Source::WORDPRESS_USER . "'" .
|
||||
" WHERE `source` = '" . Source::UNKNOWN . "'" .
|
||||
' AND `wp_user_id` IS NOT NULL'
|
||||
);
|
||||
|
||||
$this->entityManager->getConnection()->executeStatement(
|
||||
'UPDATE LOW_PRIORITY `' . $subscriberTable . '`' .
|
||||
" SET `source` = '" . Source::WOOCOMMERCE_USER . "'" .
|
||||
" WHERE `source` = '" . Source::UNKNOWN . "'" .
|
||||
' AND `is_woocommerce_user` = 1'
|
||||
);
|
||||
}
|
||||
|
||||
private function scheduleInitialInactiveSubscribersCheck() {
|
||||
$this->scheduleTask(
|
||||
InactiveSubscribers::TASK_TYPE,
|
||||
Carbon::now()->millisecond(0)->addHour()
|
||||
);
|
||||
}
|
||||
|
||||
private function scheduleAuthorizedSendingEmailsCheck() {
|
||||
if (!Bridge::isMPSendingServiceEnabled()) {
|
||||
return;
|
||||
}
|
||||
$this->scheduleTask(
|
||||
AuthorizedSendingEmailsCheck::TASK_TYPE,
|
||||
Carbon::now()->millisecond(0)
|
||||
);
|
||||
}
|
||||
|
||||
private function scheduleUnsubscribeTokens() {
|
||||
$this->scheduleTask(
|
||||
UnsubscribeTokens::TASK_TYPE,
|
||||
Carbon::now()->millisecond(0)
|
||||
);
|
||||
}
|
||||
|
||||
private function scheduleSubscriberLinkTokens() {
|
||||
$this->scheduleTask(
|
||||
SubscriberLinkTokens::TASK_TYPE,
|
||||
Carbon::now()->millisecond(0)
|
||||
);
|
||||
}
|
||||
|
||||
private function scheduleMixpanel() {
|
||||
$this->scheduleTask(Mixpanel::TASK_TYPE, Carbon::now()->millisecond(0));
|
||||
}
|
||||
|
||||
private function scheduleTask($type, $datetime, $priority = null) {
|
||||
$task = $this->scheduledTasksRepository->findOneBy(
|
||||
[
|
||||
'type' => $type,
|
||||
'status' => [ScheduledTaskEntity::STATUS_SCHEDULED, null],
|
||||
]
|
||||
);
|
||||
|
||||
if ($task) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$task = new ScheduledTaskEntity();
|
||||
$task->setType($type);
|
||||
$task->setStatus(ScheduledTaskEntity::STATUS_SCHEDULED);
|
||||
$task->setScheduledAt($datetime);
|
||||
|
||||
if ($priority !== null) {
|
||||
$task->setPriority($priority);
|
||||
}
|
||||
|
||||
$this->scheduledTasksRepository->persist($task);
|
||||
$this->scheduledTasksRepository->flush();
|
||||
}
|
||||
|
||||
private function detectReferral() {
|
||||
$this->referralDetector->detect();
|
||||
}
|
||||
|
||||
private function scheduleSubscriberLastEngagementDetection() {
|
||||
if (version_compare((string)$this->settings->get('db_version', '3.72.1'), '3.72.0', '>')) {
|
||||
return;
|
||||
}
|
||||
$this->scheduleTask(
|
||||
SubscribersLastEngagement::TASK_TYPE,
|
||||
Carbon::now()->millisecond(0)
|
||||
);
|
||||
}
|
||||
|
||||
private function scheduleNewsletterTemplateThumbnails() {
|
||||
$this->scheduleTask(
|
||||
NewsletterTemplateThumbnails::TASK_TYPE,
|
||||
Carbon::now()->millisecond(0),
|
||||
ScheduledTaskEntity::PRIORITY_LOW
|
||||
);
|
||||
}
|
||||
|
||||
private function scheduleBackfillEngagementData(): void {
|
||||
$existingTask = $this->scheduledTasksRepository->findOneBy(
|
||||
[
|
||||
'type' => BackfillEngagementData::TASK_TYPE,
|
||||
]
|
||||
);
|
||||
if ($existingTask) {
|
||||
return;
|
||||
}
|
||||
$this->scheduleTask(
|
||||
BackfillEngagementData::TASK_TYPE,
|
||||
Carbon::now()->millisecond(0)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,419 @@
|
||||
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
|
||||
|
||||
namespace MailPoet\Config\PopulatorData\Templates;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
class AppWelcome {
|
||||
|
||||
private $template_image_url;
|
||||
private $social_icon_url;
|
||||
|
||||
public function __construct(
|
||||
$assets_url
|
||||
) {
|
||||
$this->template_image_url = 'https://ps.w.org/mailpoet/assets/newsletter-templates/app_welcome';
|
||||
$this->social_icon_url = $assets_url . '/img/newsletter_editor/social-icons';
|
||||
}
|
||||
|
||||
public function get() {
|
||||
return [
|
||||
'name' => __("App Welcome", 'mailpoet'),
|
||||
'categories' => json_encode(['welcome', 'all']),
|
||||
'readonly' => 1,
|
||||
'thumbnail' => $this->getThumbnail(),
|
||||
'body' => json_encode($this->getBody()),
|
||||
];
|
||||
}
|
||||
|
||||
private function getBody() {
|
||||
return [
|
||||
'content' => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#eeeeee',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#eeeeee',
|
||||
'height' => '30px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#32b6c6',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '40px',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/App-Signup-Logo-1.png',
|
||||
'alt' => 'App-Signup-Logo',
|
||||
'fullWidth' => false,
|
||||
'width' => '80px',
|
||||
'height' => '80px',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => '<h1 style="text-align: center; margin: 0;"><strong>Welcome to Appy</strong></h1><p style="text-align: center; margin: 0;"><span style="color: #ffffff;">Let\'s get started!</span></p>',
|
||||
],
|
||||
|
||||
[
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/App-Signup-Header.png',
|
||||
'alt' => 'App-Signup-Header',
|
||||
'fullWidth' => false,
|
||||
'width' => '1280px',
|
||||
'height' => '500px',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#ffffff',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '40px',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => '<p style="text-align: center;">Hi [subscriber:firstname | default:subscriber],</p>
|
||||
<p style="text-align: center;"></p>
|
||||
<p style="text-align: center;">In MailPoet, you can write emails in plain text, just like in a regular email. This can make your email newsletters more personal and attention-grabbing.</p>
|
||||
<p style="text-align: center;"></p>
|
||||
<p style="text-align: center;">Is this too simple? You can still style your text with basic formatting, like <strong>bold</strong> or <em>italics.</em></p>
|
||||
<p style="text-align: center;"></p>
|
||||
<p style="text-align: center;">Finally, you can also add a call-to-action button between 2 blocks of text, like this:</p>',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#ffffff',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '23px',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'button',
|
||||
'text' => 'Get Started Here',
|
||||
'url' => '',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#32b6c6',
|
||||
'borderColor' => '#32b6c6',
|
||||
'borderWidth' => '0px',
|
||||
'borderRadius' => '40px',
|
||||
'borderStyle' => 'solid',
|
||||
'width' => '188px',
|
||||
'lineHeight' => '50px',
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '18px',
|
||||
'fontWeight' => 'normal',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '35px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/App-Signup-Team.jpg',
|
||||
'alt' => 'App-Signup-Team',
|
||||
'fullWidth' => true,
|
||||
'width' => '1280px',
|
||||
'height' => '700px',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#eeeeee',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '30px',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/App-Signup-Logo-Footer.png',
|
||||
'alt' => 'App-Signup-Logo-Footer',
|
||||
'fullWidth' => false,
|
||||
'width' => '50px',
|
||||
'height' => '50px',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => '<p style="text-align: center; font-size: 12px;"><strong>Appy</strong></p>
|
||||
<p style="text-align: center; font-size: 12px;"><span>Address Line 1</span></p>
|
||||
<p style="text-align: center; font-size: 12px;"><span>Address Line 2</span></p>
|
||||
<p style="text-align: center; font-size: 12px;"><span>City</span></p>
|
||||
<p style="text-align: center; font-size: 12px;"><a href="[link:subscription_unsubscribe_url]">' . __("Unsubscribe", 'mailpoet') . '</a><span> | </span><a href="[link:subscription_manage_url]">' . __("Manage your subscription", 'mailpoet') . '</a></p>',
|
||||
],
|
||||
[
|
||||
'type' => 'social',
|
||||
'iconSet' => 'full-symbol-color',
|
||||
'icons' => [
|
||||
[
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'facebook',
|
||||
'link' => 'http://www.facebook.com',
|
||||
'image' => $this->social_icon_url . '/06-full-symbol-color/Facebook.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Facebook',
|
||||
],
|
||||
[
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'twitter',
|
||||
'link' => 'http://www.twitter.com',
|
||||
'image' => $this->social_icon_url . '/06-full-symbol-color/Twitter.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Twitter',
|
||||
],
|
||||
[
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'youtube',
|
||||
'link' => 'http://www.youtube.com',
|
||||
'image' => $this->social_icon_url . '/06-full-symbol-color/Youtube.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Youtube',
|
||||
],
|
||||
[
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'instagram',
|
||||
'link' => 'http://instagram.com',
|
||||
'image' => $this->social_icon_url . '/06-full-symbol-color/Instagram.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Instagram',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '40px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
'globalStyles' => [
|
||||
'text' => [
|
||||
'fontColor' => '#404040',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '15px',
|
||||
],
|
||||
'h1' => [
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '26px',
|
||||
],
|
||||
'h2' => [
|
||||
'fontColor' => '#404040',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '22px',
|
||||
],
|
||||
'h3' => [
|
||||
'fontColor' => '#32b6c6',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '18px',
|
||||
],
|
||||
'link' => [
|
||||
'fontColor' => '#32b6c6',
|
||||
'textDecoration' => 'underline',
|
||||
],
|
||||
'wrapper' => [
|
||||
'backgroundColor' => '#ffffff',
|
||||
],
|
||||
'body' => [
|
||||
'backgroundColor' => '#eeeeee',
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
private function getThumbnail() {
|
||||
return $this->template_image_url . '/thumbnail.20190411-1500.jpg';
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+1191
File diff suppressed because it is too large
Load Diff
+2099
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+231
@@ -0,0 +1,231 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace MailPoet\Config\PopulatorData\Templates;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
class ConfirmInterestBeforeDeactivation {
|
||||
private $assets_url;
|
||||
private $external_template_image_url;
|
||||
private $template_image_url;
|
||||
|
||||
public function __construct(
|
||||
$assets_url
|
||||
) {
|
||||
$this->assets_url = $assets_url;
|
||||
$this->external_template_image_url = 'https://ps.w.org/mailpoet/assets/newsletter-templates/confirm-interest-before-deactivation';
|
||||
$this->template_image_url = $this->assets_url . '/img/blank_templates';
|
||||
}
|
||||
|
||||
public function get(): array {
|
||||
return [
|
||||
'name' => __('Confirm interest before deactivation', 'mailpoet'),
|
||||
'categories' => json_encode(['re_engagement', 'all']),
|
||||
'readonly' => 1,
|
||||
'thumbnail' => $this->getThumbnail(),
|
||||
'body' => json_encode($this->getBody()),
|
||||
];
|
||||
}
|
||||
|
||||
private function getBody(): array {
|
||||
return [
|
||||
'content' => [
|
||||
'type' => 'container',
|
||||
'columnLayout' => false,
|
||||
'orientation' => 'vertical',
|
||||
'image' => [
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'container',
|
||||
'columnLayout' => false,
|
||||
'orientation' => 'horizontal',
|
||||
'image' => [
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#ffffff',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'container',
|
||||
'columnLayout' => false,
|
||||
'orientation' => 'vertical',
|
||||
'image' => [
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '30px',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/fake-logo.png',
|
||||
'alt' => __('Fake logo', 'mailpoet'),
|
||||
'fullWidth' => false,
|
||||
'width' => '598px',
|
||||
'height' => '71px',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => __('<p style="text-align: left;">Hi [subscriber:firstname | default:there],</p><p style="text-align: left;"></p>
|
||||
<p style="text-align: left;"><span>You have subscribed to receive email updates from us, but as we\'re not sure if you\'re reading our emails, we\'d like to ask - <strong>are you still interested in hearing from us?</strong> If yes, please reconfirm your subscription by clicking the button below:</span></p>', 'mailpoet'),
|
||||
],
|
||||
[
|
||||
'type' => 'button',
|
||||
'text' => __('Yes, keep me subscribed!', 'mailpoet'),
|
||||
'url' => '[link:subscription_re_engage_url]',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#2ea1cd',
|
||||
'borderColor' => '#0074a2',
|
||||
'borderWidth' => '1px',
|
||||
'borderRadius' => '5px',
|
||||
'borderStyle' => 'solid',
|
||||
'width' => '288px',
|
||||
'lineHeight' => '40px',
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Verdana',
|
||||
'fontSize' => '16px',
|
||||
'fontWeight' => 'normal',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => '<p><span class="prismjs css-1xfvm4v" data-code-lang="" data-ds--code--code-block="">' . __("If you're no longer interested, that's completely fine. You don't need to take any action. Our system will automatically unsubscribe you soon from all of our future content.", 'mailpoet') . '</span></p>',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'container',
|
||||
'columnLayout' => false,
|
||||
'orientation' => 'horizontal',
|
||||
'image' => [
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#ffffff',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'container',
|
||||
'columnLayout' => false,
|
||||
'orientation' => 'vertical',
|
||||
'image' => [
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => '<p><strong><em></em></strong></p><p><strong><em>' . __('The MailPoet Team', 'mailpoet') . '</em></strong></p>',
|
||||
],
|
||||
[
|
||||
'type' => 'footer',
|
||||
'text' => '<p><a href="[link:subscription_unsubscribe_url]">' . __('Unsubscribe', 'mailpoet') . '</a> | <a href="[link:subscription_manage_url]">' . __('Manage subscription', 'mailpoet') . '</a><br />' . __('Add your postal address here!', 'mailpoet') . '</p>',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
'text' => [
|
||||
'fontColor' => '#222222',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '12px',
|
||||
'textAlign' => 'left',
|
||||
],
|
||||
'link' => [
|
||||
'fontColor' => '#6cb7d4',
|
||||
'textDecoration' => 'none',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
'globalStyles' => [
|
||||
'text' => [
|
||||
'fontColor' => '#000000',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '15px',
|
||||
'lineHeight' => '1.6',
|
||||
],
|
||||
'h1' => [
|
||||
'fontColor' => '#111111',
|
||||
'fontFamily' => 'Trebuchet MS',
|
||||
'fontSize' => '30px',
|
||||
'lineHeight' => '1.6',
|
||||
],
|
||||
'h2' => [
|
||||
'fontColor' => '#222222',
|
||||
'fontFamily' => 'Trebuchet MS',
|
||||
'fontSize' => '24px',
|
||||
'lineHeight' => '1.6',
|
||||
],
|
||||
'h3' => [
|
||||
'fontColor' => '#333333',
|
||||
'fontFamily' => 'Trebuchet MS',
|
||||
'fontSize' => '22px',
|
||||
'lineHeight' => '1.6',
|
||||
],
|
||||
'link' => [
|
||||
'fontColor' => '#21759B',
|
||||
'textDecoration' => 'underline',
|
||||
],
|
||||
'wrapper' => [
|
||||
'backgroundColor' => '#ffffff',
|
||||
],
|
||||
'body' => [
|
||||
'backgroundColor' => '#ffffff',
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
private function getThumbnail(): string {
|
||||
return $this->external_template_image_url . '/thumbnail.20211026.jpg';
|
||||
}
|
||||
}
|
||||
+230
@@ -0,0 +1,230 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace MailPoet\Config\PopulatorData\Templates;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
class ConfirmInterestOrUnsubscribe {
|
||||
private $assets_url;
|
||||
private $external_template_image_url;
|
||||
private $template_image_url;
|
||||
|
||||
public function __construct(
|
||||
$assets_url
|
||||
) {
|
||||
$this->assets_url = $assets_url;
|
||||
$this->external_template_image_url = 'https://ps.w.org/mailpoet/assets/newsletter-templates/confirm-interest-or-unsubscribe';
|
||||
$this->template_image_url = $this->assets_url . '/img/blank_templates';
|
||||
}
|
||||
|
||||
public function get(): array {
|
||||
return [
|
||||
'name' => __('Confirm your interest or unsubscribe', 'mailpoet'),
|
||||
'categories' => json_encode(['re_engagement', 'all']),
|
||||
'readonly' => 1,
|
||||
'thumbnail' => $this->getThumbnail(),
|
||||
'body' => json_encode($this->getBody()),
|
||||
];
|
||||
}
|
||||
|
||||
private function getBody(): array {
|
||||
return [
|
||||
'content' => [
|
||||
'type' => 'container',
|
||||
'columnLayout' => false,
|
||||
'orientation' => 'vertical',
|
||||
'image' => [
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'container',
|
||||
'columnLayout' => false,
|
||||
'orientation' => 'horizontal',
|
||||
'image' => [
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#ffffff',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'container',
|
||||
'columnLayout' => false,
|
||||
'orientation' => 'vertical',
|
||||
'image' => [
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '30px',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/fake-logo.png',
|
||||
'alt' => __('Fake logo', 'mailpoet'),
|
||||
'fullWidth' => false,
|
||||
'width' => '598px',
|
||||
'height' => '71px',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => __('<p style="text-align: left;">Hi [subscriber:firstname | default:there],</p><p style="text-align: left;"></p>
|
||||
<p style="text-align: left;"><span>It\'s been a while since you opened our emails. If you have changed your mind since you subscribed and are no longer interested, we get it! We won\'t make it hard for you, so feel free to unsubscribe right away. </span></p><p style="text-align: left;"></p>
|
||||
<p style="text-align: left;"><a href="[link:subscription_unsubscribe_url]">Unsubscribe me!</a></p><p style="text-align: left;"></p>
|
||||
<p style="text-align: left;">(When you unsubscribe, you\'ll stop receiving all future emails from us.)</p><p style="text-align: left;"></p>
|
||||
<p style="text-align: left;"><span>On the other hand, if you like our emails and want to keep receiving them, please <strong>reconfirm your subscription by clicking the big button below</strong>.</span></p>', 'mailpoet'),
|
||||
],
|
||||
[
|
||||
'type' => 'button',
|
||||
'text' => __('Yes, keep me subscribed!', 'mailpoet'),
|
||||
'url' => '[link:subscription_re_engage_url]',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#2ea1cd',
|
||||
'borderColor' => '#0074a2',
|
||||
'borderWidth' => '1px',
|
||||
'borderRadius' => '5px',
|
||||
'borderStyle' => 'solid',
|
||||
'width' => '288px',
|
||||
'lineHeight' => '40px',
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Verdana',
|
||||
'fontSize' => '16px',
|
||||
'fontWeight' => 'normal',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'container',
|
||||
'columnLayout' => false,
|
||||
'orientation' => 'horizontal',
|
||||
'image' => [
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#ffffff',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'container',
|
||||
'columnLayout' => false,
|
||||
'orientation' => 'vertical',
|
||||
'image' => [
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => '<p><strong><em></em></strong></p><p><strong><em>' . __('The MailPoet Team', 'mailpoet') . '</em></strong></p>',
|
||||
],
|
||||
[
|
||||
'type' => 'footer',
|
||||
'text' => '<p><a href="[link:subscription_unsubscribe_url]">' . __('Unsubscribe', 'mailpoet') . '</a> | <a href="[link:subscription_manage_url]">' . __('Manage your subscription', 'mailpoet') . '</a><br />' . __('Add your postal address here!', 'mailpoet') . '</p>',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
'text' => [
|
||||
'fontColor' => '#222222',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '12px',
|
||||
'textAlign' => 'left',
|
||||
],
|
||||
'link' => [
|
||||
'fontColor' => '#6cb7d4',
|
||||
'textDecoration' => 'none',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
'globalStyles' => [
|
||||
'text' => [
|
||||
'fontColor' => '#000000',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '15px',
|
||||
'lineHeight' => '1.6',
|
||||
],
|
||||
'h1' => [
|
||||
'fontColor' => '#111111',
|
||||
'fontFamily' => 'Trebuchet MS',
|
||||
'fontSize' => '30px',
|
||||
'lineHeight' => '1.6',
|
||||
],
|
||||
'h2' => [
|
||||
'fontColor' => '#222222',
|
||||
'fontFamily' => 'Trebuchet MS',
|
||||
'fontSize' => '24px',
|
||||
'lineHeight' => '1.6',
|
||||
],
|
||||
'h3' => [
|
||||
'fontColor' => '#333333',
|
||||
'fontFamily' => 'Trebuchet MS',
|
||||
'fontSize' => '22px',
|
||||
'lineHeight' => '1.6',
|
||||
],
|
||||
'link' => [
|
||||
'fontColor' => '#21759B',
|
||||
'textDecoration' => 'underline',
|
||||
],
|
||||
'wrapper' => [
|
||||
'backgroundColor' => '#ffffff',
|
||||
],
|
||||
'body' => [
|
||||
'backgroundColor' => '#ffffff',
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
private function getThumbnail(): string {
|
||||
return $this->external_template_image_url . '/thumbnail.20211026.jpg';
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,492 @@
|
||||
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
|
||||
|
||||
namespace MailPoet\Config\PopulatorData\Templates;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
class Faith {
|
||||
|
||||
private $template_image_url;
|
||||
private $social_icon_url;
|
||||
|
||||
public function __construct(
|
||||
$assets_url
|
||||
) {
|
||||
$this->template_image_url = 'https://ps.w.org/mailpoet/assets/newsletter-templates/faith';
|
||||
$this->social_icon_url = $assets_url . '/img/newsletter_editor/social-icons';
|
||||
}
|
||||
|
||||
public function get() {
|
||||
return [
|
||||
'name' => __("Faith", 'mailpoet'),
|
||||
'categories' => json_encode(['standard', 'all']),
|
||||
'readonly' => 1,
|
||||
'thumbnail' => $this->getThumbnail(),
|
||||
'body' => json_encode($this->getBody()),
|
||||
];
|
||||
}
|
||||
|
||||
private function getBody() {
|
||||
return [
|
||||
'content' => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/church-header.jpg',
|
||||
'alt' => 'church-header',
|
||||
'fullWidth' => true,
|
||||
'width' => '1036px',
|
||||
'height' => '563px',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
2 => [
|
||||
'type' => 'text',
|
||||
'text' => '<h1 style="text-align: center;">Spreading Love & Hope...</h1><p>Duis id molestie ex. Quisque finibus magna in justo tristique pellentesque. Nulla sed leo facilisis arcu malesuada molestie vel quis dolor. Donec imperdiet condimentum odio ut elementum. Aenean nisl massa, rutrum a ullamcorper eget, molestie non erat. </p>',
|
||||
],
|
||||
3 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#f3f4f4',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'text',
|
||||
'text' => '<h2 style="text-align: left;">Family Faith Events</h2>',
|
||||
],
|
||||
2 => [
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/family.jpg',
|
||||
'alt' => 'family',
|
||||
'fullWidth' => false,
|
||||
'width' => '660px',
|
||||
'height' => '880px',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
3 => [
|
||||
'type' => 'text',
|
||||
'text' => '<p>In maximus tempus pellentesque. Nunc scelerisque ante odio, vel placerat dui fermentum efficitur. Integer vitae ex suscipit, aliquet eros vitae, ornare est. <a href="http://www.example.com">Aenean vel dapibus nisi</a>.</p>',
|
||||
],
|
||||
4 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'text',
|
||||
'text' => '<h2>Thoughts & Prayers</h2>',
|
||||
],
|
||||
2 => [
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/pray.jpg',
|
||||
'alt' => 'pray',
|
||||
'fullWidth' => false,
|
||||
'width' => '660px',
|
||||
'height' => '880px',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
3 => [
|
||||
'type' => 'text',
|
||||
'text' => '<p>Donec sed vulputate ipsum. In scelerisque rutrum interdum. Donec imperdiet dignissim erat, in dictum lectus accumsan ut. <a href="http://www.example.com">Aliquam erat volutpat.</a></p>',
|
||||
],
|
||||
4 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
2 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'text',
|
||||
'text' => '<h1 style="text-align: center;">Latest News</h1>',
|
||||
],
|
||||
2 => [
|
||||
'type' => 'divider',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'padding' => '7px',
|
||||
'borderStyle' => 'dotted',
|
||||
'borderWidth' => '1px',
|
||||
'borderColor' => '#dcdcdc',
|
||||
],
|
||||
],
|
||||
],
|
||||
3 => [
|
||||
'type' => 'automatedLatestContent',
|
||||
'amount' => '3',
|
||||
'contentType' => 'post',
|
||||
'terms' => [],
|
||||
'inclusionType' => 'include',
|
||||
'displayType' => 'excerpt',
|
||||
'titleFormat' => 'h3',
|
||||
'titleAlignment' => 'left',
|
||||
'titleIsLink' => false,
|
||||
'imageFullWidth' => false,
|
||||
'featuredImagePosition' => 'belowTitle',
|
||||
'showAuthor' => 'no',
|
||||
'authorPrecededBy' => 'Author:',
|
||||
'showCategories' => 'no',
|
||||
'categoriesPrecededBy' => 'Categories:',
|
||||
'readMoreType' => 'button',
|
||||
'readMoreText' => 'Read more',
|
||||
'readMoreButton' => [
|
||||
'type' => 'button',
|
||||
'text' => 'Read more',
|
||||
'url' => '[postLink]',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#dfeaf3',
|
||||
'borderColor' => '#00ddff',
|
||||
'borderWidth' => '0px',
|
||||
'borderRadius' => '5px',
|
||||
'borderStyle' => 'solid',
|
||||
'width' => '160px',
|
||||
'lineHeight' => '45px',
|
||||
'fontColor' => '#597890',
|
||||
'fontFamily' => 'Tahoma',
|
||||
'fontSize' => '16px',
|
||||
'fontWeight' => 'normal',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
'sortBy' => 'newest',
|
||||
'showDivider' => true,
|
||||
'divider' => [
|
||||
'type' => 'divider',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'padding' => '13px',
|
||||
'borderStyle' => 'dotted',
|
||||
'borderWidth' => '2px',
|
||||
'borderColor' => '#dfeaf3',
|
||||
],
|
||||
],
|
||||
],
|
||||
'backgroundColor' => '#ffffff',
|
||||
'backgroundColorAlternate' => '#eeeeee',
|
||||
],
|
||||
4 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
5 => [
|
||||
'type' => 'divider',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#e7eff6',
|
||||
'padding' => '13px',
|
||||
'borderStyle' => 'ridge',
|
||||
'borderWidth' => '6px',
|
||||
'borderColor' => '#597890',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
3 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#e7eff6',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'footer',
|
||||
'text' => '<a href="[link:subscription_unsubscribe_url]">' . __("Unsubscribe", 'mailpoet') . '</a> | <a href="[link:subscription_manage_url]">' . __("Manage your subscription", 'mailpoet') . '</a><br /><b>' . __("Add your postal address here!", 'mailpoet') . '</b>',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#e7eff6',
|
||||
],
|
||||
'text' => [
|
||||
'fontColor' => '#787878',
|
||||
'fontFamily' => 'Tahoma',
|
||||
'fontSize' => '14px',
|
||||
'textAlign' => 'left',
|
||||
],
|
||||
'link' => [
|
||||
'fontColor' => '#787878',
|
||||
'textDecoration' => 'none',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'text',
|
||||
'text' => '<p style="text-align: center;">Find us socially:</p>',
|
||||
],
|
||||
1 => [
|
||||
'type' => 'social',
|
||||
'iconSet' => 'full-symbol-black',
|
||||
'icons' => [
|
||||
0 => [
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'facebook',
|
||||
'link' => 'http://www.facebook.com',
|
||||
'image' => $this->social_icon_url . '/07-full-symbol-black/Facebook.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Facebook',
|
||||
],
|
||||
1 => [
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'twitter',
|
||||
'link' => 'http://www.twitter.com',
|
||||
'image' => $this->social_icon_url . '/07-full-symbol-black/Twitter.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Twitter',
|
||||
],
|
||||
2 => [
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'email',
|
||||
'link' => '',
|
||||
'image' => $this->social_icon_url . '/07-full-symbol-black/Email.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Email',
|
||||
],
|
||||
3 => [
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'website',
|
||||
'link' => '',
|
||||
'image' => $this->social_icon_url . '/07-full-symbol-black/Website.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Website',
|
||||
],
|
||||
],
|
||||
],
|
||||
2 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
'globalStyles' => [
|
||||
'text' => [
|
||||
'fontColor' => '#787878',
|
||||
'fontFamily' => 'Tahoma',
|
||||
'fontSize' => '16px',
|
||||
],
|
||||
'h1' => [
|
||||
'fontColor' => '#597890',
|
||||
'fontFamily' => 'Comic Sans MS',
|
||||
'fontSize' => '26px',
|
||||
],
|
||||
'h2' => [
|
||||
'fontColor' => '#597890',
|
||||
'fontFamily' => 'Comic Sans MS',
|
||||
'fontSize' => '18px',
|
||||
],
|
||||
'h3' => [
|
||||
'fontColor' => '#787878',
|
||||
'fontFamily' => 'Tahoma',
|
||||
'fontSize' => '18px',
|
||||
],
|
||||
'link' => [
|
||||
'fontColor' => '#597890',
|
||||
'textDecoration' => 'underline',
|
||||
],
|
||||
'wrapper' => [
|
||||
'backgroundColor' => '#ffffff',
|
||||
],
|
||||
'body' => [
|
||||
'backgroundColor' => '#e7eff6',
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
private function getThumbnail() {
|
||||
return $this->template_image_url . '/thumbnail.20190411-1500.jpg';
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,528 @@
|
||||
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
|
||||
|
||||
namespace MailPoet\Config\PopulatorData\Templates;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
class FestivalEvent {
|
||||
|
||||
private $template_image_url;
|
||||
private $social_icon_url;
|
||||
|
||||
public function __construct(
|
||||
$assets_url
|
||||
) {
|
||||
$this->template_image_url = 'https://ps.w.org/mailpoet/assets/newsletter-templates/festival_event';
|
||||
$this->social_icon_url = $assets_url . '/img/newsletter_editor/social-icons';
|
||||
}
|
||||
|
||||
public function get() {
|
||||
return [
|
||||
'name' => __("Festival Event", 'mailpoet'),
|
||||
'categories' => json_encode(['standard', 'all']),
|
||||
'readonly' => 1,
|
||||
'thumbnail' => $this->getThumbnail(),
|
||||
'body' => json_encode($this->getBody()),
|
||||
];
|
||||
}
|
||||
|
||||
private function getBody() {
|
||||
return [
|
||||
'content' => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#0a5388',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/festival-header.jpg',
|
||||
'alt' => 'festival-header',
|
||||
'fullWidth' => true,
|
||||
'width' => '1320px',
|
||||
'height' => '879px',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
2 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '36px',
|
||||
],
|
||||
],
|
||||
],
|
||||
3 => [
|
||||
'type' => 'text',
|
||||
'text' => '<h1 style="text-align: center;">Pack your glowsticks, <br />Boomfest is back! </h1>
|
||||
<p></p>
|
||||
<p style="text-align: center;">Duis tempor nisl in risus hendrerit venenatis. <br />Curabitur ornare venenatis nisl non ullamcorper. </p>',
|
||||
],
|
||||
4 => [
|
||||
'type' => 'button',
|
||||
'text' => 'Duis id tincidunt',
|
||||
'url' => '',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#0a5388',
|
||||
'borderColor' => '#0074a2',
|
||||
'borderWidth' => '0px',
|
||||
'borderRadius' => '5px',
|
||||
'borderStyle' => 'solid',
|
||||
'width' => '260px',
|
||||
'lineHeight' => '50px',
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Courier New',
|
||||
'fontSize' => '18px',
|
||||
'fontWeight' => 'bold',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
5 => [
|
||||
'type' => 'text',
|
||||
'text' => '<p style="text-align: center;">Maecenas scelerisque nisi sit amet metus efficitur dapibus! <br />Ut eros risus, facilisis ac aliquet vel, posuere ut urna.</p>',
|
||||
],
|
||||
6 => [
|
||||
'type' => 'social',
|
||||
'iconSet' => 'full-symbol-grey',
|
||||
'icons' => [
|
||||
0 => [
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'facebook',
|
||||
'link' => 'http://www.facebook.com',
|
||||
'image' => $this->social_icon_url . '/08-full-symbol-grey/Facebook.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Facebook',
|
||||
],
|
||||
1 => [
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'twitter',
|
||||
'link' => 'http://www.twitter.com',
|
||||
'image' => $this->social_icon_url . '/08-full-symbol-grey/Twitter.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Twitter',
|
||||
],
|
||||
2 => [
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'instagram',
|
||||
'link' => 'http://instagram.com',
|
||||
'image' => $this->social_icon_url . '/08-full-symbol-grey/Instagram.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Instagram',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'divider',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'padding' => '13px',
|
||||
'borderStyle' => 'dashed',
|
||||
'borderWidth' => '2px',
|
||||
'borderColor' => '#ffffff',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '28px',
|
||||
],
|
||||
],
|
||||
],
|
||||
2 => [
|
||||
'type' => 'text',
|
||||
'text' => '<h2 style="text-align: center;">Confirmed Lineup</h2>',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
2 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'text',
|
||||
'text' => '<h3><em><span style="color: #bae2ff;">Main Stage</span></em></h3><p>Quisque libero<br />Nulla convallis<br />Vestibulum Ornare<br />Consectetur Odio</p>',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'text',
|
||||
'text' => '<h3><em><span style="color: #bae2ff;">New Acts Stage</span></em></h3><p>Nulla interdum<br />Massa nec<br />Pharetra<br />Varius</p>',
|
||||
],
|
||||
],
|
||||
],
|
||||
2 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'text',
|
||||
'text' => '<h3><em><span style="color: #bae2ff;">Comedy Stage</span></em></h3><p>In pulvinar<br />Risus sed<br />Condimentum<br />Feugiat</p>',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
3 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'divider',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'padding' => '13px',
|
||||
'borderStyle' => 'dashed',
|
||||
'borderWidth' => '2px',
|
||||
'borderColor' => '#ffffff',
|
||||
],
|
||||
],
|
||||
],
|
||||
2 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
3 => [
|
||||
'type' => 'text',
|
||||
'text' => '<h2 style="text-align: center;">New to the festival this year</h2>',
|
||||
],
|
||||
4 => [
|
||||
'type' => 'divider',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'padding' => '9px',
|
||||
'borderStyle' => 'dashed',
|
||||
'borderWidth' => '2px',
|
||||
'borderColor' => '#ffffff',
|
||||
],
|
||||
],
|
||||
],
|
||||
5 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
4 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/street-food.jpg',
|
||||
'alt' => 'street food',
|
||||
'fullWidth' => true,
|
||||
'width' => '499px',
|
||||
'height' => '750px',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
2 => [
|
||||
'type' => 'text',
|
||||
'text' => '<h3>Award-winning Street Food</h3><p>Nullam pharetra lectus id porta pulvinar. Proin ac massa nibh. Nullam ac mi pharetra, lobortis nunc et, placerat leo. Mauris eu feugiat elit. Pellentesque eget turpis eu diam vehicula convallis non <a href="https://www.mailpoet.com">luctus enim.</a></p>',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/happy.jpeg',
|
||||
'alt' => 'happy',
|
||||
'fullWidth' => true,
|
||||
'width' => '499px',
|
||||
'height' => '750px',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
2 => [
|
||||
'type' => 'text',
|
||||
'text' => '<h3>Prepare to dazzle with our Glitter Run</h3><p>Donec quis orci at metus finibus tincidunt. Sed vel urna sed urna maximus congue eu et turpis. Nulla tempus hendrerit justo eget molestie. Vivamus quis molestie lacus. Donec commodo odio a nisi feugiat, vitae egestas mi.</p>',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
5 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'divider',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'padding' => '13px',
|
||||
'borderStyle' => 'dashed',
|
||||
'borderWidth' => '2px',
|
||||
'borderColor' => '#ffffff',
|
||||
],
|
||||
],
|
||||
],
|
||||
2 => [
|
||||
'type' => 'footer',
|
||||
'text' => '<p>Mauris tristique ultricies ullamcorper. <br />Don\'t want to hear from us? <a href="[link:subscription_unsubscribe_url]">' . __("Unsubscribe", 'mailpoet') . '</a></p><p></p><p>Add your postal address here. </p>',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
'text' => [
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Courier New',
|
||||
'fontSize' => '13px',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
'link' => [
|
||||
'fontColor' => '#ffffff',
|
||||
'textDecoration' => 'underline',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
'globalStyles' => [
|
||||
'text' => [
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Courier New',
|
||||
'fontSize' => '16px',
|
||||
],
|
||||
'h1' => [
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Georgia',
|
||||
'fontSize' => '36px',
|
||||
],
|
||||
'h2' => [
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Georgia',
|
||||
'fontSize' => '26px',
|
||||
],
|
||||
'h3' => [
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Georgia',
|
||||
'fontSize' => '24px',
|
||||
],
|
||||
'link' => [
|
||||
'fontColor' => '#ffffff',
|
||||
'textDecoration' => 'underline',
|
||||
],
|
||||
'wrapper' => [
|
||||
'backgroundColor' => '#8d062b',
|
||||
],
|
||||
'body' => [
|
||||
'backgroundColor' => '#0a5388',
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
private function getThumbnail() {
|
||||
return $this->template_image_url . '/thumbnail.20190411-1500.jpg';
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
+1530
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,760 @@
|
||||
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
|
||||
|
||||
namespace MailPoet\Config\PopulatorData\Templates;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
class FoodBox {
|
||||
|
||||
private $template_image_url;
|
||||
private $social_icon_url;
|
||||
|
||||
public function __construct(
|
||||
$assets_url
|
||||
) {
|
||||
$this->template_image_url = 'https://ps.w.org/mailpoet/assets/newsletter-templates/food_box';
|
||||
$this->social_icon_url = $assets_url . '/img/newsletter_editor/social-icons';
|
||||
}
|
||||
|
||||
public function get() {
|
||||
return [
|
||||
'name' => __("Welcome to FoodBox", 'mailpoet'),
|
||||
'categories' => json_encode(['welcome', 'all']),
|
||||
'readonly' => 1,
|
||||
'thumbnail' => $this->getThumbnail(),
|
||||
'body' => json_encode($this->getBody()),
|
||||
];
|
||||
}
|
||||
|
||||
private function getBody() {
|
||||
return [
|
||||
'content' => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#f4f4f4',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
2 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/Food-Delivery-Logo.png',
|
||||
'alt' => 'Food-Delivery-Logo',
|
||||
'fullWidth' => false,
|
||||
'width' => '640px',
|
||||
'height' => '180px',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/Food-Delivery-App.png',
|
||||
'alt' => 'Food-Delivery-App',
|
||||
'fullWidth' => false,
|
||||
'width' => '640px',
|
||||
'height' => '180px',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
3 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
4 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '40px',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'text',
|
||||
'text' => '<h1><strong>Welcome to FoodBox</strong></h1>
|
||||
<h2><strong>Lorem ipsum dolor sit amet</strong></h2>
|
||||
<p>Curabitur sollicitudin eros eu cursus sollicitudin. Suspendisse laoreet sollicitudin urna, ut lacinia risus dictum a. Integer a neque eu magna commodo sodales eu eget ante.</p>',
|
||||
],
|
||||
2 => [
|
||||
'type' => 'button',
|
||||
'text' => 'Get Started',
|
||||
'url' => '',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#7cc119',
|
||||
'borderColor' => '#7cc119',
|
||||
'borderWidth' => '0px',
|
||||
'borderRadius' => '5px',
|
||||
'borderStyle' => 'solid',
|
||||
'width' => '100px',
|
||||
'lineHeight' => '40px',
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '14px',
|
||||
'fontWeight' => 'bold',
|
||||
'textAlign' => 'left',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/Food-Delivery-Focus.jpg',
|
||||
'alt' => 'Food-Delivery-Focus',
|
||||
'fullWidth' => false,
|
||||
'width' => '800px',
|
||||
'height' => '800px',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
5 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'divider',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'padding' => '31.5px',
|
||||
'borderStyle' => 'solid',
|
||||
'borderWidth' => '2px',
|
||||
'borderColor' => '#e5e5e5',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
6 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'text',
|
||||
'text' => '<h2 style="text-align: center;">Get started in 3 simple steps</h2>',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
7 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/Food-Delivery-1-1.png',
|
||||
'alt' => 'Food-Delivery-1',
|
||||
'fullWidth' => false,
|
||||
'width' => '800px',
|
||||
'height' => '250px',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
2 => [
|
||||
'type' => 'text',
|
||||
'text' => '<p style="text-align: center;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur sollicitudin eros eu cursus sollicitudin.</p>',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/Food-Delivery-2-1.png',
|
||||
'alt' => 'Food-Delivery-2',
|
||||
'fullWidth' => false,
|
||||
'width' => '800px',
|
||||
'height' => '250px',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
2 => [
|
||||
'type' => 'text',
|
||||
'text' => '<p style="text-align: center;"><span style="text-align: center;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur sollicitudin eros eu cursus sollicitudin.</span></p>',
|
||||
],
|
||||
],
|
||||
],
|
||||
2 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/Food-Delivery-3-1.png',
|
||||
'alt' => 'Food-Delivery-3',
|
||||
'fullWidth' => false,
|
||||
'width' => '800px',
|
||||
'height' => '250px',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
2 => [
|
||||
'type' => 'text',
|
||||
'text' => '<p style="text-align: center;"><span style="text-align: center;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur sollicitudin eros eu cursus sollicitudin.</span></p>',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
8 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '30px',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'button',
|
||||
'text' => 'Get Started',
|
||||
'url' => '',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#7cc119',
|
||||
'borderColor' => '#7cc119',
|
||||
'borderWidth' => '0px',
|
||||
'borderRadius' => '5px',
|
||||
'borderStyle' => 'solid',
|
||||
'width' => '100px',
|
||||
'lineHeight' => '40px',
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '14px',
|
||||
'fontWeight' => 'bold',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
2 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '25px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
9 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#4599da',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '30px',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'text',
|
||||
'text' => '<p style="text-align: center; font-size: 14px;"><strong><span style="color: #ffffff;">Link 1 - Link 2 - Link 3 - Link 4</span></strong></p>',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '24px',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'social',
|
||||
'iconSet' => 'full-symbol-grey',
|
||||
'icons' => [
|
||||
0 => [
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'facebook',
|
||||
'link' => 'http://www.facebook.com',
|
||||
'image' => $this->social_icon_url . '/08-full-symbol-grey/Facebook.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Facebook',
|
||||
],
|
||||
1 => [
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'twitter',
|
||||
'link' => 'http://www.twitter.com',
|
||||
'image' => $this->social_icon_url . '/08-full-symbol-grey/Twitter.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Twitter',
|
||||
],
|
||||
2 => [
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'youtube',
|
||||
'link' => 'http://www.youtube.com',
|
||||
'image' => $this->social_icon_url . '/08-full-symbol-grey/Youtube.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Youtube',
|
||||
],
|
||||
3 => [
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'instagram',
|
||||
'link' => 'http://instagram.com',
|
||||
'image' => $this->social_icon_url . '/08-full-symbol-grey/Instagram.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Instagram',
|
||||
],
|
||||
4 => [
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'website',
|
||||
'link' => '',
|
||||
'image' => $this->social_icon_url . '/08-full-symbol-grey/Website.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Website',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
10 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#4599da',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '25px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
11 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#f4f4f4',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'footer',
|
||||
'text' => '<p><a href="[link:subscription_unsubscribe_url]">' . __("Unsubscribe", 'mailpoet') . '</a> | <a href="[link:subscription_manage_url]">' . __("Manage your subscription", 'mailpoet') . '</a><br />' . __("Add your postal address here!", 'mailpoet') . '</p>',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
'text' => [
|
||||
'fontColor' => '#222222',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '12px',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
'link' => [
|
||||
'fontColor' => '#6cb7d4',
|
||||
'textDecoration' => 'none',
|
||||
],
|
||||
],
|
||||
],
|
||||
2 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '40px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
'globalStyles' => [
|
||||
'text' => [
|
||||
'fontColor' => '#000000',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '12px',
|
||||
],
|
||||
'h1' => [
|
||||
'fontColor' => '#4599da',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '26px',
|
||||
],
|
||||
'h2' => [
|
||||
'fontColor' => '#878787',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '18px',
|
||||
],
|
||||
'h3' => [
|
||||
'fontColor' => '#333333',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '14px',
|
||||
],
|
||||
'link' => [
|
||||
'fontColor' => '#4599da',
|
||||
'textDecoration' => 'underline',
|
||||
],
|
||||
'wrapper' => [
|
||||
'backgroundColor' => '#ffffff',
|
||||
],
|
||||
'body' => [
|
||||
'backgroundColor' => '#f4f4f4',
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
private function getThumbnail() {
|
||||
return $this->template_image_url . '/thumbnail.20190411-1500.jpg';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,351 @@
|
||||
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
|
||||
|
||||
namespace MailPoet\Config\PopulatorData\Templates;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
class GiftWelcome {
|
||||
|
||||
private $template_image_url;
|
||||
private $social_icon_url;
|
||||
|
||||
public function __construct(
|
||||
$assets_url
|
||||
) {
|
||||
$this->template_image_url = 'https://ps.w.org/mailpoet/assets/newsletter-templates/gift';
|
||||
$this->social_icon_url = $assets_url . '/img/newsletter_editor/social-icons';
|
||||
}
|
||||
|
||||
public function get() {
|
||||
return [
|
||||
'name' => __("Gift Welcome", 'mailpoet'),
|
||||
'categories' => json_encode(['welcome', 'all']),
|
||||
'readonly' => 1,
|
||||
'thumbnail' => $this->getThumbnail(),
|
||||
'body' => json_encode($this->getBody()),
|
||||
];
|
||||
}
|
||||
|
||||
private function getThumbnail() {
|
||||
return $this->template_image_url . '/thumbnail.20190411-1500.jpg';
|
||||
}
|
||||
|
||||
private function getBody() {
|
||||
return [
|
||||
'content' =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#ffffff',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '40px',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/Gift-Header-1.jpg',
|
||||
'alt' => 'Gift-Header-1',
|
||||
'fullWidth' => true,
|
||||
'width' => '1280px',
|
||||
'height' => '920px',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#e7e7e7',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => '<h2 style="text-align: center;"><span style="color: #dd2d2d;">We\'re so happy you\'re onboard!</span></h2>
|
||||
<p style="text-align: center;"><span style="color: #333333;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur nec nisi quis ex pulvinar molestie. Sed pulvinar placerat justo eu viverra. Pellentesque in interdum eros, a venenatis velit. Fusce finibus convallis augue, ut viverra felis placerat in. </span></p>
|
||||
<p style="text-align: center;"><span style="color: #333333;"></span></p>
|
||||
<p style="text-align: center;"><span style="color: #333333;">Curabitur et commodo ipsum. Mauris tellus metus, tristique vel sollicitudin ut, malesuada in augue. Aliquam ultricies purus vel commodo vehicula.</span></p>',
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'button',
|
||||
'text' => 'Get Started',
|
||||
'url' => '',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#dd2d2d',
|
||||
'borderColor' => '#0074a2',
|
||||
'borderWidth' => '0px',
|
||||
'borderRadius' => '40px',
|
||||
'borderStyle' => 'solid',
|
||||
'width' => '180px',
|
||||
'lineHeight' => '50px',
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '22px',
|
||||
'fontWeight' => 'bold',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
2 =>
|
||||
[
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/Gift-Footer.jpg',
|
||||
'alt' => 'Gift-Footer',
|
||||
'fullWidth' => true,
|
||||
'width' => '1280px',
|
||||
'height' => '920px',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
2 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#ffffff',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '23px',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => '<p style="font-size: 11px; text-align: center;"><span style="color: #808080;"><strong>Address Line 1</strong></span></p>
|
||||
<p style="font-size: 11px; text-align: center;"><span style="color: #808080;"><strong>Address Line 2</strong></span></p>
|
||||
<p style="font-size: 11px; text-align: center;"><span style="color: #808080;"><strong>City</strong></span></p>
|
||||
<p style="font-size: 11px; text-align: center;"><span style="color: #808080;"><strong>Country</strong></span></p>',
|
||||
],
|
||||
2 =>
|
||||
[
|
||||
'type' => 'divider',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'padding' => '5.5px',
|
||||
'borderStyle' => 'solid',
|
||||
'borderWidth' => '1px',
|
||||
'borderColor' => '#aaaaaa',
|
||||
],
|
||||
],
|
||||
],
|
||||
3 =>
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
4 =>
|
||||
[
|
||||
'type' => 'social',
|
||||
'iconSet' => 'grey',
|
||||
'icons' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'facebook',
|
||||
'link' => 'http://www.facebook.com',
|
||||
'image' => $this->social_icon_url . '/02-grey/Facebook.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Facebook',
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'twitter',
|
||||
'link' => 'http://www.twitter.com',
|
||||
'image' => $this->social_icon_url . '/02-grey/Twitter.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Twitter',
|
||||
],
|
||||
2 =>
|
||||
[
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'instagram',
|
||||
'link' => 'http://instagram.com',
|
||||
'image' => $this->social_icon_url . '/02-grey/Instagram.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Instagram',
|
||||
],
|
||||
],
|
||||
],
|
||||
5 =>
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => '<p style="text-align: center; font-size: 11px;"><a href="[link:subscription_unsubscribe_url]">' . __("Unsubscribe", 'mailpoet') . '</a><span> | </span><a href="[link:subscription_manage_url]">' . __("Manage your subscription", 'mailpoet') . '</a></p>',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
'globalStyles' =>
|
||||
[
|
||||
'text' =>
|
||||
[
|
||||
'fontColor' => '#000000',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '15px',
|
||||
],
|
||||
'h1' =>
|
||||
[
|
||||
'fontColor' => '#111111',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '30px',
|
||||
],
|
||||
'h2' =>
|
||||
[
|
||||
'fontColor' => '#222222',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '24px',
|
||||
],
|
||||
'h3' =>
|
||||
[
|
||||
'fontColor' => '#333333',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '22px',
|
||||
],
|
||||
'link' =>
|
||||
[
|
||||
'fontColor' => '#dd2d2d',
|
||||
'textDecoration' => 'underline',
|
||||
],
|
||||
'wrapper' =>
|
||||
[
|
||||
'backgroundColor' => '#ffffff',
|
||||
],
|
||||
'body' =>
|
||||
[
|
||||
'backgroundColor' => '#ffffff',
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+1481
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+1449
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+385
@@ -0,0 +1,385 @@
|
||||
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
|
||||
|
||||
namespace MailPoet\Config\PopulatorData\Templates;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
class NewsletterBlank121Column {
|
||||
|
||||
private $assets_url;
|
||||
private $external_template_image_url;
|
||||
private $template_image_url;
|
||||
private $social_icon_url;
|
||||
|
||||
public function __construct(
|
||||
$assets_url
|
||||
) {
|
||||
$this->assets_url = $assets_url;
|
||||
$this->external_template_image_url = 'https://ps.w.org/mailpoet/assets/newsletter-templates/newsletter-blank-1-2-1-column';
|
||||
$this->template_image_url = $this->assets_url . '/img/blank_templates';
|
||||
$this->social_icon_url = $this->assets_url . '/img/newsletter_editor/social-icons';
|
||||
}
|
||||
|
||||
public function get() {
|
||||
return [
|
||||
'name' => __("Newsletter: Blank 1:2:1 Column", 'mailpoet'),
|
||||
'categories' => json_encode(['standard', 'blank']),
|
||||
'readonly' => 1,
|
||||
'thumbnail' => $this->getThumbnail(),
|
||||
'body' => json_encode($this->getBody()),
|
||||
];
|
||||
}
|
||||
|
||||
private function getBody() {
|
||||
return [
|
||||
"content" => [
|
||||
"type" => "container",
|
||||
"orientation" => "vertical",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "horizontal",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "#f8f8f8",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "vertical",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "header",
|
||||
"text" => '<a href="[link:newsletter_view_in_browser_url]">' . __("View this in your browser.", 'mailpoet') . '</a>',
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
"text" => [
|
||||
"fontColor" => "#222222",
|
||||
"fontFamily" => "Arial",
|
||||
"fontSize" => "12px",
|
||||
"textAlign" => "center",
|
||||
],
|
||||
"link" => [
|
||||
"fontColor" => "#6cb7d4",
|
||||
"textDecoration" => "underline",
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "horizontal",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "#ffffff",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "vertical",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "spacer",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
"height" => "30px",
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "image",
|
||||
"link" => "",
|
||||
"src" => $this->template_image_url . "/fake-logo.png",
|
||||
"alt" => __("Fake logo", 'mailpoet'),
|
||||
"fullWidth" => false,
|
||||
"width" => "598px",
|
||||
"height" => "71px",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"textAlign" => "center",
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "text",
|
||||
"text" => __("<h1 style=\"text-align: center;\"><strong>Let's Get Started!</strong></h1>\n<p>It's time to design your newsletter! In the right sidebar, you'll find four menu items that will help you customize your newsletter:</p>\n<ol>\n<li>Content</li>\n<li>Columns</li>\n<li>Styles</li>\n<li>Preview</li>\n</ol>", 'mailpoet'),
|
||||
],
|
||||
[
|
||||
"type" => "divider",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
"padding" => "13px",
|
||||
"borderStyle" => "dotted",
|
||||
"borderWidth" => "3px",
|
||||
"borderColor" => "#aaaaaa",
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "horizontal",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "vertical",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "text",
|
||||
"text" => '<h2>' . __('This template has...', 'mailpoet') . '</h2>',
|
||||
],
|
||||
[
|
||||
"type" => "text",
|
||||
"text" => __("<p>In the right sidebar, you can add layout blocks to your email:</p>\n<ul>\n<li>1 column</li>\n<li>2 columns</li>\n<li>3 columns</li>\n</ul>", 'mailpoet'),
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "vertical",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "text",
|
||||
"text" => '<h2>' . __('... a 2-column layout.', 'mailpoet') . '</h2>',
|
||||
],
|
||||
[
|
||||
"type" => "text",
|
||||
"text" => '<p>' . __("You can change a layout's background color by clicking on the settings icon on the right edge of the Designer. Simply hover over this area to see the Settings (gear) icon.", 'mailpoet') . '</p>',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "horizontal",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "vertical",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "divider",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
"padding" => "13px",
|
||||
"borderStyle" => "dotted",
|
||||
"borderWidth" => "3px",
|
||||
"borderColor" => "#aaaaaa",
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "horizontal",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "vertical",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "text",
|
||||
"text" => __("<h3 style=\"text-align: center;\"><span style=\"font-weight: 600;\">Let's end with a single column. </span></h3>\n<p style=\"line-height: 25.6px;\">In the right sidebar, you can add these layout blocks to your email:</p>\n<p style=\"line-height: 25.6px;\"></p>\n<ul style=\"line-height: 25.6px;\">\n<li>1 column</li>\n<li>2 columns</li>\n<li>3 columns</li>\n</ul>", 'mailpoet'),
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "horizontal",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "#f8f8f8",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "vertical",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "divider",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
"padding" => "24.5px",
|
||||
"borderStyle" => "solid",
|
||||
"borderWidth" => "3px",
|
||||
"borderColor" => "#aaaaaa",
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "social",
|
||||
"iconSet" => "grey",
|
||||
"icons" => [
|
||||
[
|
||||
"type" => "socialIcon",
|
||||
"iconType" => "facebook",
|
||||
"link" => "http://www.facebook.com",
|
||||
"image" => $this->social_icon_url . "/02-grey/Facebook.png",
|
||||
"height" => "32px",
|
||||
"width" => "32px",
|
||||
"text" => "Facebook",
|
||||
],
|
||||
[
|
||||
"type" => "socialIcon",
|
||||
"iconType" => "twitter",
|
||||
"link" => "http://www.twitter.com",
|
||||
"image" => $this->social_icon_url . "/02-grey/Twitter.png",
|
||||
"height" => "32px",
|
||||
"width" => "32px",
|
||||
"text" => "Twitter",
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "divider",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
"padding" => "7.5px",
|
||||
"borderStyle" => "solid",
|
||||
"borderWidth" => "3px",
|
||||
"borderColor" => "#aaaaaa",
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "footer",
|
||||
"text" => '<p><a href="[link:subscription_unsubscribe_url]">' . __("Unsubscribe", 'mailpoet') . '</a> | <a href="[link:subscription_manage_url]">' . __("Manage your subscription", 'mailpoet') . '</a><br />' . __("Add your postal address here!", 'mailpoet') . '</p>',
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
"text" => [
|
||||
"fontColor" => "#222222",
|
||||
"fontFamily" => "Arial",
|
||||
"fontSize" => "12px",
|
||||
"textAlign" => "center",
|
||||
],
|
||||
"link" => [
|
||||
"fontColor" => "#6cb7d4",
|
||||
"textDecoration" => "none",
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
"globalStyles" => [
|
||||
"text" => [
|
||||
"fontColor" => "#000000",
|
||||
"fontFamily" => "Arial",
|
||||
"fontSize" => "16px",
|
||||
],
|
||||
"h1" => [
|
||||
"fontColor" => "#111111",
|
||||
"fontFamily" => "Trebuchet MS",
|
||||
"fontSize" => "30px",
|
||||
],
|
||||
"h2" => [
|
||||
"fontColor" => "#222222",
|
||||
"fontFamily" => "Trebuchet MS",
|
||||
"fontSize" => "24px",
|
||||
],
|
||||
"h3" => [
|
||||
"fontColor" => "#333333",
|
||||
"fontFamily" => "Trebuchet MS",
|
||||
"fontSize" => "22px",
|
||||
],
|
||||
"link" => [
|
||||
"fontColor" => "#21759B",
|
||||
"textDecoration" => "underline",
|
||||
],
|
||||
"wrapper" => [
|
||||
"backgroundColor" => "#ffffff",
|
||||
],
|
||||
"body" => [
|
||||
"backgroundColor" => "#eeeeee",
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
private function getThumbnail() {
|
||||
return $this->external_template_image_url . '/thumbnail.20190411-1500.jpg';
|
||||
}
|
||||
}
|
||||
+325
@@ -0,0 +1,325 @@
|
||||
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
|
||||
|
||||
namespace MailPoet\Config\PopulatorData\Templates;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
class NewsletterBlank12Column {
|
||||
|
||||
private $assets_url;
|
||||
private $external_template_image_url;
|
||||
private $template_image_url;
|
||||
private $social_icon_url;
|
||||
|
||||
public function __construct(
|
||||
$assets_url
|
||||
) {
|
||||
$this->assets_url = $assets_url;
|
||||
$this->external_template_image_url = 'https://ps.w.org/mailpoet/assets/newsletter-templates/newsletter-blank-1-2-column';
|
||||
$this->template_image_url = $this->assets_url . '/img/blank_templates';
|
||||
$this->social_icon_url = $this->assets_url . '/img/newsletter_editor/social-icons';
|
||||
}
|
||||
|
||||
public function get() {
|
||||
return [
|
||||
'name' => __("Newsletter: Blank 1:2 Column", 'mailpoet'),
|
||||
'categories' => json_encode(['standard', 'blank']),
|
||||
'readonly' => 1,
|
||||
'thumbnail' => $this->getThumbnail(),
|
||||
'body' => json_encode($this->getBody()),
|
||||
];
|
||||
}
|
||||
|
||||
private function getBody() {
|
||||
return [
|
||||
"content" => [
|
||||
"type" => "container",
|
||||
"orientation" => "vertical",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "horizontal",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "#f8f8f8",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "vertical",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "header",
|
||||
"text" => '<a href="[link:newsletter_view_in_browser_url]">' . __("View this in your browser.", 'mailpoet') . '</a>',
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
"text" => [
|
||||
"fontColor" => "#222222",
|
||||
"fontFamily" => "Arial",
|
||||
"fontSize" => "12px",
|
||||
"textAlign" => "center",
|
||||
],
|
||||
"link" => [
|
||||
"fontColor" => "#6cb7d4",
|
||||
"textDecoration" => "underline",
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "horizontal",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "#ffffff",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "vertical",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "spacer",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
"height" => "30px",
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "image",
|
||||
"link" => "",
|
||||
"src" => $this->template_image_url . "/fake-logo.png",
|
||||
"alt" => __("Fake logo", 'mailpoet'),
|
||||
"fullWidth" => false,
|
||||
"width" => "598px",
|
||||
"height" => "71px",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"textAlign" => "center",
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "text",
|
||||
"text" => __("<h1 style=\"text-align: center;\"><strong>Let's Get Started!</strong></h1>\n<p> </p>\n<p>It's time to design your newsletter! In the right sidebar, you'll find 4 menu items that will help you customize your newsletter:</p>\n<ol>\n<li>Content</li>\n<li>Columns</li>\n<li>Styles</li>\n<li>Preview</li>\n</ol>", 'mailpoet'),
|
||||
],
|
||||
[
|
||||
"type" => "divider",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
"padding" => "13px",
|
||||
"borderStyle" => "dotted",
|
||||
"borderWidth" => "3px",
|
||||
"borderColor" => "#aaaaaa",
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "horizontal",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "vertical",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "text",
|
||||
"text" => '<h2>' . __('This template has...', 'mailpoet') . '</h2>',
|
||||
],
|
||||
[
|
||||
"type" => "text",
|
||||
"text" => __("<p>In the right sidebar, you can add these layout blocks to your email:</p>\n<ul>\n<li>1 column</li>\n<li>2 columns</li>\n<li>3 columns</li>\n</ul>", 'mailpoet'),
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "vertical",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "text",
|
||||
"text" => '<h2>' . __('... a 2-column layout.', 'mailpoet') . '</h2>',
|
||||
],
|
||||
[
|
||||
"type" => "text",
|
||||
"text" => __("<p><span style=\"line-height: 25.6px;\">You can change a layout's background color by clicking on the settings icon on the right edge of the Designer. Simply hover over this area to see the Settings (gear) icon.</span></p>", 'mailpoet'),
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "horizontal",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "#f8f8f8",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "vertical",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "divider",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
"padding" => "24.5px",
|
||||
"borderStyle" => "solid",
|
||||
"borderWidth" => "3px",
|
||||
"borderColor" => "#aaaaaa",
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "social",
|
||||
"iconSet" => "grey",
|
||||
"icons" => [
|
||||
[
|
||||
"type" => "socialIcon",
|
||||
"iconType" => "facebook",
|
||||
"link" => "http://www.facebook.com",
|
||||
"image" => $this->social_icon_url . "/02-grey/Facebook.png",
|
||||
"height" => "32px",
|
||||
"width" => "32px",
|
||||
"text" => "Facebook",
|
||||
],
|
||||
[
|
||||
"type" => "socialIcon",
|
||||
"iconType" => "twitter",
|
||||
"link" => "http://www.twitter.com",
|
||||
"image" => $this->social_icon_url . "/02-grey/Twitter.png",
|
||||
"height" => "32px",
|
||||
"width" => "32px",
|
||||
"text" => "Twitter",
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "divider",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
"padding" => "7.5px",
|
||||
"borderStyle" => "solid",
|
||||
"borderWidth" => "3px",
|
||||
"borderColor" => "#aaaaaa",
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "footer",
|
||||
"text" => '<p><a href="[link:subscription_unsubscribe_url]">' . __("Unsubscribe", 'mailpoet') . '</a> | <a href="[link:subscription_manage_url]">' . __("Manage your subscription", 'mailpoet') . '</a><br />' . __("Add your postal address here!", 'mailpoet') . '</p>',
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
"text" => [
|
||||
"fontColor" => "#222222",
|
||||
"fontFamily" => "Arial",
|
||||
"fontSize" => "12px",
|
||||
"textAlign" => "center",
|
||||
],
|
||||
"link" => [
|
||||
"fontColor" => "#6cb7d4",
|
||||
"textDecoration" => "none",
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
"globalStyles" => [
|
||||
"text" => [
|
||||
"fontColor" => "#000000",
|
||||
"fontFamily" => "Arial",
|
||||
"fontSize" => "16px",
|
||||
],
|
||||
"h1" => [
|
||||
"fontColor" => "#111111",
|
||||
"fontFamily" => "Trebuchet MS",
|
||||
"fontSize" => "30px",
|
||||
],
|
||||
"h2" => [
|
||||
"fontColor" => "#222222",
|
||||
"fontFamily" => "Trebuchet MS",
|
||||
"fontSize" => "24px",
|
||||
],
|
||||
"h3" => [
|
||||
"fontColor" => "#333333",
|
||||
"fontFamily" => "Trebuchet MS",
|
||||
"fontSize" => "22px",
|
||||
],
|
||||
"link" => [
|
||||
"fontColor" => "#21759B",
|
||||
"textDecoration" => "underline",
|
||||
],
|
||||
"wrapper" => [
|
||||
"backgroundColor" => "#ffffff",
|
||||
],
|
||||
"body" => [
|
||||
"backgroundColor" => "#eeeeee",
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
private function getThumbnail() {
|
||||
return $this->external_template_image_url . '/thumbnail.20190411-1500.jpg';
|
||||
}
|
||||
}
|
||||
+348
@@ -0,0 +1,348 @@
|
||||
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
|
||||
|
||||
namespace MailPoet\Config\PopulatorData\Templates;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
class NewsletterBlank13Column {
|
||||
|
||||
private $assets_url;
|
||||
private $external_template_image_url;
|
||||
private $template_image_url;
|
||||
private $social_icon_url;
|
||||
|
||||
public function __construct(
|
||||
$assets_url
|
||||
) {
|
||||
$this->assets_url = $assets_url;
|
||||
$this->external_template_image_url = 'https://ps.w.org/mailpoet/assets/newsletter-templates/newsletter-blank-1-3-column';
|
||||
$this->template_image_url = $this->assets_url . '/img/blank_templates';
|
||||
$this->social_icon_url = $this->assets_url . '/img/newsletter_editor/social-icons';
|
||||
}
|
||||
|
||||
public function get() {
|
||||
return [
|
||||
'name' => __("Newsletter: Blank 1:3 Column", 'mailpoet'),
|
||||
'categories' => json_encode(['standard', 'blank']),
|
||||
'readonly' => 1,
|
||||
'thumbnail' => $this->getThumbnail(),
|
||||
'body' => json_encode($this->getBody()),
|
||||
];
|
||||
}
|
||||
|
||||
private function getBody() {
|
||||
return [
|
||||
"content" => [
|
||||
"type" => "container",
|
||||
"orientation" => "vertical",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "horizontal",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "#f8f8f8",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "vertical",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "header",
|
||||
"text" => '<a href="[link:newsletter_view_in_browser_url]">' . __("View this in your browser.", 'mailpoet') . '</a>',
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
"text" => [
|
||||
"fontColor" => "#222222",
|
||||
"fontFamily" => "Arial",
|
||||
"fontSize" => "12px",
|
||||
"textAlign" => "center",
|
||||
],
|
||||
"link" => [
|
||||
"fontColor" => "#6cb7d4",
|
||||
"textDecoration" => "underline",
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "horizontal",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "#ffffff",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "vertical",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "spacer",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
"height" => "30px",
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "image",
|
||||
"link" => "",
|
||||
"src" => $this->template_image_url . "/fake-logo.png",
|
||||
"alt" => __("Fake logo", 'mailpoet'),
|
||||
"fullWidth" => false,
|
||||
"width" => "598px",
|
||||
"height" => "71px",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"textAlign" => "center",
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "text",
|
||||
"text" => __("<h1 style=\"text-align: center;\"><strong>Let's Get Started! </strong></h1>\n<p> </p>\n<p>It's time to design your newsletter! In the right sidebar, you'll find four menu items that will help you customize your newsletter:</p>\n<ol>\n<li>Content</li>\n<li>Columns</li>\n<li>Styles</li>\n<li>Preview</li>\n</ol>", 'mailpoet'),
|
||||
],
|
||||
[
|
||||
"type" => "divider",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
"padding" => "13px",
|
||||
"borderStyle" => "dotted",
|
||||
"borderWidth" => "3px",
|
||||
"borderColor" => "#aaaaaa",
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "horizontal",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "vertical",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "text",
|
||||
"text" => '<h3>' . __('This template...', 'mailpoet') . '</h3>',
|
||||
],
|
||||
[
|
||||
"type" => "text",
|
||||
"text" => '<p>' . __('In the right sidebar, you can add layout blocks to your newsletter.', 'mailpoet') . '</p>',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "vertical",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "text",
|
||||
"text" => '<h3>' . __('... has a...', 'mailpoet') . '</h3>',
|
||||
],
|
||||
[
|
||||
"type" => "text",
|
||||
"text" => __("<p>You have the choice of:</p>\n<ul>\n<li>1 column</li>\n<li>2 columns</li>\n<li>3 columns</li>\n</ul>", 'mailpoet'),
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "vertical",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "text",
|
||||
"text" => '<h3>' . __('3-column layout.', 'mailpoet') . '</h3>',
|
||||
],
|
||||
[
|
||||
"type" => "text",
|
||||
"text" => '<p>' . __('You can add as many layout blocks as you want!', 'mailpoet') . '</p>',
|
||||
],
|
||||
[
|
||||
"type" => "text",
|
||||
"text" => "",
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "horizontal",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "#f8f8f8",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "vertical",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "divider",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
"padding" => "24.5px",
|
||||
"borderStyle" => "solid",
|
||||
"borderWidth" => "3px",
|
||||
"borderColor" => "#aaaaaa",
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "social",
|
||||
"iconSet" => "grey",
|
||||
"icons" => [
|
||||
[
|
||||
"type" => "socialIcon",
|
||||
"iconType" => "facebook",
|
||||
"link" => "http://www.facebook.com",
|
||||
"image" => $this->social_icon_url . "/02-grey/Facebook.png",
|
||||
"height" => "32px",
|
||||
"width" => "32px",
|
||||
"text" => "Facebook",
|
||||
],
|
||||
[
|
||||
"type" => "socialIcon",
|
||||
"iconType" => "twitter",
|
||||
"link" => "http://www.twitter.com",
|
||||
"image" => $this->social_icon_url . "/02-grey/Twitter.png",
|
||||
"height" => "32px",
|
||||
"width" => "32px",
|
||||
"text" => "Twitter",
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "divider",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
"padding" => "7.5px",
|
||||
"borderStyle" => "solid",
|
||||
"borderWidth" => "3px",
|
||||
"borderColor" => "#aaaaaa",
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "footer",
|
||||
"text" => '<p><a href="[link:subscription_unsubscribe_url]">' . __("Unsubscribe", 'mailpoet') . '</a> | <a href="[link:subscription_manage_url]">' . __("Manage your subscription", 'mailpoet') . '</a><br />' . __("Add your postal address here!", 'mailpoet') . '</p>',
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
"text" => [
|
||||
"fontColor" => "#222222",
|
||||
"fontFamily" => "Arial",
|
||||
"fontSize" => "12px",
|
||||
"textAlign" => "center",
|
||||
],
|
||||
"link" => [
|
||||
"fontColor" => "#6cb7d4",
|
||||
"textDecoration" => "none",
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
"globalStyles" => [
|
||||
"text" => [
|
||||
"fontColor" => "#000000",
|
||||
"fontFamily" => "Arial",
|
||||
"fontSize" => "16px",
|
||||
],
|
||||
"h1" => [
|
||||
"fontColor" => "#111111",
|
||||
"fontFamily" => "Trebuchet MS",
|
||||
"fontSize" => "30px",
|
||||
],
|
||||
"h2" => [
|
||||
"fontColor" => "#222222",
|
||||
"fontFamily" => "Trebuchet MS",
|
||||
"fontSize" => "24px",
|
||||
],
|
||||
"h3" => [
|
||||
"fontColor" => "#333333",
|
||||
"fontFamily" => "Trebuchet MS",
|
||||
"fontSize" => "22px",
|
||||
],
|
||||
"link" => [
|
||||
"fontColor" => "#21759B",
|
||||
"textDecoration" => "underline",
|
||||
],
|
||||
"wrapper" => [
|
||||
"backgroundColor" => "#ffffff",
|
||||
],
|
||||
"body" => [
|
||||
"backgroundColor" => "#eeeeee",
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
private function getThumbnail() {
|
||||
return $this->external_template_image_url . '/thumbnail.20190930.jpg';
|
||||
}
|
||||
}
|
||||
+264
@@ -0,0 +1,264 @@
|
||||
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
|
||||
|
||||
namespace MailPoet\Config\PopulatorData\Templates;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
class NewsletterBlank1Column {
|
||||
|
||||
private $assets_url;
|
||||
private $external_template_image_url;
|
||||
private $template_image_url;
|
||||
private $social_icon_url;
|
||||
|
||||
public function __construct(
|
||||
$assets_url
|
||||
) {
|
||||
$this->assets_url = $assets_url;
|
||||
$this->external_template_image_url = 'https://ps.w.org/mailpoet/assets/newsletter-templates/newsletter-blank-1-column';
|
||||
$this->template_image_url = $this->assets_url . '/img/blank_templates';
|
||||
$this->social_icon_url = $this->assets_url . '/img/newsletter_editor/social-icons';
|
||||
}
|
||||
|
||||
public function get() {
|
||||
return [
|
||||
'name' => __("Newsletter: Blank 1 Column", 'mailpoet'),
|
||||
'categories' => json_encode(['standard', 'blank']),
|
||||
'readonly' => 1,
|
||||
'thumbnail' => $this->getThumbnail(),
|
||||
'body' => json_encode($this->getBody()),
|
||||
];
|
||||
}
|
||||
|
||||
private function getBody() {
|
||||
return [
|
||||
"content" => [
|
||||
"type" => "container",
|
||||
"orientation" => "vertical",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "horizontal",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "#f8f8f8",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "vertical",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "header",
|
||||
"text" => '<a href="[link:newsletter_view_in_browser_url]">' . __("View this in your browser.", 'mailpoet') . '</a>',
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
"text" => [
|
||||
"fontColor" => "#222222",
|
||||
"fontFamily" => "Arial",
|
||||
"fontSize" => "12px",
|
||||
"textAlign" => "center",
|
||||
],
|
||||
"link" => [
|
||||
"fontColor" => "#6cb7d4",
|
||||
"textDecoration" => "underline",
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "horizontal",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "#ffffff",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "vertical",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "spacer",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
"height" => "30px",
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "image",
|
||||
"link" => "",
|
||||
"src" => $this->template_image_url . "/fake-logo.png",
|
||||
"alt" => __("Fake logo", 'mailpoet'),
|
||||
"fullWidth" => false,
|
||||
"width" => "598px",
|
||||
"height" => "71px",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"textAlign" => "center",
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "text",
|
||||
"text" => __("<h1 style=\"text-align: center;\"><strong>Let's Get Started! </strong></h1>\n<p> </p>\n<p>It's time to design your newsletter! In the right sidebar, you'll find 4 menu items that will help you customize your newsletter:</p>\n<ol>\n<li>Content</li>\n<li>Columns</li>\n<li>Styles</li>\n<li>Preview</li>\n</ol>", 'mailpoet'),
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "horizontal",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "#f8f8f8",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "vertical",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "divider",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
"padding" => "24.5px",
|
||||
"borderStyle" => "solid",
|
||||
"borderWidth" => "3px",
|
||||
"borderColor" => "#aaaaaa",
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "social",
|
||||
"iconSet" => "grey",
|
||||
"icons" => [
|
||||
[
|
||||
"type" => "socialIcon",
|
||||
"iconType" => "facebook",
|
||||
"link" => "http://www.facebook.com",
|
||||
"image" => $this->social_icon_url . "/02-grey/Facebook.png",
|
||||
"height" => "32px",
|
||||
"width" => "32px",
|
||||
"text" => "Facebook",
|
||||
],
|
||||
[
|
||||
"type" => "socialIcon",
|
||||
"iconType" => "twitter",
|
||||
"link" => "http://www.twitter.com",
|
||||
"image" => $this->social_icon_url . "/02-grey/Twitter.png",
|
||||
"height" => "32px",
|
||||
"width" => "32px",
|
||||
"text" => "Twitter",
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "divider",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
"padding" => "7.5px",
|
||||
"borderStyle" => "solid",
|
||||
"borderWidth" => "3px",
|
||||
"borderColor" => "#aaaaaa",
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "footer",
|
||||
"text" => '<p><a href="[link:subscription_unsubscribe_url]">' . __("Unsubscribe", 'mailpoet') . '</a> | <a href="[link:subscription_manage_url]">' . __("Manage your subscription", 'mailpoet') . '</a><br />' . __("Add your postal address here!", 'mailpoet') . '</p>',
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
"text" => [
|
||||
"fontColor" => "#222222",
|
||||
"fontFamily" => "Arial",
|
||||
"fontSize" => "12px",
|
||||
"textAlign" => "center",
|
||||
],
|
||||
"link" => [
|
||||
"fontColor" => "#6cb7d4",
|
||||
"textDecoration" => "none",
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
"globalStyles" => [
|
||||
"text" => [
|
||||
"fontColor" => "#000000",
|
||||
"fontFamily" => "Arial",
|
||||
"fontSize" => "16px",
|
||||
],
|
||||
"h1" => [
|
||||
"fontColor" => "#111111",
|
||||
"fontFamily" => "Trebuchet MS",
|
||||
"fontSize" => "30px",
|
||||
],
|
||||
"h2" => [
|
||||
"fontColor" => "#222222",
|
||||
"fontFamily" => "Trebuchet MS",
|
||||
"fontSize" => "24px",
|
||||
],
|
||||
"h3" => [
|
||||
"fontColor" => "#333333",
|
||||
"fontFamily" => "Trebuchet MS",
|
||||
"fontSize" => "22px",
|
||||
],
|
||||
"link" => [
|
||||
"fontColor" => "#21759B",
|
||||
"textDecoration" => "underline",
|
||||
],
|
||||
"wrapper" => [
|
||||
"backgroundColor" => "#ffffff",
|
||||
],
|
||||
"body" => [
|
||||
"backgroundColor" => "#eeeeee",
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
private function getThumbnail() {
|
||||
return $this->external_template_image_url . '/thumbnail.20190411-1500.jpg';
|
||||
}
|
||||
}
|
||||
+1239
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,781 @@
|
||||
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
|
||||
|
||||
namespace MailPoet\Config\PopulatorData\Templates;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
class Phone {
|
||||
|
||||
private $template_image_url;
|
||||
private $social_icon_url;
|
||||
|
||||
public function __construct(
|
||||
$assets_url
|
||||
) {
|
||||
$this->template_image_url = 'https://ps.w.org/mailpoet/assets/newsletter-templates/phone';
|
||||
$this->social_icon_url = $assets_url . '/img/newsletter_editor/social-icons';
|
||||
}
|
||||
|
||||
public function get() {
|
||||
return [
|
||||
'name' => __("New Phone Purchase", 'mailpoet'),
|
||||
'categories' => json_encode(['welcome', 'all']),
|
||||
'readonly' => 1,
|
||||
'thumbnail' => $this->getThumbnail(),
|
||||
'body' => json_encode($this->getBody()),
|
||||
];
|
||||
}
|
||||
|
||||
private function getThumbnail() {
|
||||
return $this->template_image_url . '/thumbnail.20190411-1500.jpg';
|
||||
}
|
||||
|
||||
private function getBody() {
|
||||
return [
|
||||
'content' =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'image' =>
|
||||
[
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'image' =>
|
||||
[
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#1b1821',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'image' =>
|
||||
[
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '40px',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/Phone-Logo.png',
|
||||
'alt' => 'Phone-Logo',
|
||||
'fullWidth' => true,
|
||||
'width' => '122px',
|
||||
'height' => '23px',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'image' =>
|
||||
[
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#1b1821',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'image' =>
|
||||
[
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/Phone-Title.png',
|
||||
'alt' => 'Phone-Title',
|
||||
'fullWidth' => true,
|
||||
'width' => '1280px',
|
||||
'height' => '215px',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/Phone-Header.jpg',
|
||||
'alt' => 'Phone-Header',
|
||||
'fullWidth' => true,
|
||||
'width' => '1280px',
|
||||
'height' => '920px',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
2 =>
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '30px',
|
||||
],
|
||||
],
|
||||
],
|
||||
3 =>
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => '<h3 style="text-align: center;"><span style="color: #ffffff;"><strong>Welcome to your brand new Casia 7200.</strong></span></h3>
|
||||
<p style="text-align: center;"><strong><span style="color: #8748d5;">Let\'s get you all set up.</span></strong></p>
|
||||
<p style="text-align: center;"><span style="color: #999999;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur nec nisi quis ex pulvinar molestie. Sed pulvinar placerat justo eu viverra. Pellentesque in interdum eros, a venenatis velit. Fusce finibus convallis augue, ut viverra felis placerat in.</span></p>',
|
||||
],
|
||||
4 =>
|
||||
[
|
||||
'type' => 'button',
|
||||
'text' => 'Get Started',
|
||||
'url' => '',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#8748d5',
|
||||
'borderColor' => '#0074a2',
|
||||
'borderWidth' => '0px',
|
||||
'borderRadius' => '40px',
|
||||
'borderStyle' => 'solid',
|
||||
'width' => '159px',
|
||||
'lineHeight' => '45px',
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '20px',
|
||||
'fontWeight' => 'bold',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
5 =>
|
||||
[
|
||||
'type' => 'divider',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'padding' => '13px',
|
||||
'borderStyle' => 'dashed',
|
||||
'borderWidth' => '2px',
|
||||
'borderColor' => '#2c2c2c',
|
||||
],
|
||||
],
|
||||
],
|
||||
6 =>
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '30px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
2 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'image' =>
|
||||
[
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'image' =>
|
||||
[
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => '<p style="font-size: 11px; text-align: left;"><span style="color: #999999;">Address Line 1</span></p>
|
||||
<p style="font-size: 11px; text-align: left;"><span style="color: #999999;">Address Line 2</span></p>
|
||||
<p style="font-size: 11px; text-align: left;"><span style="color: #999999;">City</span></p>
|
||||
<p style="font-size: 11px; text-align: left;"><span style="color: #999999;">Country</span></p>',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'image' =>
|
||||
[
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/Phone-Logo.png',
|
||||
'alt' => 'Phone-Logo',
|
||||
'fullWidth' => false,
|
||||
'width' => '122px',
|
||||
'height' => '23px',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'social',
|
||||
'iconSet' => 'full-symbol-grey',
|
||||
'icons' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'facebook',
|
||||
'link' => 'http://www.facebook.com',
|
||||
'image' => $this->social_icon_url . '/08-full-symbol-grey/Facebook.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Facebook',
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'twitter',
|
||||
'link' => 'http://www.twitter.com',
|
||||
'image' => $this->social_icon_url . '/08-full-symbol-grey/Twitter.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Twitter',
|
||||
],
|
||||
2 =>
|
||||
[
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'pinterest',
|
||||
'link' => 'http://www.pinterest.com',
|
||||
'image' => $this->social_icon_url . '/08-full-symbol-grey/Pinterest.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Pinterest',
|
||||
],
|
||||
3 =>
|
||||
[
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'linkedin',
|
||||
'link' => 'http://www.linkedin.com',
|
||||
'image' => $this->social_icon_url . '/08-full-symbol-grey/LinkedIn.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'LinkedIn',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
2 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'image' =>
|
||||
[
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => '<p style="text-align: right; font-size: 11px;"><a href="[link:subscription_unsubscribe_url]">' . __("Unsubscribe", 'mailpoet') . '</a></p>
|
||||
<p style="text-align: right; font-size: 11px;"><a href="[link:subscription_manage_url]">' . __("Manage your subscription", 'mailpoet') . '</a></p>',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
'globalStyles' =>
|
||||
[
|
||||
'text' =>
|
||||
[
|
||||
'fontColor' => '#000000',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '15px',
|
||||
],
|
||||
'h1' =>
|
||||
[
|
||||
'fontColor' => '#111111',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '30px',
|
||||
],
|
||||
'h2' =>
|
||||
[
|
||||
'fontColor' => '#222222',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '24px',
|
||||
],
|
||||
'h3' =>
|
||||
[
|
||||
'fontColor' => '#333333',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '22px',
|
||||
],
|
||||
'link' =>
|
||||
[
|
||||
'fontColor' => '#8748d5',
|
||||
'textDecoration' => 'underline',
|
||||
],
|
||||
'wrapper' =>
|
||||
[
|
||||
'backgroundColor' => '#1b1821',
|
||||
],
|
||||
'body' =>
|
||||
[
|
||||
'backgroundColor' => '#1b1821',
|
||||
],
|
||||
],
|
||||
'blockDefaults' =>
|
||||
[
|
||||
'automatedLatestContent' =>
|
||||
[
|
||||
'amount' => '5',
|
||||
'withLayout' => false,
|
||||
'contentType' => 'post',
|
||||
'inclusionType' => 'include',
|
||||
'displayType' => 'excerpt',
|
||||
'titleFormat' => 'h1',
|
||||
'titleAlignment' => 'left',
|
||||
'titleIsLink' => false,
|
||||
'imageFullWidth' => false,
|
||||
'featuredImagePosition' => 'belowTitle',
|
||||
'showAuthor' => 'no',
|
||||
'authorPrecededBy' => 'Author:',
|
||||
'showCategories' => 'no',
|
||||
'categoriesPrecededBy' => 'Categories:',
|
||||
'readMoreType' => 'button',
|
||||
'readMoreText' => 'Read more',
|
||||
'readMoreButton' =>
|
||||
[
|
||||
'text' => 'Read more',
|
||||
'url' => '[postLink]',
|
||||
'context' => 'automatedLatestContent.readMoreButton',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#2ea1cd',
|
||||
'borderColor' => '#0074a2',
|
||||
'borderWidth' => '1px',
|
||||
'borderRadius' => '5px',
|
||||
'borderStyle' => 'solid',
|
||||
'width' => '180px',
|
||||
'lineHeight' => '40px',
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Verdana',
|
||||
'fontSize' => '18px',
|
||||
'fontWeight' => 'normal',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
'sortBy' => 'newest',
|
||||
'showDivider' => true,
|
||||
'divider' =>
|
||||
[
|
||||
'context' => 'automatedLatestContent.divider',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'padding' => '13px',
|
||||
'borderStyle' => 'solid',
|
||||
'borderWidth' => '3px',
|
||||
'borderColor' => '#aaaaaa',
|
||||
],
|
||||
],
|
||||
],
|
||||
'backgroundColor' => '#ffffff',
|
||||
'backgroundColorAlternate' => '#eeeeee',
|
||||
],
|
||||
'automatedLatestContentLayout' =>
|
||||
[
|
||||
'amount' => '5',
|
||||
'withLayout' => true,
|
||||
'contentType' => 'post',
|
||||
'inclusionType' => 'include',
|
||||
'displayType' => 'excerpt',
|
||||
'titleFormat' => 'h1',
|
||||
'titleAlignment' => 'left',
|
||||
'titleIsLink' => false,
|
||||
'imageFullWidth' => false,
|
||||
'featuredImagePosition' => 'alternate',
|
||||
'showAuthor' => 'no',
|
||||
'authorPrecededBy' => 'Author:',
|
||||
'showCategories' => 'no',
|
||||
'categoriesPrecededBy' => 'Categories:',
|
||||
'readMoreType' => 'button',
|
||||
'readMoreText' => 'Read more',
|
||||
'readMoreButton' =>
|
||||
[
|
||||
'text' => 'Read more',
|
||||
'url' => '[postLink]',
|
||||
'context' => 'automatedLatestContentLayout.readMoreButton',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#2ea1cd',
|
||||
'borderColor' => '#0074a2',
|
||||
'borderWidth' => '1px',
|
||||
'borderRadius' => '5px',
|
||||
'borderStyle' => 'solid',
|
||||
'width' => '180px',
|
||||
'lineHeight' => '40px',
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Verdana',
|
||||
'fontSize' => '18px',
|
||||
'fontWeight' => 'normal',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
'sortBy' => 'newest',
|
||||
'showDivider' => true,
|
||||
'divider' =>
|
||||
[
|
||||
'context' => 'automatedLatestContentLayout.divider',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'padding' => '13px',
|
||||
'borderStyle' => 'solid',
|
||||
'borderWidth' => '3px',
|
||||
'borderColor' => '#aaaaaa',
|
||||
],
|
||||
],
|
||||
],
|
||||
'backgroundColor' => '#ffffff',
|
||||
'backgroundColorAlternate' => '#eeeeee',
|
||||
],
|
||||
'button' =>
|
||||
[
|
||||
'text' => 'Button',
|
||||
'url' => '',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#2ea1cd',
|
||||
'borderColor' => '#0074a2',
|
||||
'borderWidth' => '1px',
|
||||
'borderRadius' => '5px',
|
||||
'borderStyle' => 'solid',
|
||||
'width' => '180px',
|
||||
'lineHeight' => '40px',
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Verdana',
|
||||
'fontSize' => '18px',
|
||||
'fontWeight' => 'normal',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
'divider' =>
|
||||
[
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'padding' => '13px',
|
||||
'borderStyle' => 'solid',
|
||||
'borderWidth' => '3px',
|
||||
'borderColor' => '#aaaaaa',
|
||||
],
|
||||
],
|
||||
],
|
||||
'footer' =>
|
||||
[
|
||||
'text' => '<p><a href="[link:subscription_unsubscribe_url]">' . __("Unsubscribe", 'mailpoet') . '</a> | <a href="[link:subscription_manage_url]">' . __("Manage your subscription", 'mailpoet') . '</a><br />' . __("Add your postal address here!", 'mailpoet') . '</p>',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
'text' =>
|
||||
[
|
||||
'fontColor' => '#222222',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '12px',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
'link' =>
|
||||
[
|
||||
'fontColor' => '#6cb7d4',
|
||||
'textDecoration' => 'none',
|
||||
],
|
||||
],
|
||||
],
|
||||
'posts' =>
|
||||
[
|
||||
'amount' => '10',
|
||||
'withLayout' => true,
|
||||
'contentType' => 'post',
|
||||
'postStatus' => 'publish',
|
||||
'inclusionType' => 'include',
|
||||
'displayType' => 'excerpt',
|
||||
'titleFormat' => 'h1',
|
||||
'titleAlignment' => 'left',
|
||||
'titleIsLink' => false,
|
||||
'imageFullWidth' => false,
|
||||
'featuredImagePosition' => 'alternate',
|
||||
'showAuthor' => 'no',
|
||||
'authorPrecededBy' => 'Author:',
|
||||
'showCategories' => 'no',
|
||||
'categoriesPrecededBy' => 'Categories:',
|
||||
'readMoreType' => 'link',
|
||||
'readMoreText' => 'Read more',
|
||||
'readMoreButton' =>
|
||||
[
|
||||
'text' => 'Read more',
|
||||
'url' => '[postLink]',
|
||||
'context' => 'posts.readMoreButton',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#2ea1cd',
|
||||
'borderColor' => '#0074a2',
|
||||
'borderWidth' => '1px',
|
||||
'borderRadius' => '5px',
|
||||
'borderStyle' => 'solid',
|
||||
'width' => '180px',
|
||||
'lineHeight' => '40px',
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Verdana',
|
||||
'fontSize' => '18px',
|
||||
'fontWeight' => 'normal',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
'sortBy' => 'newest',
|
||||
'showDivider' => true,
|
||||
'divider' =>
|
||||
[
|
||||
'context' => 'posts.divider',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'padding' => '13px',
|
||||
'borderStyle' => 'solid',
|
||||
'borderWidth' => '3px',
|
||||
'borderColor' => '#aaaaaa',
|
||||
],
|
||||
],
|
||||
],
|
||||
'backgroundColor' => '#ffffff',
|
||||
'backgroundColorAlternate' => '#eeeeee',
|
||||
],
|
||||
'social' =>
|
||||
[
|
||||
'iconSet' => 'default',
|
||||
'icons' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'facebook',
|
||||
'link' => 'http://www.facebook.com',
|
||||
'image' => $this->social_icon_url . '/01-social/Facebook.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Facebook',
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'twitter',
|
||||
'link' => 'http://www.twitter.com',
|
||||
'image' => $this->social_icon_url . '/01-social/Twitter.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Twitter',
|
||||
],
|
||||
],
|
||||
],
|
||||
'spacer' =>
|
||||
[
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '40px',
|
||||
],
|
||||
],
|
||||
],
|
||||
'header' =>
|
||||
[
|
||||
'text' => '<a href="[link:newsletter_view_in_browser_url]">' . __("View this in your browser.", 'mailpoet') . '</a>',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
'text' =>
|
||||
[
|
||||
'fontColor' => '#222222',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '12px',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
'link' =>
|
||||
[
|
||||
'fontColor' => '#6cb7d4',
|
||||
'textDecoration' => 'underline',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,448 @@
|
||||
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
|
||||
|
||||
namespace MailPoet\Config\PopulatorData\Templates;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
class PieceOfCake {
|
||||
|
||||
private $template_image_url;
|
||||
private $social_icon_url;
|
||||
|
||||
public function __construct(
|
||||
$assets_url
|
||||
) {
|
||||
$this->template_image_url = 'https://ps.w.org/mailpoet/assets/newsletter-templates/piece_of_cake';
|
||||
$this->social_icon_url = $assets_url . '/img/newsletter_editor/social-icons';
|
||||
}
|
||||
|
||||
public function get() {
|
||||
return [
|
||||
'name' => __("Piece of cake", 'mailpoet'),
|
||||
'categories' => json_encode(['standard', 'all']),
|
||||
'readonly' => 1,
|
||||
'thumbnail' => $this->getThumbnail(),
|
||||
'body' => json_encode($this->getBody()),
|
||||
];
|
||||
}
|
||||
|
||||
private function getBody() {
|
||||
return [
|
||||
'content' => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#ffffff',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'header',
|
||||
'text' => '<p><strong>Open daily from 9am to 9pm | <a href="[link:newsletter_view_in_browser_url]">' . __("View this in your browser.", 'mailpoet') . '</a></strong></p>',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#ececeb',
|
||||
],
|
||||
'text' => [
|
||||
'fontColor' => '#606060',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '13px',
|
||||
'textAlign' => 'right',
|
||||
],
|
||||
'link' => [
|
||||
'fontColor' => '#d42b2b',
|
||||
'textDecoration' => 'none',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '30px',
|
||||
],
|
||||
],
|
||||
],
|
||||
2 => [
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/Restaurant-Bakery-Logo-1.png',
|
||||
'alt' => 'Restaurant-Bakery-Logo-1',
|
||||
'fullWidth' => true,
|
||||
'width' => '1280px',
|
||||
'height' => '180px',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
3 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '30px',
|
||||
],
|
||||
],
|
||||
],
|
||||
4 => [
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/Restaurant-Bakery-Header.jpg',
|
||||
'alt' => 'Restaurant-Bakery-Header',
|
||||
'fullWidth' => true,
|
||||
'width' => '1280px',
|
||||
'height' => '1600px',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
5 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '40px',
|
||||
],
|
||||
],
|
||||
],
|
||||
6 => [
|
||||
'type' => 'text',
|
||||
'text' => '<h1 style="text-align: center;"><strong>It\'s our Birthday!</strong></h1>',
|
||||
],
|
||||
7 => [
|
||||
'type' => 'text',
|
||||
'text' => '<h3 style="text-align: center; line-height: 1.4;">To celebrate, we\'re adding a slice of our Birthday cake to every order. Pop in this weekend to use our special offer code and enjoy!</h3>',
|
||||
],
|
||||
8 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'text',
|
||||
'text' => '<p style="text-align: center; border: 3px dashed #d42b2b; color: #d42b2b; padding: 10px; font-size: 24px;"><strong>HAPPYBDAY</strong></p>',
|
||||
],
|
||||
],
|
||||
],
|
||||
2 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
2 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '50px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
3 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#ececeb',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
4 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#ececeb',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'text',
|
||||
'text' => '<p style="background-color: #ececeb; line-height: 1.3;"><span style="font-weight: 600;"><span style="font-size: 12px; text-align: center;">Add your postal address here.</span></span></p>',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'social',
|
||||
'iconSet' => 'full-symbol-color',
|
||||
'icons' => [
|
||||
0 => [
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'facebook',
|
||||
'link' => 'http://www.facebook.com',
|
||||
'image' => $this->social_icon_url . '/06-full-symbol-color/Facebook.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Facebook',
|
||||
],
|
||||
1 => [
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'twitter',
|
||||
'link' => 'http://www.twitter.com',
|
||||
'image' => $this->social_icon_url . '/06-full-symbol-color/Twitter.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Twitter',
|
||||
],
|
||||
2 => [
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'youtube',
|
||||
'link' => 'http://www.youtube.com',
|
||||
'image' => $this->social_icon_url . '/06-full-symbol-color/Youtube.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Youtube',
|
||||
],
|
||||
3 => [
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'instagram',
|
||||
'link' => 'http://instagram.com',
|
||||
'image' => $this->social_icon_url . '/06-full-symbol-color/Instagram.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Instagram',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
2 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'text',
|
||||
'text' => '<p style="text-align: right; line-height: 1.3;"><strong><a href="[link:subscription_unsubscribe_url]" style="color: #d42b2b; text-decoration: none; font-size: 12px; text-align: center;">' . __("Unsubscribe", 'mailpoet') . '</a></strong></p>
|
||||
<p style="text-align: right; line-height: 1.3;"><strong><a href="[link:subscription_manage_url]" style="color: #d42b2b; text-decoration: none; font-size: 12px; text-align: center;">Manage Subscription</a></strong></p>',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
5 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#ececeb',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '40px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
'globalStyles' => [
|
||||
'text' => [
|
||||
'fontColor' => '#606060',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '16px',
|
||||
],
|
||||
'h1' => [
|
||||
'fontColor' => '#606060',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '30px',
|
||||
],
|
||||
'h2' => [
|
||||
'fontColor' => '#d42b2b',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '24px',
|
||||
],
|
||||
'h3' => [
|
||||
'fontColor' => '#606060',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '20px',
|
||||
],
|
||||
'link' => [
|
||||
'fontColor' => '#d42b2b',
|
||||
'textDecoration' => 'underline',
|
||||
],
|
||||
'wrapper' => [
|
||||
'backgroundColor' => '#ffffff',
|
||||
],
|
||||
'body' => [
|
||||
'backgroundColor' => '#ececeb',
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
private function getThumbnail() {
|
||||
return $this->template_image_url . '/thumbnail.20190411-1500.jpg';
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
+351
@@ -0,0 +1,351 @@
|
||||
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
|
||||
|
||||
namespace MailPoet\Config\PopulatorData\Templates;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
class PostNotificationsBlank1Column {
|
||||
|
||||
private $assets_url;
|
||||
private $external_template_image_url;
|
||||
private $template_image_url;
|
||||
private $social_icon_url;
|
||||
|
||||
public function __construct(
|
||||
$assets_url
|
||||
) {
|
||||
$this->assets_url = $assets_url;
|
||||
$this->external_template_image_url = 'https://ps.w.org/mailpoet/assets/newsletter-templates/post-notifications-blank-1-column';
|
||||
$this->template_image_url = $this->assets_url . '/img/blank_templates';
|
||||
$this->social_icon_url = $this->assets_url . '/img/newsletter_editor/social-icons';
|
||||
}
|
||||
|
||||
public function get() {
|
||||
return [
|
||||
'name' => __("Post Notifications: Blank 1 Column", 'mailpoet'),
|
||||
'categories' => json_encode(['notification', 'blank']),
|
||||
'readonly' => 1,
|
||||
'thumbnail' => $this->getThumbnail(),
|
||||
'body' => json_encode($this->getBody()),
|
||||
];
|
||||
}
|
||||
|
||||
private function getBody() {
|
||||
return [
|
||||
"content" => [
|
||||
"type" => "container",
|
||||
"orientation" => "vertical",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "horizontal",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "#f8f8f8",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "vertical",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "header",
|
||||
"text" => '<a href="[link:newsletter_view_in_browser_url]">' . __("View this in your browser.", 'mailpoet') . '</a>',
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
"text" => [
|
||||
"fontColor" => "#222222",
|
||||
"fontFamily" => "Arial",
|
||||
"fontSize" => "12px",
|
||||
"textAlign" => "center",
|
||||
],
|
||||
"link" => [
|
||||
"fontColor" => "#6cb7d4",
|
||||
"textDecoration" => "underline",
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "horizontal",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "#ffffff",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "vertical",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "spacer",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
"height" => "30px",
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "image",
|
||||
"link" => "",
|
||||
"src" => $this->template_image_url . "/fake-logo.png",
|
||||
"alt" => "fake-logo",
|
||||
"fullWidth" => false,
|
||||
"width" => "598px",
|
||||
"height" => "71px",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"textAlign" => "center",
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "text",
|
||||
"text" => __("<h1 style=\"text-align: center;\"><strong>Check Out Our New Blog Posts! </strong></h1>\n<p> </p>\n<p>MailPoet can <span style=\"line-height: 1.6em; background-color: inherit;\"><em>automatically</em> </span><span style=\"line-height: 1.6em; background-color: inherit;\">send your new blog posts to your subscribers.</span></p>\n<p><span style=\"line-height: 1.6em; background-color: inherit;\"></span></p>\n<p><span style=\"line-height: 1.6em; background-color: inherit;\">Below, you'll find three recent posts, which are displayed automatically, thanks to the <em>Automatic Latest Content</em> widget, which can be found in the right sidebar, under <em>Content</em>.</span></p>\n<p><span style=\"line-height: 1.6em; background-color: inherit;\"></span></p>\n<p><span style=\"line-height: 1.6em; background-color: inherit;\">To edit the settings and styles of your post, simply click on a post below.</span></p>", 'mailpoet'),
|
||||
],
|
||||
[
|
||||
"type" => "divider",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
"padding" => "13px",
|
||||
"borderStyle" => "dotted",
|
||||
"borderWidth" => "3px",
|
||||
"borderColor" => "#aaaaaa",
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "spacer",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
"height" => "40px",
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "automatedLatestContentLayout",
|
||||
"withLayout" => true,
|
||||
"amount" => "3",
|
||||
"contentType" => "post",
|
||||
"terms" => [],
|
||||
"inclusionType" => "include",
|
||||
"displayType" => "excerpt",
|
||||
"titleFormat" => "h3",
|
||||
"titleAlignment" => "left",
|
||||
"titleIsLink" => false,
|
||||
"imageFullWidth" => false,
|
||||
"featuredImagePosition" => "alternate",
|
||||
"showAuthor" => "no",
|
||||
"authorPrecededBy" => __("Author:", 'mailpoet'),
|
||||
"showCategories" => "no",
|
||||
"categoriesPrecededBy" => __("Categories:", 'mailpoet'),
|
||||
"readMoreType" => "button",
|
||||
"readMoreText" => "Read more",
|
||||
"readMoreButton" => [
|
||||
"type" => "button",
|
||||
"text" => __("Read the post", 'mailpoet'),
|
||||
"url" => "[postLink]",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "#2ea1cd",
|
||||
"borderColor" => "#0074a2",
|
||||
"borderWidth" => "1px",
|
||||
"borderRadius" => "5px",
|
||||
"borderStyle" => "solid",
|
||||
"width" => "160px",
|
||||
"lineHeight" => "30px",
|
||||
"fontColor" => "#ffffff",
|
||||
"fontFamily" => "Verdana",
|
||||
"fontSize" => "16px",
|
||||
"fontWeight" => "normal",
|
||||
"textAlign" => "center",
|
||||
],
|
||||
],
|
||||
],
|
||||
"sortBy" => "newest",
|
||||
"showDivider" => true,
|
||||
"divider" => [
|
||||
"type" => "divider",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
"padding" => "13px",
|
||||
"borderStyle" => "solid",
|
||||
"borderWidth" => "3px",
|
||||
"borderColor" => "#aaaaaa",
|
||||
],
|
||||
],
|
||||
],
|
||||
"backgroundColor" => "#ffffff",
|
||||
"backgroundColorAlternate" => "#eeeeee",
|
||||
],
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "horizontal",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "#f8f8f8",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "vertical",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "spacer",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
"height" => "40px",
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "divider",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
"padding" => "24.5px",
|
||||
"borderStyle" => "solid",
|
||||
"borderWidth" => "3px",
|
||||
"borderColor" => "#aaaaaa",
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "social",
|
||||
"iconSet" => "grey",
|
||||
"icons" => [
|
||||
[
|
||||
"type" => "socialIcon",
|
||||
"iconType" => "facebook",
|
||||
"link" => "http://www.facebook.com",
|
||||
"image" => $this->social_icon_url . "/02-grey/Facebook.png",
|
||||
"height" => "32px",
|
||||
"width" => "32px",
|
||||
"text" => "Facebook",
|
||||
],
|
||||
[
|
||||
"type" => "socialIcon",
|
||||
"iconType" => "twitter",
|
||||
"link" => "http://www.twitter.com",
|
||||
"image" => $this->social_icon_url . "/02-grey/Twitter.png",
|
||||
"height" => "32px",
|
||||
"width" => "32px",
|
||||
"text" => "Twitter",
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "divider",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
"padding" => "7.5px",
|
||||
"borderStyle" => "solid",
|
||||
"borderWidth" => "3px",
|
||||
"borderColor" => "#aaaaaa",
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "footer",
|
||||
"text" => '<p><a href="[link:subscription_unsubscribe_url]">' . __("Unsubscribe", 'mailpoet') . '</a> | <a href="[link:subscription_manage_url]">' . __("Manage your subscription", 'mailpoet') . '</a><br />' . __("Add your postal address here!", 'mailpoet') . '</p>',
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
"text" => [
|
||||
"fontColor" => "#222222",
|
||||
"fontFamily" => "Arial",
|
||||
"fontSize" => "12px",
|
||||
"textAlign" => "center",
|
||||
],
|
||||
"link" => [
|
||||
"fontColor" => "#6cb7d4",
|
||||
"textDecoration" => "none",
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
"globalStyles" => [
|
||||
"text" => [
|
||||
"fontColor" => "#000000",
|
||||
"fontFamily" => "Arial",
|
||||
"fontSize" => "16px",
|
||||
],
|
||||
"h1" => [
|
||||
"fontColor" => "#111111",
|
||||
"fontFamily" => "Trebuchet MS",
|
||||
"fontSize" => "30px",
|
||||
],
|
||||
"h2" => [
|
||||
"fontColor" => "#222222",
|
||||
"fontFamily" => "Trebuchet MS",
|
||||
"fontSize" => "24px",
|
||||
],
|
||||
"h3" => [
|
||||
"fontColor" => "#333333",
|
||||
"fontFamily" => "Trebuchet MS",
|
||||
"fontSize" => "22px",
|
||||
],
|
||||
"link" => [
|
||||
"fontColor" => "#21759B",
|
||||
"textDecoration" => "underline",
|
||||
],
|
||||
"wrapper" => [
|
||||
"backgroundColor" => "#ffffff",
|
||||
],
|
||||
"body" => [
|
||||
"backgroundColor" => "#eeeeee",
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
private function getThumbnail() {
|
||||
return $this->external_template_image_url . '/thumbnail.20190411-1500.jpg';
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+665
@@ -0,0 +1,665 @@
|
||||
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
|
||||
|
||||
namespace MailPoet\Config\PopulatorData\Templates;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
class RetroComputingMagazine {
|
||||
|
||||
private $template_image_url;
|
||||
private $social_icon_url;
|
||||
|
||||
public function __construct(
|
||||
$assets_url
|
||||
) {
|
||||
$this->template_image_url = 'https://ps.w.org/mailpoet/assets/newsletter-templates/retro_computing_magazine';
|
||||
$this->social_icon_url = $assets_url . '/img/newsletter_editor/social-icons';
|
||||
}
|
||||
|
||||
public function get() {
|
||||
return [
|
||||
'name' => __("Retro Computing Magazine", 'mailpoet'),
|
||||
'categories' => json_encode(['standard', 'all']),
|
||||
'readonly' => 1,
|
||||
'thumbnail' => $this->getThumbnail(),
|
||||
'body' => json_encode($this->getBody()),
|
||||
];
|
||||
}
|
||||
|
||||
private function getThumbnail() {
|
||||
return $this->template_image_url . '/thumbnail.20190411-1500.jpg';
|
||||
}
|
||||
|
||||
private function getBody() {
|
||||
return [
|
||||
'content' =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#4473a1',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#008282',
|
||||
'height' => '40px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#f8f8f8',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/Windows94-Header.png',
|
||||
'alt' => 'Windows94-Header',
|
||||
'fullWidth' => true,
|
||||
'width' => '1280px',
|
||||
'height' => '740px',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
2 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#ffffff',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'header',
|
||||
'text' => '<p><span style="color: #ffffff;"><a href="[link:newsletter_view_in_browser_url]" style="color: #ffffff;">' . __("View this in your browser.", 'mailpoet') . '</a></span></p>',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#008282',
|
||||
],
|
||||
'text' =>
|
||||
[
|
||||
'fontColor' => '#222222',
|
||||
'fontFamily' => 'Courier New',
|
||||
'fontSize' => '12px',
|
||||
'textAlign' => 'left',
|
||||
],
|
||||
'link' =>
|
||||
[
|
||||
'fontColor' => '#6cb7d4',
|
||||
'textDecoration' => 'underline',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '30px',
|
||||
],
|
||||
],
|
||||
],
|
||||
2 =>
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => '<h1 style="text-align: left;"><strong>We\'re upgrading!</strong></h1>
|
||||
<p><span>Lorem ipsum dolor sit amet, consectetur adipiscing elit. In elementum nunc vel est congue, a venenatis nunc aliquet. Curabitur luctus, nulla et dignissim elementum, ipsum eros fermentum nulla, non cursus eros mi eu velit. Nunc ex nibh, porta vulputate pharetra ac, placerat sed orci. Etiam enim enim, aliquet nec ligula in, ultrices iaculis dolor. Suspendisse potenti. Praesent fringilla augue ut lorem mattis, vitae fringilla nunc faucibus. </span></p>
|
||||
<p><span></span></p>
|
||||
<p><span>Quisque in leo felis. Etiam at libero et enim tincidunt scelerisque. Ut felis lectus, imperdiet quis justo quis, elementum sagittis tellus. Sed elementum, lacus at iaculis vestibulum, nunc leo gravida nisi, sed dapibus nisi odio ac ex. Aliquam id arcu dictum, cursus quam id, eleifend libero.</span></p>',
|
||||
],
|
||||
3 =>
|
||||
[
|
||||
'type' => 'divider',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'padding' => '13px',
|
||||
'borderStyle' => 'ridge',
|
||||
'borderWidth' => '3px',
|
||||
'borderColor' => '#aaaaaa',
|
||||
],
|
||||
],
|
||||
],
|
||||
4 =>
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
5 =>
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => '<h1><strong>Latest News</strong></h1>',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
3 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => '<h3 style="text-align: left;"><strong>What is it like to use a Windows 98 PC in 2017?</strong></h3>',
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => '<p class="mailpoet_wp_post"><span>Computers are much more advanced than they were even a few years ago, but of course we all like to complain about the dumb things they sometimes do. It’s easy to forget how clunky things used to be, though...</span></p>
|
||||
<p><a href="http://mailpoet.info/odds-on-10-science-breakthroughs-you-can-bet-on/">Read more</a></p>',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => '<h3 style="text-align: left;"><strong>Windows 95 still finds life online</strong></h3>',
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => '<p class="mailpoet_wp_post">Microsoft’s Windows 95 has reached the ripe old age of 22 this year and to commemorate this milestone, TheNextWeb goes into some details about the operating system that users may have missed over the years...</p>
|
||||
<p><a href="http://mailpoet.info/brazils-history-making-hurricane/">Read more</a></p>',
|
||||
],
|
||||
],
|
||||
],
|
||||
2 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => '<h3 style="text-align: left;"><strong>New Sinclair ZX Spectrum Fully Funded</strong></h3>',
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => '<p class="mailpoet_wp_post">The new Sinclair ZX Spectrum Next home computer which was launched on Kickstarter to mark the 35th birthday of the original Spectrum produced by Sinclair Research has been fully funded in less than 48 hours...</p>
|
||||
<p><a href="http://mailpoet.info/cutting-through-the-smog-what-to-do-to-fight-air-pollution/">Read more</a></p>',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
4 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '35px',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#008282',
|
||||
'height' => '50px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
5 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#008282',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => '<h2><strong><span style="color: #ffffff;">Did you know?</span></strong></h2>
|
||||
<p><span style="color: #ffffff;">At the time of creation and development, the microcomputers in Japan were not powerful enough to handle the complex tasks related to the design and programming of Space Invaders. Nishikado then designed his own hardware and developmental tools to make the game a reality.</span></p>
|
||||
<p><strong><span style="color: #ffffff;"></span></strong></p>',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/Windows94-Today.png',
|
||||
'alt' => 'Windows94-Today',
|
||||
'fullWidth' => false,
|
||||
'width' => '364px',
|
||||
'height' => '291px',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
6 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#008282',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
7 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#f8f8f8',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => '<p style="text-align: center;"><strong>Let\'s get social!</strong></p>',
|
||||
],
|
||||
2 =>
|
||||
[
|
||||
'type' => 'social',
|
||||
'iconSet' => 'grey',
|
||||
'icons' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'facebook',
|
||||
'link' => 'http://www.facebook.com',
|
||||
'image' => $this->social_icon_url . '/02-grey/Facebook.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Facebook',
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'twitter',
|
||||
'link' => 'http://www.twitter.com',
|
||||
'image' => $this->social_icon_url . '/02-grey/Twitter.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Twitter',
|
||||
],
|
||||
2 =>
|
||||
[
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'youtube',
|
||||
'link' => 'http://www.youtube.com',
|
||||
'image' => $this->social_icon_url . '/02-grey/Youtube.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Youtube',
|
||||
],
|
||||
3 =>
|
||||
[
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'email',
|
||||
'link' => '',
|
||||
'image' => $this->social_icon_url . '/02-grey/Email.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Email',
|
||||
],
|
||||
],
|
||||
],
|
||||
3 =>
|
||||
[
|
||||
'type' => 'footer',
|
||||
'text' => '<p><a href="[link:subscription_unsubscribe_url]">' . __("Unsubscribe", 'mailpoet') . '</a> | <a href="[link:subscription_manage_url]">' . __("Manage your subscription", 'mailpoet') . '</a><br />' . __("Add your postal address here!", 'mailpoet') . '</p>',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
'text' =>
|
||||
[
|
||||
'fontColor' => '#222222',
|
||||
'fontFamily' => 'Courier New',
|
||||
'fontSize' => '12px',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
'link' =>
|
||||
[
|
||||
'fontColor' => '#008282',
|
||||
'textDecoration' => 'none',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
'globalStyles' =>
|
||||
[
|
||||
'text' =>
|
||||
[
|
||||
'fontColor' => '#000000',
|
||||
'fontFamily' => 'Courier New',
|
||||
'fontSize' => '14px',
|
||||
],
|
||||
'h1' =>
|
||||
[
|
||||
'fontColor' => '#111111',
|
||||
'fontFamily' => 'Courier New',
|
||||
'fontSize' => '30px',
|
||||
],
|
||||
'h2' =>
|
||||
[
|
||||
'fontColor' => '#222222',
|
||||
'fontFamily' => 'Courier New',
|
||||
'fontSize' => '24px',
|
||||
],
|
||||
'h3' =>
|
||||
[
|
||||
'fontColor' => '#333333',
|
||||
'fontFamily' => 'Courier New',
|
||||
'fontSize' => '18px',
|
||||
],
|
||||
'link' =>
|
||||
[
|
||||
'fontColor' => '#008282',
|
||||
'textDecoration' => 'underline',
|
||||
],
|
||||
'wrapper' =>
|
||||
[
|
||||
'backgroundColor' => '#ffffff',
|
||||
],
|
||||
'body' =>
|
||||
[
|
||||
'backgroundColor' => '#008282',
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,840 @@
|
||||
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
|
||||
|
||||
namespace MailPoet\Config\PopulatorData\Templates;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
class RssSimpleNews {
|
||||
|
||||
private $template_image_url;
|
||||
private $social_icon_url;
|
||||
|
||||
public function __construct(
|
||||
$assets_url
|
||||
) {
|
||||
$this->template_image_url = 'https://ps.w.org/mailpoet/assets/newsletter-templates/rss-simple-news';
|
||||
$this->social_icon_url = $assets_url . '/img/newsletter_editor/social-icons';
|
||||
}
|
||||
|
||||
public function get() {
|
||||
return [
|
||||
'name' => __("Stripped RSS Style Layout", 'mailpoet'),
|
||||
'categories' => json_encode(['notification', 'all']),
|
||||
'readonly' => 1,
|
||||
'thumbnail' => $this->getThumbnail(),
|
||||
'body' => json_encode($this->getBody()),
|
||||
];
|
||||
}
|
||||
|
||||
private function getThumbnail() {
|
||||
return $this->template_image_url . '/thumbnail.20190411-1500.jpg';
|
||||
}
|
||||
|
||||
private function getBody() {
|
||||
return [
|
||||
'content' =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'image' =>
|
||||
[
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'image' =>
|
||||
[
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#f4f4f4',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'image' =>
|
||||
[
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '25px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'image' =>
|
||||
[
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'image' =>
|
||||
[
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/RSS-Logo-2.png',
|
||||
'alt' => 'RSS-Logo-2',
|
||||
'fullWidth' => true,
|
||||
'width' => '210px',
|
||||
'height' => '90px',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'image' =>
|
||||
[
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
2 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'image' =>
|
||||
[
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '24px',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'social',
|
||||
'iconSet' => 'full-symbol-color',
|
||||
'icons' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'facebook',
|
||||
'link' => 'http://www.facebook.com',
|
||||
'image' => $this->social_icon_url . '/06-full-symbol-color/Facebook.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Facebook',
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'twitter',
|
||||
'link' => 'http://www.twitter.com',
|
||||
'image' => $this->social_icon_url . '/06-full-symbol-color/Twitter.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Twitter',
|
||||
],
|
||||
2 =>
|
||||
[
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'website',
|
||||
'link' => '',
|
||||
'image' => $this->social_icon_url . '/06-full-symbol-color/Website.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Website',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
2 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'image' =>
|
||||
[
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#ffffff',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'image' =>
|
||||
[
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => '<h3 style="text-align: left;"><strong><span style="color: #333333;">Latest RSS Simple Posts</span></strong></h3>
|
||||
<p><span style="color: #999999;">Week 23: 23/19/19</span></p>',
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
2 =>
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
3 =>
|
||||
[
|
||||
'type' => 'automatedLatestContentLayout',
|
||||
'withLayout' => true,
|
||||
'amount' => '5',
|
||||
'contentType' => 'post',
|
||||
'terms' =>
|
||||
[
|
||||
],
|
||||
'inclusionType' => 'include',
|
||||
'displayType' => 'excerpt',
|
||||
'titleFormat' => 'h3',
|
||||
'titleAlignment' => 'left',
|
||||
'titleIsLink' => true,
|
||||
'imageFullWidth' => false,
|
||||
'featuredImagePosition' => 'alternate',
|
||||
'showAuthor' => 'no',
|
||||
'authorPrecededBy' => 'Author:',
|
||||
'showCategories' => 'no',
|
||||
'categoriesPrecededBy' => 'Categories:',
|
||||
'readMoreType' => 'link',
|
||||
'readMoreText' => 'Read more.',
|
||||
'readMoreButton' =>
|
||||
[
|
||||
'type' => 'button',
|
||||
'text' => 'Read more',
|
||||
'url' => '[postLink]',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#2ea1cd',
|
||||
'borderColor' => '#0074a2',
|
||||
'borderWidth' => '1px',
|
||||
'borderRadius' => '5px',
|
||||
'borderStyle' => 'solid',
|
||||
'width' => '180px',
|
||||
'lineHeight' => '40px',
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Verdana',
|
||||
'fontSize' => '18px',
|
||||
'fontWeight' => 'normal',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
'context' => 'automatedLatestContentLayout.readMoreButton',
|
||||
],
|
||||
'sortBy' => 'newest',
|
||||
'showDivider' => true,
|
||||
'divider' =>
|
||||
[
|
||||
'type' => 'divider',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'padding' => '13px',
|
||||
'borderStyle' => 'solid',
|
||||
'borderWidth' => '1px',
|
||||
'borderColor' => '#ececec',
|
||||
],
|
||||
],
|
||||
'context' => 'automatedLatestContentLayout.divider',
|
||||
],
|
||||
'backgroundColor' => '#ffffff',
|
||||
'backgroundColorAlternate' => '#eeeeee',
|
||||
],
|
||||
4 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'image' =>
|
||||
[
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#f4f4f4',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'image' =>
|
||||
[
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '30px',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => '<p><span style="color: #808080;"><strong>RSS Simple</strong></span></p>
|
||||
<p><span style="color: #808080; font-size: 11px;"><strong><a href="[link:subscription_unsubscribe_url]">' . __("Unsubscribe", 'mailpoet') . '</a><span> | </span><a href="[link:subscription_manage_url]">' . __("Manage your subscription", 'mailpoet') . '</a></strong></span></p>
|
||||
<p><span style="color: #808080; font-size: 11px;"><strong><span>' . __("Add your postal address here!", 'mailpoet') . '</span></strong></span></p>',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
'globalStyles' =>
|
||||
[
|
||||
'text' =>
|
||||
[
|
||||
'fontColor' => '#000000',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '15px',
|
||||
],
|
||||
'h1' =>
|
||||
[
|
||||
'fontColor' => '#111111',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '30px',
|
||||
],
|
||||
'h2' =>
|
||||
[
|
||||
'fontColor' => '#222222',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '24px',
|
||||
],
|
||||
'h3' =>
|
||||
[
|
||||
'fontColor' => '#3478f5',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '20px',
|
||||
],
|
||||
'link' =>
|
||||
[
|
||||
'fontColor' => '#3478f5',
|
||||
'textDecoration' => 'none',
|
||||
],
|
||||
'wrapper' =>
|
||||
[
|
||||
'backgroundColor' => '#ffffff',
|
||||
],
|
||||
'body' =>
|
||||
[
|
||||
'backgroundColor' => '#f4f4f4',
|
||||
],
|
||||
],
|
||||
'blockDefaults' =>
|
||||
[
|
||||
'automatedLatestContent' =>
|
||||
[
|
||||
'amount' => '3',
|
||||
'contentType' => 'post',
|
||||
'inclusionType' => 'include',
|
||||
'displayType' => 'excerpt',
|
||||
'titleFormat' => 'h3',
|
||||
'titleAlignment' => 'left',
|
||||
'titleIsLink' => true,
|
||||
'imageFullWidth' => false,
|
||||
'featuredImagePosition' => 'belowTitle',
|
||||
'showAuthor' => 'no',
|
||||
'authorPrecededBy' => 'Author:',
|
||||
'showCategories' => 'no',
|
||||
'categoriesPrecededBy' => 'Categories:',
|
||||
'readMoreType' => 'link',
|
||||
'readMoreText' => 'Read more',
|
||||
'readMoreButton' =>
|
||||
[
|
||||
'text' => 'Read more',
|
||||
'url' => '[postLink]',
|
||||
'context' => 'automatedLatestContent.readMoreButton',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#2ea1cd',
|
||||
'borderColor' => '#0074a2',
|
||||
'borderWidth' => '1px',
|
||||
'borderRadius' => '5px',
|
||||
'borderStyle' => 'solid',
|
||||
'width' => '180px',
|
||||
'lineHeight' => '40px',
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Verdana',
|
||||
'fontSize' => '18px',
|
||||
'fontWeight' => 'normal',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
'type' => 'button',
|
||||
],
|
||||
'sortBy' => 'newest',
|
||||
'showDivider' => true,
|
||||
'divider' =>
|
||||
[
|
||||
'context' => 'automatedLatestContent.divider',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'padding' => '13px',
|
||||
'borderStyle' => 'solid',
|
||||
'borderWidth' => '1px',
|
||||
'borderColor' => '#efe7f0',
|
||||
],
|
||||
],
|
||||
'type' => 'divider',
|
||||
],
|
||||
'backgroundColor' => '#ffffff',
|
||||
'backgroundColorAlternate' => '#eeeeee',
|
||||
'type' => 'automatedLatestContent',
|
||||
'terms' =>
|
||||
[
|
||||
],
|
||||
'withLayout' => false,
|
||||
],
|
||||
'automatedLatestContentLayout' =>
|
||||
[
|
||||
'amount' => '5',
|
||||
'withLayout' => true,
|
||||
'contentType' => 'post',
|
||||
'inclusionType' => 'include',
|
||||
'displayType' => 'excerpt',
|
||||
'titleFormat' => 'h3',
|
||||
'titleAlignment' => 'left',
|
||||
'titleIsLink' => true,
|
||||
'imageFullWidth' => false,
|
||||
'featuredImagePosition' => 'alternate',
|
||||
'showAuthor' => 'no',
|
||||
'authorPrecededBy' => 'Author:',
|
||||
'showCategories' => 'no',
|
||||
'categoriesPrecededBy' => 'Categories:',
|
||||
'readMoreType' => 'link',
|
||||
'readMoreText' => 'Read more.',
|
||||
'readMoreButton' =>
|
||||
[
|
||||
'text' => 'Read more',
|
||||
'url' => '[postLink]',
|
||||
'context' => 'automatedLatestContentLayout.readMoreButton',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#2ea1cd',
|
||||
'borderColor' => '#0074a2',
|
||||
'borderWidth' => '1px',
|
||||
'borderRadius' => '5px',
|
||||
'borderStyle' => 'solid',
|
||||
'width' => '180px',
|
||||
'lineHeight' => '40px',
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Verdana',
|
||||
'fontSize' => '18px',
|
||||
'fontWeight' => 'normal',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
'type' => 'button',
|
||||
],
|
||||
'sortBy' => 'newest',
|
||||
'showDivider' => true,
|
||||
'divider' =>
|
||||
[
|
||||
'context' => 'automatedLatestContentLayout.divider',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'padding' => '13px',
|
||||
'borderStyle' => 'solid',
|
||||
'borderWidth' => '1px',
|
||||
'borderColor' => '#ececec',
|
||||
],
|
||||
],
|
||||
'type' => 'divider',
|
||||
],
|
||||
'backgroundColor' => '#ffffff',
|
||||
'backgroundColorAlternate' => '#eeeeee',
|
||||
'type' => 'automatedLatestContentLayout',
|
||||
'terms' =>
|
||||
[
|
||||
],
|
||||
],
|
||||
'button' =>
|
||||
[
|
||||
'text' => 'Read more',
|
||||
'url' => '[postLink]',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#2ea1cd',
|
||||
'borderColor' => '#0074a2',
|
||||
'borderWidth' => '1px',
|
||||
'borderRadius' => '5px',
|
||||
'borderStyle' => 'solid',
|
||||
'width' => '180px',
|
||||
'lineHeight' => '40px',
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Verdana',
|
||||
'fontSize' => '18px',
|
||||
'fontWeight' => 'normal',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
'type' => 'button',
|
||||
],
|
||||
'container' =>
|
||||
[
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
],
|
||||
'divider' =>
|
||||
[
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'padding' => '13px',
|
||||
'borderStyle' => 'solid',
|
||||
'borderWidth' => '3px',
|
||||
'borderColor' => '#aaaaaa',
|
||||
],
|
||||
],
|
||||
'type' => 'divider',
|
||||
],
|
||||
'footer' =>
|
||||
[
|
||||
'text' => '<p><a href="[link:subscription_unsubscribe_url]">' . __("Unsubscribe", 'mailpoet') . '</a> | <a href="[link:subscription_manage_url]">' . __("Manage your subscription", 'mailpoet') . '</a><br />' . __("Add your postal address here!", 'mailpoet') . '</p>',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
'text' =>
|
||||
[
|
||||
'fontColor' => '#222222',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '12px',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
'link' =>
|
||||
[
|
||||
'fontColor' => '#6cb7d4',
|
||||
'textDecoration' => 'none',
|
||||
],
|
||||
],
|
||||
],
|
||||
'posts' =>
|
||||
[
|
||||
'amount' => '10',
|
||||
'contentType' => 'post',
|
||||
'postStatus' => 'publish',
|
||||
'inclusionType' => 'include',
|
||||
'displayType' => 'excerpt',
|
||||
'titleFormat' => 'h1',
|
||||
'titleAlignment' => 'left',
|
||||
'titleIsLink' => false,
|
||||
'imageFullWidth' => false,
|
||||
'featuredImagePosition' => 'belowTitle',
|
||||
'showAuthor' => 'no',
|
||||
'authorPrecededBy' => 'Author:',
|
||||
'showCategories' => 'no',
|
||||
'categoriesPrecededBy' => 'Categories:',
|
||||
'readMoreType' => 'link',
|
||||
'readMoreText' => 'Read more',
|
||||
'readMoreButton' =>
|
||||
[
|
||||
'text' => 'Read more',
|
||||
'url' => '[postLink]',
|
||||
'context' => 'posts.readMoreButton',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#2ea1cd',
|
||||
'borderColor' => '#0074a2',
|
||||
'borderWidth' => '1px',
|
||||
'borderRadius' => '5px',
|
||||
'borderStyle' => 'solid',
|
||||
'width' => '180px',
|
||||
'lineHeight' => '40px',
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Verdana',
|
||||
'fontSize' => '18px',
|
||||
'fontWeight' => 'normal',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
'sortBy' => 'newest',
|
||||
'showDivider' => true,
|
||||
'divider' =>
|
||||
[
|
||||
'context' => 'posts.divider',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'padding' => '13px',
|
||||
'borderStyle' => 'solid',
|
||||
'borderWidth' => '3px',
|
||||
'borderColor' => '#aaaaaa',
|
||||
],
|
||||
],
|
||||
],
|
||||
'backgroundColor' => '#ffffff',
|
||||
'backgroundColorAlternate' => '#eeeeee',
|
||||
],
|
||||
'social' =>
|
||||
[
|
||||
'iconSet' => 'default',
|
||||
'icons' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'facebook',
|
||||
'link' => 'http://www.facebook.com',
|
||||
'image' => $this->social_icon_url . '/01-social/Facebook.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Facebook',
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'twitter',
|
||||
'link' => 'http://www.twitter.com',
|
||||
'image' => $this->social_icon_url . '/01-social/Twitter.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Twitter',
|
||||
],
|
||||
],
|
||||
],
|
||||
'spacer' =>
|
||||
[
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '40px',
|
||||
],
|
||||
],
|
||||
],
|
||||
'header' =>
|
||||
[
|
||||
'text' => '<a href="[link:newsletter_view_in_browser_url]">' . __("View this in your browser.", 'mailpoet') . '</a>',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
'text' =>
|
||||
[
|
||||
'fontColor' => '#222222',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '12px',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
'link' =>
|
||||
[
|
||||
'fontColor' => '#6cb7d4',
|
||||
'textDecoration' => 'underline',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,583 @@
|
||||
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
|
||||
|
||||
namespace MailPoet\Config\PopulatorData\Templates;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
class Shoes {
|
||||
|
||||
private $template_image_url;
|
||||
private $social_icon_url;
|
||||
|
||||
public function __construct(
|
||||
$assets_url
|
||||
) {
|
||||
$this->template_image_url = 'https://ps.w.org/mailpoet/assets/newsletter-templates/shoes';
|
||||
$this->social_icon_url = $assets_url . '/img/newsletter_editor/social-icons';
|
||||
}
|
||||
|
||||
public function get() {
|
||||
return [
|
||||
'name' => __("Shoes", 'mailpoet'),
|
||||
'categories' => json_encode(['standard', 'all']),
|
||||
'readonly' => 1,
|
||||
'thumbnail' => $this->getThumbnail(),
|
||||
'body' => json_encode($this->getBody()),
|
||||
];
|
||||
}
|
||||
|
||||
private function getBody() {
|
||||
return [
|
||||
'content' => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#f6f6f6',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/Retail-Shoes-Logo.png',
|
||||
'alt' => 'Retail-Shoes-Logo',
|
||||
'fullWidth' => true,
|
||||
'width' => '1280px',
|
||||
'height' => '220px',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#ffffff',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/Retail-Shoes-Header.jpg',
|
||||
'alt' => 'Retail-Shoes-Header',
|
||||
'fullWidth' => true,
|
||||
'width' => '1280px',
|
||||
'height' => '700px',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
2 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#f1b512',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'text',
|
||||
'text' => '<h2 style="text-align: center;"><span style="color: #614a0d;">Our New Range</span></h2>
|
||||
<p style="text-align: center;"><span style="color: #614a0d;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque cursus aliquam urna, non ultricies diam sagittis sit amet. Etiam tempus a metus sed tincidunt.</span></p>
|
||||
<p style="text-align: center;"><span style="color: #614a0d;">Curabitur fermentum ligula eget lacus aliquam volutpat. Integer sapien neque, laoreet quis lobortis sed, semper eget magna. Suspendisse potentiu.</span></p>',
|
||||
],
|
||||
2 => [
|
||||
'type' => 'button',
|
||||
'text' => 'Find Out More',
|
||||
'url' => '',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#41c7bf',
|
||||
'borderColor' => '#28a9a2',
|
||||
'borderWidth' => '2px',
|
||||
'borderRadius' => '5px',
|
||||
'borderStyle' => 'solid',
|
||||
'width' => '160px',
|
||||
'lineHeight' => '40px',
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '16px',
|
||||
'fontWeight' => 'normal',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
3 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '30px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
3 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#36b0a9',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '70px',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'text',
|
||||
'text' => '<h2><span style="color: #ffffff;">Handcrafted Shoes</span></h2>
|
||||
<p style="font-size: 14px;"><span><span style="color: #ffffff;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque cursus aliquam urna, non ultricies diam sagittis sit amet. Etiam tempus a metus sed tincidunt. Curabitur fermentum ligula eget lacus aliquam volutpat.</span></span></p>',
|
||||
],
|
||||
2 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '40px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/Retail-Shoes-Boxes-1.jpg',
|
||||
'alt' => 'Retail-Shoes-Boxes-1',
|
||||
'fullWidth' => true,
|
||||
'width' => '700px',
|
||||
'height' => '700px',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
4 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#36b0a9',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/Retail-Shoes-Boxes-2.jpg',
|
||||
'alt' => 'Retail-Shoes-Boxes-2',
|
||||
'fullWidth' => true,
|
||||
'width' => '700px',
|
||||
'height' => '700px',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '70px',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'text',
|
||||
'text' => '<h2><span style="color: #ffffff;">Perfect For Any Occasion</span></h2>
|
||||
<p style="font-size: 14px;"><span><span style="color: #ffffff;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque cursus aliquam urna, non ultricies diam sagittis sit amet. Etiam tempus a metus sed tincidunt. Curabitur fermentum ligula eget lacus aliquam volutpat.</span></span></p>',
|
||||
],
|
||||
2 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '40px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
5 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#f6f6f6',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '40px',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'text',
|
||||
'text' => '<h3 style="text-align: center;"><strong>We\'re open every day!</strong></h3>
|
||||
<p style="text-align: center;">Call in any time and we\'ll help you pick the best shoes for any occasion.</p>
|
||||
<p style="text-align: center;">If you\'re not happy, just bring them back to us and we\'ll give you a full refund.</p>',
|
||||
],
|
||||
2 => [
|
||||
'type' => 'button',
|
||||
'text' => 'Check Out Our Website',
|
||||
'url' => '',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#41c7bf',
|
||||
'borderColor' => '#28a9a2',
|
||||
'borderWidth' => '2px',
|
||||
'borderRadius' => '5px',
|
||||
'borderStyle' => 'solid',
|
||||
'width' => '220px',
|
||||
'lineHeight' => '40px',
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '16px',
|
||||
'fontWeight' => 'normal',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
3 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '30px',
|
||||
],
|
||||
],
|
||||
],
|
||||
4 => [
|
||||
'type' => 'divider',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'padding' => '13px',
|
||||
'borderStyle' => 'solid',
|
||||
'borderWidth' => '2px',
|
||||
'borderColor' => '#d3d3d3',
|
||||
],
|
||||
],
|
||||
],
|
||||
5 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
6 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#f6f6f6',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/Retail-Shoes-Logo-Footer.png',
|
||||
'alt' => 'Retail-Shoes-Logo-Footer',
|
||||
'fullWidth' => true,
|
||||
'width' => '1280px',
|
||||
'height' => '60px',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
2 => [
|
||||
'type' => 'text',
|
||||
'text' => '<p style="text-align: center; font-size: 12px;"><span style="color: #999999;">Address Line 1</span></p>
|
||||
<p style="text-align: center; font-size: 12px;"><span style="color: #999999;">Address Line 2</span></p>
|
||||
<p style="text-align: center; font-size: 12px;"><span style="color: #999999;">City</span></p>
|
||||
<p style="text-align: center; font-size: 12px;"><span style="color: #999999;">Country</span></p>',
|
||||
],
|
||||
3 => [
|
||||
'type' => 'social',
|
||||
'iconSet' => 'grey',
|
||||
'icons' => [
|
||||
0 => [
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'facebook',
|
||||
'link' => 'http://www.facebook.com',
|
||||
'image' => $this->social_icon_url . '/02-grey/Facebook.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Facebook',
|
||||
],
|
||||
1 => [
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'twitter',
|
||||
'link' => 'http://www.twitter.com',
|
||||
'image' => $this->social_icon_url . '/02-grey/Twitter.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Twitter',
|
||||
],
|
||||
2 => [
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'instagram',
|
||||
'link' => 'http://instagram.com',
|
||||
'image' => $this->social_icon_url . '/02-grey/Instagram.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Instagram',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
7 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#f6f6f6',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'footer',
|
||||
'text' => '<p><a href="[link:subscription_unsubscribe_url]">' . __("Unsubscribe", 'mailpoet') . '</a> | <a href="[link:subscription_manage_url]">' . __("Manage your subscription", 'mailpoet') . '</a></p>',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
'text' => [
|
||||
'fontColor' => '#222222',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '12px',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
'link' => [
|
||||
'fontColor' => '#41c7bf',
|
||||
'textDecoration' => 'none',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '40px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
'globalStyles' => [
|
||||
'text' => [
|
||||
'fontColor' => '#000000',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '15px',
|
||||
],
|
||||
'h1' => [
|
||||
'fontColor' => '#111111',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '30px',
|
||||
],
|
||||
'h2' => [
|
||||
'fontColor' => '#222222',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '24px',
|
||||
],
|
||||
'h3' => [
|
||||
'fontColor' => '#333333',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '22px',
|
||||
],
|
||||
'link' => [
|
||||
'fontColor' => '#21759B',
|
||||
'textDecoration' => 'underline',
|
||||
],
|
||||
'wrapper' => [
|
||||
'backgroundColor' => '#ffffff',
|
||||
],
|
||||
'body' => [
|
||||
'backgroundColor' => '#f6f6f6',
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
private function getThumbnail() {
|
||||
return $this->template_image_url . '/thumbnail.20190411-1500.jpg';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,209 @@
|
||||
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
|
||||
|
||||
namespace MailPoet\Config\PopulatorData\Templates;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
class SimpleText {
|
||||
|
||||
private $assets_url;
|
||||
private $external_template_image_url;
|
||||
private $template_image_url;
|
||||
private $social_icon_url;
|
||||
|
||||
public function __construct(
|
||||
$assets_url
|
||||
) {
|
||||
$this->assets_url = $assets_url;
|
||||
$this->external_template_image_url = 'https://ps.w.org/mailpoet/assets/newsletter-templates/simple-text';
|
||||
$this->template_image_url = $this->assets_url . '/img/blank_templates';
|
||||
$this->social_icon_url = $this->assets_url . '/img/newsletter_editor/social-icons';
|
||||
}
|
||||
|
||||
public function get() {
|
||||
return [
|
||||
'name' => __("Simple Text", 'mailpoet'),
|
||||
'categories' => json_encode(['standard', 'blank']),
|
||||
'readonly' => 1,
|
||||
'thumbnail' => $this->getThumbnail(),
|
||||
'body' => json_encode($this->getBody()),
|
||||
];
|
||||
}
|
||||
|
||||
private function getBody() {
|
||||
return [
|
||||
"content" => [
|
||||
"type" => "container",
|
||||
"orientation" => "vertical",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "horizontal",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "#ffffff",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "vertical",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "spacer",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
"height" => "30px",
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "image",
|
||||
"link" => "",
|
||||
"src" => $this->template_image_url . "/fake-logo.png",
|
||||
"alt" => __("Fake logo", 'mailpoet'),
|
||||
"fullWidth" => false,
|
||||
"width" => "598px",
|
||||
"height" => "71px",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"textAlign" => "center",
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "text",
|
||||
"text" => __("<p style=\"text-align: left;\">Hi [subscriber:firstname | default:subscriber],</p>\n<p style=\"text-align: left;\"></p>\n<p style=\"text-align: left;\">In MailPoet, you can write emails in plain text, just like in a regular email. This can make your email newsletters more personal and attention-grabbing.</p>\n<p style=\"text-align: left;\"></p>\n<p style=\"text-align: left;\">Is this too simple? You can still style your text with basic formatting, like <strong>bold</strong> or <em>italics.</em></p>\n<p style=\"text-align: left;\"></p>\n<p style=\"text-align: left;\">Finally, you can also add a call-to-action button between 2 blocks of text, like this:</p>", 'mailpoet'),
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "horizontal",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "#ffffff",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "vertical",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "spacer",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
"height" => "23px",
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "button",
|
||||
"text" => __("It's time to take action!", 'mailpoet'),
|
||||
"url" => "",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "#2ea1cd",
|
||||
"borderColor" => "#0074a2",
|
||||
"borderWidth" => "1px",
|
||||
"borderRadius" => "5px",
|
||||
"borderStyle" => "solid",
|
||||
"width" => "288px",
|
||||
"lineHeight" => "40px",
|
||||
"fontColor" => "#ffffff",
|
||||
"fontFamily" => "Verdana",
|
||||
"fontSize" => "16px",
|
||||
"fontWeight" => "normal",
|
||||
"textAlign" => "left",
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "text",
|
||||
"text" => __("<p>Thanks for reading. See you soon!</p>\n<p> </p>\n<p><strong><em>The MailPoet Team</em></strong></p>", 'mailpoet'),
|
||||
],
|
||||
[
|
||||
"type" => "footer",
|
||||
"text" => '<p><a href="[link:subscription_unsubscribe_url]">' . __("Unsubscribe", 'mailpoet') . '</a> | <a href="[link:subscription_manage_url]">' . __("Manage your subscription", 'mailpoet') . '</a><br />' . __("Add your postal address here!", 'mailpoet') . '</p>',
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
"text" => [
|
||||
"fontColor" => "#222222",
|
||||
"fontFamily" => "Arial",
|
||||
"fontSize" => "12px",
|
||||
"textAlign" => "left",
|
||||
],
|
||||
"link" => [
|
||||
"fontColor" => "#6cb7d4",
|
||||
"textDecoration" => "none",
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
"globalStyles" => [
|
||||
"text" => [
|
||||
"fontColor" => "#000000",
|
||||
"fontFamily" => "Arial",
|
||||
"fontSize" => "15px",
|
||||
],
|
||||
"h1" => [
|
||||
"fontColor" => "#111111",
|
||||
"fontFamily" => "Trebuchet MS",
|
||||
"fontSize" => "30px",
|
||||
],
|
||||
"h2" => [
|
||||
"fontColor" => "#222222",
|
||||
"fontFamily" => "Trebuchet MS",
|
||||
"fontSize" => "24px",
|
||||
],
|
||||
"h3" => [
|
||||
"fontColor" => "#333333",
|
||||
"fontFamily" => "Trebuchet MS",
|
||||
"fontSize" => "22px",
|
||||
],
|
||||
"link" => [
|
||||
"fontColor" => "#21759B",
|
||||
"textDecoration" => "underline",
|
||||
],
|
||||
"wrapper" => [
|
||||
"backgroundColor" => "#ffffff",
|
||||
],
|
||||
"body" => [
|
||||
"backgroundColor" => "#ffffff",
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
private function getThumbnail() {
|
||||
return $this->external_template_image_url . '/thumbnail.20190411-1500.jpg';
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,714 @@
|
||||
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
|
||||
|
||||
namespace MailPoet\Config\PopulatorData\Templates;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
class Sunglasses {
|
||||
|
||||
private $template_image_url;
|
||||
private $social_icon_url;
|
||||
|
||||
public function __construct(
|
||||
$assets_url
|
||||
) {
|
||||
$this->template_image_url = 'https://ps.w.org/mailpoet/assets/newsletter-templates/sunglasses';
|
||||
$this->social_icon_url = $assets_url . '/img/newsletter_editor/social-icons';
|
||||
}
|
||||
|
||||
public function get() {
|
||||
return [
|
||||
'name' => __("Sunglasses", 'mailpoet'),
|
||||
'categories' => json_encode(['welcome', 'all']),
|
||||
'readonly' => 1,
|
||||
'thumbnail' => $this->getThumbnail(),
|
||||
'body' => json_encode($this->getBody()),
|
||||
];
|
||||
}
|
||||
|
||||
private function getThumbnail() {
|
||||
return $this->template_image_url . '/thumbnail.20190411-1500.jpg';
|
||||
}
|
||||
|
||||
private function getBody() {
|
||||
return [
|
||||
'content' =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '30px',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/Glasses-Logo.jpg',
|
||||
'alt' => 'Glasses-Logo',
|
||||
'fullWidth' => false,
|
||||
'width' => '250px',
|
||||
'height' => '66px',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
2 =>
|
||||
[
|
||||
'type' => 'divider',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#ffffff',
|
||||
'padding' => '17px',
|
||||
'borderStyle' => 'solid',
|
||||
'borderWidth' => '2px',
|
||||
'borderColor' => '#f8b849',
|
||||
],
|
||||
],
|
||||
],
|
||||
3 =>
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '30px',
|
||||
],
|
||||
],
|
||||
],
|
||||
4 =>
|
||||
[
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/Glasses-Header-2.jpg',
|
||||
'alt' => 'Glasses-Header-2',
|
||||
'fullWidth' => true,
|
||||
'width' => '1280px',
|
||||
'height' => '116px',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
5 =>
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '30px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => '<h3 style="text-align: center;"><span style="color: #333333;"><strong>Here\'s what we sent you</strong></span></h3>',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
2 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/Glasses-Images-1.jpg',
|
||||
'alt' => 'Glasses-Images-1',
|
||||
'fullWidth' => true,
|
||||
'width' => '1280px',
|
||||
'height' => '650px',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => '<p style="text-align: center;"><span>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur nec nisi quis ex pulvinar molestie. Sed pulvinar placerat justo eu viverra.</span></p>',
|
||||
],
|
||||
2 =>
|
||||
[
|
||||
'type' => 'button',
|
||||
'text' => 'Choose These Frames',
|
||||
'url' => '',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#f8b849',
|
||||
'borderColor' => '#0074a2',
|
||||
'borderWidth' => '0px',
|
||||
'borderRadius' => '0px',
|
||||
'borderStyle' => 'solid',
|
||||
'width' => '195px',
|
||||
'lineHeight' => '40px',
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '16px',
|
||||
'fontWeight' => 'normal',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
3 =>
|
||||
[
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/Glasses-Images-2.jpg',
|
||||
'alt' => 'Glasses-Images-2',
|
||||
'fullWidth' => true,
|
||||
'width' => '1280px',
|
||||
'height' => '650px',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
4 =>
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => '<p style="text-align: center;"><span>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur nec nisi quis ex pulvinar molestie. Sed pulvinar placerat justo eu viverra.</span></p>',
|
||||
],
|
||||
5 =>
|
||||
[
|
||||
'type' => 'button',
|
||||
'text' => 'Choose These Frames',
|
||||
'url' => '',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#f8b849',
|
||||
'borderColor' => '#0074a2',
|
||||
'borderWidth' => '0px',
|
||||
'borderRadius' => '0px',
|
||||
'borderStyle' => 'solid',
|
||||
'width' => '195px',
|
||||
'lineHeight' => '40px',
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '16px',
|
||||
'fontWeight' => 'normal',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
6 =>
|
||||
[
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/Glasses-Images-3.jpg',
|
||||
'alt' => 'Glasses-Images-3',
|
||||
'fullWidth' => true,
|
||||
'width' => '1280px',
|
||||
'height' => '650px',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
7 =>
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => '<p style="text-align: center;"><span>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur nec nisi quis ex pulvinar molestie. Sed pulvinar placerat justo eu viverra.</span></p>',
|
||||
],
|
||||
8 =>
|
||||
[
|
||||
'type' => 'button',
|
||||
'text' => 'Choose These Frames',
|
||||
'url' => '',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#f8b849',
|
||||
'borderColor' => '#0074a2',
|
||||
'borderWidth' => '0px',
|
||||
'borderRadius' => '0px',
|
||||
'borderStyle' => 'solid',
|
||||
'width' => '195px',
|
||||
'lineHeight' => '40px',
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '16px',
|
||||
'fontWeight' => 'normal',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
9 =>
|
||||
[
|
||||
'type' => 'divider',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#ffffff',
|
||||
'padding' => '34.5px',
|
||||
'borderStyle' => 'solid',
|
||||
'borderWidth' => '2px',
|
||||
'borderColor' => '#f8b849',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
3 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/Glasses-Header.jpg',
|
||||
'alt' => 'Glasses-Header',
|
||||
'fullWidth' => true,
|
||||
'width' => '640px',
|
||||
'height' => '920px',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '60px',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => '<h3><strong>Our Summer Range Is Here</strong></h3>
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur nec nisi quis ex pulvinar molestie. Sed pulvinar placerat justo eu viverra. Pellentesque in interdum eros, a venenatis velit.</p>
|
||||
<p></p>
|
||||
<p>Fusce finibus convallis augue, ut viverra felis placerat in. Curabitur et commodo ipsum. Mauris tellus metus, tristique vel sollicitudin ut, malesuada in augue. </p>',
|
||||
],
|
||||
2 =>
|
||||
[
|
||||
'type' => 'button',
|
||||
'text' => 'Find Out More',
|
||||
'url' => '',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#f8b849',
|
||||
'borderColor' => '#0074a2',
|
||||
'borderWidth' => '0px',
|
||||
'borderRadius' => '0px',
|
||||
'borderStyle' => 'solid',
|
||||
'width' => '137px',
|
||||
'lineHeight' => '40px',
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '16px',
|
||||
'fontWeight' => 'normal',
|
||||
'textAlign' => 'left',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
4 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#ffffff',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'divider',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#ffffff',
|
||||
'padding' => '34.5px',
|
||||
'borderStyle' => 'solid',
|
||||
'borderWidth' => '2px',
|
||||
'borderColor' => '#f8b849',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
5 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => '<h2 style="text-align: center;"><span style="color: #333333;"><strong>Got any questions or need some help?</strong></span></h2>
|
||||
<p style="text-align: center;"><span style="color: #333333;">We\'re just a click or a phone call away.</span></p>
|
||||
<p style="text-align: center;"><span style="color: #333333;"></span></p>
|
||||
<h3 style="text-align: center;"><span style="color: #333333;"><strong>Call Us:</strong> 08856877854</span></h3>
|
||||
<h3 style="text-align: center;"></h3>',
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'divider',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#ffffff',
|
||||
'padding' => '23.5px',
|
||||
'borderStyle' => 'solid',
|
||||
'borderWidth' => '2px',
|
||||
'borderColor' => '#f8b849',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
6 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#ffffff',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'social',
|
||||
'iconSet' => 'full-symbol-black',
|
||||
'icons' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'facebook',
|
||||
'link' => 'http://www.facebook.com',
|
||||
'image' => $this->social_icon_url . '/07-full-symbol-black/Facebook.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Facebook',
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'twitter',
|
||||
'link' => 'http://www.twitter.com',
|
||||
'image' => $this->social_icon_url . '/07-full-symbol-black/Twitter.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Twitter',
|
||||
],
|
||||
2 =>
|
||||
[
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'instagram',
|
||||
'link' => 'http://instagram.com',
|
||||
'image' => $this->social_icon_url . '/07-full-symbol-black/Instagram.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Instagram',
|
||||
],
|
||||
3 =>
|
||||
[
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'email',
|
||||
'link' => '',
|
||||
'image' => $this->social_icon_url . '/07-full-symbol-black/Email.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Email',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => '<p style="text-align: center; font-size: 11px;"><strong><span style="color: #808080;"><a href="[link:subscription_unsubscribe_url]" style="color: #808080;">' . __("Unsubscribe", 'mailpoet') . '</a> | <a href="[link:subscription_manage_url]" style="color: #808080;">' . __("Manage your subscription", 'mailpoet') . '</a></span></strong><br /><span style="color: #808080;">' . __("Add your postal address here!", 'mailpoet') . '</span></p>',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
'globalStyles' =>
|
||||
[
|
||||
'text' =>
|
||||
[
|
||||
'fontColor' => '#000000',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '15px',
|
||||
],
|
||||
'h1' =>
|
||||
[
|
||||
'fontColor' => '#111111',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '30px',
|
||||
],
|
||||
'h2' =>
|
||||
[
|
||||
'fontColor' => '#222222',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '24px',
|
||||
],
|
||||
'h3' =>
|
||||
[
|
||||
'fontColor' => '#333333',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '22px',
|
||||
],
|
||||
'link' =>
|
||||
[
|
||||
'fontColor' => '#21759B',
|
||||
'textDecoration' => 'underline',
|
||||
],
|
||||
'wrapper' =>
|
||||
[
|
||||
'backgroundColor' => '#ffffff',
|
||||
],
|
||||
'body' =>
|
||||
[
|
||||
'backgroundColor' => '#ffffff',
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,764 @@
|
||||
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
|
||||
|
||||
namespace MailPoet\Config\PopulatorData\Templates;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
class TakeAHike {
|
||||
|
||||
private $template_image_url;
|
||||
private $social_icon_url;
|
||||
|
||||
public function __construct(
|
||||
$assets_url
|
||||
) {
|
||||
$this->template_image_url = 'https://ps.w.org/mailpoet/assets/newsletter-templates/take_a_hike';
|
||||
$this->social_icon_url = $assets_url . '/img/newsletter_editor/social-icons';
|
||||
}
|
||||
|
||||
public function get() {
|
||||
return [
|
||||
'name' => __("Take a Hike", 'mailpoet'),
|
||||
'categories' => json_encode(['standard', 'all']),
|
||||
'readonly' => 1,
|
||||
'thumbnail' => $this->getThumbnail(),
|
||||
'body' => json_encode($this->getBody()),
|
||||
];
|
||||
}
|
||||
|
||||
private function getBody() {
|
||||
return [
|
||||
'content' => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/header.jpg',
|
||||
'alt' => 'header',
|
||||
'fullWidth' => true,
|
||||
'width' => '1320px',
|
||||
'height' => '483px',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
2 => [
|
||||
'type' => 'text',
|
||||
'text' => '<p>Hi [subscriber:firstname | default:explorer]</p>
|
||||
<p></p>
|
||||
<p>Aliquam feugiat nisl eget eleifend congue. Nullam neque tellus, elementum vel elit dictum, tempus sagittis nunc. Phasellus quis commodo odio. Vestibulum vitae mi vel quam rhoncus egestas eget vitae eros. </p>',
|
||||
],
|
||||
3 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
4 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#843c15',
|
||||
'height' => '40px',
|
||||
],
|
||||
],
|
||||
],
|
||||
5 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'text',
|
||||
'text' => '<h1><strong>How to plan your hiking route</strong></h1>
|
||||
<p>Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Aliquam dictum urna ac lacus dapibus rhoncus.</p>',
|
||||
],
|
||||
1 => [
|
||||
'type' => 'button',
|
||||
'text' => 'Read More',
|
||||
'url' => 'https://www.google.co.uk',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#64a1af',
|
||||
'borderColor' => '#0074a2',
|
||||
'borderWidth' => '0px',
|
||||
'borderRadius' => '5px',
|
||||
'borderStyle' => 'solid',
|
||||
'width' => '150px',
|
||||
'lineHeight' => '34px',
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Courier New',
|
||||
'fontSize' => '18px',
|
||||
'fontWeight' => 'bold',
|
||||
'textAlign' => 'left',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/map.jpg',
|
||||
'alt' => 'map',
|
||||
'fullWidth' => false,
|
||||
'width' => '330px',
|
||||
'height' => '227px',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
2 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#843c15',
|
||||
'height' => '40px',
|
||||
],
|
||||
],
|
||||
],
|
||||
2 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
3 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/boots.jpg',
|
||||
'alt' => 'boots',
|
||||
'fullWidth' => false,
|
||||
'width' => '600px',
|
||||
'height' => '400px',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'text',
|
||||
'text' => '<h2><strong>Tried & tested: Our favourite walking boots</strong></h2>
|
||||
<p>Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. </p>',
|
||||
],
|
||||
1 => [
|
||||
'type' => 'button',
|
||||
'text' => 'See Reviews',
|
||||
'url' => '',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#64a1af',
|
||||
'borderColor' => '#0074a2',
|
||||
'borderWidth' => '0px',
|
||||
'borderRadius' => '5px',
|
||||
'borderStyle' => 'solid',
|
||||
'width' => '150px',
|
||||
'lineHeight' => '34px',
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Courier New',
|
||||
'fontSize' => '18px',
|
||||
'fontWeight' => 'bold',
|
||||
'textAlign' => 'left',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
4 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#843c15',
|
||||
'height' => '40px',
|
||||
],
|
||||
],
|
||||
],
|
||||
2 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
3 => [
|
||||
'type' => 'text',
|
||||
'text' => '<h3 style="text-align: center;"><strong>Hikers Gallery</strong></h3>',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
5 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/gallery3.jpg',
|
||||
'alt' => 'gallery3',
|
||||
'fullWidth' => true,
|
||||
'width' => '1000px',
|
||||
'height' => '750px',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/gallery1-300x225.jpg',
|
||||
'alt' => 'gallery1',
|
||||
'fullWidth' => true,
|
||||
'width' => '300px',
|
||||
'height' => '225px',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
2 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/gallery2-1.jpg',
|
||||
'alt' => 'gallery2',
|
||||
'fullWidth' => true,
|
||||
'width' => '1000px',
|
||||
'height' => '750px',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
6 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'text',
|
||||
'text' => '<p style="text-align: center;">Edit this to insert text</p>',
|
||||
],
|
||||
2 => [
|
||||
'type' => 'button',
|
||||
'text' => 'View More Photos',
|
||||
'url' => '',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#64a1af',
|
||||
'borderColor' => '#0074a2',
|
||||
'borderWidth' => '0px',
|
||||
'borderRadius' => '5px',
|
||||
'borderStyle' => 'solid',
|
||||
'width' => '214px',
|
||||
'lineHeight' => '34px',
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Courier New',
|
||||
'fontSize' => '18px',
|
||||
'fontWeight' => 'bold',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
3 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#843c15',
|
||||
'height' => '40px',
|
||||
],
|
||||
],
|
||||
],
|
||||
4 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
5 => [
|
||||
'type' => 'text',
|
||||
'text' => '<h3 style="text-align: center;"><strong>Hiking goes social...</strong></h3>',
|
||||
],
|
||||
6 => [
|
||||
'type' => 'social',
|
||||
'iconSet' => 'circles',
|
||||
'icons' => [
|
||||
0 => [
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'facebook',
|
||||
'link' => 'http://www.facebook.com',
|
||||
'image' => $this->social_icon_url . '/03-circles/Facebook.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Facebook',
|
||||
],
|
||||
1 => [
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'twitter',
|
||||
'link' => 'http://www.twitter.com',
|
||||
'image' => $this->social_icon_url . '/03-circles/Twitter.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Twitter',
|
||||
],
|
||||
2 => [
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'instagram',
|
||||
'link' => 'http://instagram.com',
|
||||
'image' => $this->social_icon_url . '/03-circles/Instagram.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Instagram',
|
||||
],
|
||||
3 => [
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'youtube',
|
||||
'link' => 'http://www.youtube.com',
|
||||
'image' => $this->social_icon_url . '/03-circles/Youtube.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Youtube',
|
||||
],
|
||||
],
|
||||
],
|
||||
7 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
8 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#843c15',
|
||||
'height' => '40px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
7 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#64a1af',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
8 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#64a1af',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'footer',
|
||||
'text' => '<p><a href="[link:subscription_unsubscribe_url]">' . __("Unsubscribe", 'mailpoet') . '</a> | <a href="[link:subscription_manage_url]">' . __("Manage your subscription", 'mailpoet') . '</a></p>',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
'text' => [
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '13px',
|
||||
'textAlign' => 'left',
|
||||
],
|
||||
'link' => [
|
||||
'fontColor' => '#ffffff',
|
||||
'textDecoration' => 'underline',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'footer',
|
||||
'text' => '<p>' . __("Add your postal address here!", 'mailpoet') . '</p>',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
'text' => [
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '13px',
|
||||
'textAlign' => 'right',
|
||||
],
|
||||
'link' => [
|
||||
'fontColor' => '#ffffff',
|
||||
'textDecoration' => 'underline',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
9 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#64a1af',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
'globalStyles' => [
|
||||
'text' => [
|
||||
'fontColor' => '#4f230c',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '16px',
|
||||
],
|
||||
'h1' => [
|
||||
'fontColor' => '#423c39',
|
||||
'fontFamily' => 'Courier New',
|
||||
'fontSize' => '24px',
|
||||
],
|
||||
'h2' => [
|
||||
'fontColor' => '#265f6d',
|
||||
'fontFamily' => 'Courier New',
|
||||
'fontSize' => '24px',
|
||||
],
|
||||
'h3' => [
|
||||
'fontColor' => '#423c39',
|
||||
'fontFamily' => 'Courier New',
|
||||
'fontSize' => '20px',
|
||||
],
|
||||
'link' => [
|
||||
'fontColor' => '#843c15',
|
||||
'textDecoration' => 'underline',
|
||||
],
|
||||
'wrapper' => [
|
||||
'backgroundColor' => '#ffffff',
|
||||
],
|
||||
'body' => [
|
||||
'backgroundColor' => '#843c15',
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
private function getThumbnail() {
|
||||
return $this->template_image_url . '/thumbnail.20190411-1500.jpg';
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
+355
@@ -0,0 +1,355 @@
|
||||
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
|
||||
|
||||
namespace MailPoet\Config\PopulatorData\Templates;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
class WelcomeBlank12Column {
|
||||
|
||||
private $assets_url;
|
||||
private $external_template_image_url;
|
||||
private $template_image_url;
|
||||
private $social_icon_url;
|
||||
|
||||
public function __construct(
|
||||
$assets_url
|
||||
) {
|
||||
$this->assets_url = $assets_url;
|
||||
$this->external_template_image_url = 'https://ps.w.org/mailpoet/assets/newsletter-templates/welcome-email-blank-1-2-column';
|
||||
$this->template_image_url = $this->assets_url . '/img/blank_templates';
|
||||
$this->social_icon_url = $this->assets_url . '/img/newsletter_editor/social-icons';
|
||||
}
|
||||
|
||||
public function get() {
|
||||
return [
|
||||
'name' => __("Welcome Email: Blank 1:2 Column", 'mailpoet'),
|
||||
'categories' => json_encode(['welcome', 'blank']),
|
||||
'readonly' => 1,
|
||||
'thumbnail' => $this->getThumbnail(),
|
||||
'body' => json_encode($this->getBody()),
|
||||
];
|
||||
}
|
||||
|
||||
private function getBody() {
|
||||
return [
|
||||
"content" => [
|
||||
"type" => "container",
|
||||
"orientation" => "vertical",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "horizontal",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "#f8f8f8",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "vertical",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "header",
|
||||
"text" => '<a href="[link:newsletter_view_in_browser_url]">' . __("View this in your browser.", 'mailpoet') . '</a>',
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
"text" => [
|
||||
"fontColor" => "#222222",
|
||||
"fontFamily" => "Arial",
|
||||
"fontSize" => "12px",
|
||||
"textAlign" => "center",
|
||||
],
|
||||
"link" => [
|
||||
"fontColor" => "#6cb7d4",
|
||||
"textDecoration" => "underline",
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "horizontal",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "#ffffff",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "vertical",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "spacer",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
"height" => "30px",
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "image",
|
||||
"link" => "",
|
||||
"src" => $this->template_image_url . "/fake-logo.png",
|
||||
"alt" => __("Fake logo", 'mailpoet'),
|
||||
"fullWidth" => false,
|
||||
"width" => "598px",
|
||||
"height" => "71px",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"textAlign" => "center",
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "text",
|
||||
"text" => __("<h1 style=\"text-align: center;\"><strong>Hi, new subscriber!</strong></h1>\n<p> </p>\n<p>[subscriber:firstname | default:Subscriber],</p>\n<p> </p>\n<p>You recently joined our list and we'd like to give you a warm welcome!</p>", 'mailpoet'),
|
||||
],
|
||||
[
|
||||
"type" => "divider",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
"padding" => "13px",
|
||||
"borderStyle" => "solid",
|
||||
"borderWidth" => "3px",
|
||||
"borderColor" => "#aaaaaa",
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "spacer",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
"height" => "20px",
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "horizontal",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "vertical",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "text",
|
||||
"text" => __("<h3>Our Most Popular Posts</h3>", 'mailpoet'),
|
||||
],
|
||||
[
|
||||
"type" => "text",
|
||||
"text" => __("<ul>\n<li><a href=\"https://www.mailpoet.com/blog/the-importance-of-focus-when-writing/\">The Importance of Focus When Writing</a></li>\n<li><a href=\"https://www.mailpoet.com/blog/writing-next-great-email-subject-line/\">How to Write a Great Subject Line</a></li>\n<li><a href=\"https://www.mailpoet.com/blog/write-advice-motivation/\">Just Sit Down and Write – Advice on Motivation from Ernest Hemingway</a></li>\n</ul>", 'mailpoet'),
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "vertical",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "text",
|
||||
"text" => __("<h3>What's Next?</h3>", 'mailpoet'),
|
||||
],
|
||||
[
|
||||
"type" => "text",
|
||||
"text" => __("<p>Add a single button to your newsletter in order to have one clear call-to-action, which will increase your click rates.</p>", 'mailpoet'),
|
||||
],
|
||||
[
|
||||
"type" => "button",
|
||||
"text" => __("Read up!", 'mailpoet'),
|
||||
"url" => "",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "#2ea1cd",
|
||||
"borderColor" => "#0074a2",
|
||||
"borderWidth" => "1px",
|
||||
"borderRadius" => "5px",
|
||||
"borderStyle" => "solid",
|
||||
"width" => "180px",
|
||||
"lineHeight" => "40px",
|
||||
"fontColor" => "#ffffff",
|
||||
"fontFamily" => "Verdana",
|
||||
"fontSize" => "18px",
|
||||
"fontWeight" => "normal",
|
||||
"textAlign" => "center",
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "horizontal",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "#f8f8f8",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "vertical",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "divider",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
"padding" => "24.5px",
|
||||
"borderStyle" => "solid",
|
||||
"borderWidth" => "3px",
|
||||
"borderColor" => "#aaaaaa",
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "social",
|
||||
"iconSet" => "grey",
|
||||
"icons" => [
|
||||
[
|
||||
"type" => "socialIcon",
|
||||
"iconType" => "facebook",
|
||||
"link" => "https://www.facebook.com",
|
||||
"image" => $this->social_icon_url . "/02-grey/Facebook.png",
|
||||
"height" => "32px",
|
||||
"width" => "32px",
|
||||
"text" => "Facebook",
|
||||
],
|
||||
[
|
||||
"type" => "socialIcon",
|
||||
"iconType" => "twitter",
|
||||
"link" => "https://www.twitter.com",
|
||||
"image" => $this->social_icon_url . "/02-grey/Twitter.png",
|
||||
"height" => "32px",
|
||||
"width" => "32px",
|
||||
"text" => "Twitter",
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "divider",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
"padding" => "7.5px",
|
||||
"borderStyle" => "solid",
|
||||
"borderWidth" => "3px",
|
||||
"borderColor" => "#aaaaaa",
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "footer",
|
||||
"text" => '<p><a href="[link:subscription_unsubscribe_url]">' . __("Unsubscribe", 'mailpoet') . '</a> | <a href="[link:subscription_manage_url]">' . __("Manage your subscription", 'mailpoet') . '</a><br />' . __("Add your postal address here!", 'mailpoet') . '</p>',
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
"text" => [
|
||||
"fontColor" => "#222222",
|
||||
"fontFamily" => "Arial",
|
||||
"fontSize" => "12px",
|
||||
"textAlign" => "center",
|
||||
],
|
||||
"link" => [
|
||||
"fontColor" => "#6cb7d4",
|
||||
"textDecoration" => "none",
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
"globalStyles" => [
|
||||
"text" => [
|
||||
"fontColor" => "#000000",
|
||||
"fontFamily" => "Arial",
|
||||
"fontSize" => "16px",
|
||||
],
|
||||
"h1" => [
|
||||
"fontColor" => "#111111",
|
||||
"fontFamily" => "Trebuchet MS",
|
||||
"fontSize" => "26px",
|
||||
],
|
||||
"h2" => [
|
||||
"fontColor" => "#222222",
|
||||
"fontFamily" => "Trebuchet MS",
|
||||
"fontSize" => "24px",
|
||||
],
|
||||
"h3" => [
|
||||
"fontColor" => "#333333",
|
||||
"fontFamily" => "Trebuchet MS",
|
||||
"fontSize" => "22px",
|
||||
],
|
||||
"link" => [
|
||||
"fontColor" => "#21759B",
|
||||
"textDecoration" => "underline",
|
||||
],
|
||||
"wrapper" => [
|
||||
"backgroundColor" => "#ffffff",
|
||||
],
|
||||
"body" => [
|
||||
"backgroundColor" => "#eeeeee",
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
private function getThumbnail() {
|
||||
return $this->external_template_image_url . '/thumbnail.20190411-1500.jpg';
|
||||
}
|
||||
}
|
||||
+264
@@ -0,0 +1,264 @@
|
||||
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
|
||||
|
||||
namespace MailPoet\Config\PopulatorData\Templates;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
class WelcomeBlank1Column {
|
||||
|
||||
private $assets_url;
|
||||
private $external_template_image_url;
|
||||
private $template_image_url;
|
||||
private $social_icon_url;
|
||||
|
||||
public function __construct(
|
||||
$assets_url
|
||||
) {
|
||||
$this->assets_url = $assets_url;
|
||||
$this->external_template_image_url = 'https://ps.w.org/mailpoet/assets/newsletter-templates/welcome-email-blank-1-column';
|
||||
$this->template_image_url = $this->assets_url . '/img/blank_templates';
|
||||
$this->social_icon_url = $this->assets_url . '/img/newsletter_editor/social-icons';
|
||||
}
|
||||
|
||||
public function get() {
|
||||
return [
|
||||
'name' => __("Welcome Email: Blank 1 Column", 'mailpoet'),
|
||||
'categories' => json_encode(['welcome', 'blank']),
|
||||
'readonly' => 1,
|
||||
'thumbnail' => $this->getThumbnail(),
|
||||
'body' => json_encode($this->getBody()),
|
||||
];
|
||||
}
|
||||
|
||||
private function getBody() {
|
||||
return [
|
||||
"content" => [
|
||||
"type" => "container",
|
||||
"orientation" => "vertical",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "horizontal",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "#f8f8f8",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "vertical",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "header",
|
||||
"text" => '<a href="[link:newsletter_view_in_browser_url]">' . __("View this in your browser.", 'mailpoet') . '</a>',
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
"text" => [
|
||||
"fontColor" => "#222222",
|
||||
"fontFamily" => "Arial",
|
||||
"fontSize" => "12px",
|
||||
"textAlign" => "center",
|
||||
],
|
||||
"link" => [
|
||||
"fontColor" => "#6cb7d4",
|
||||
"textDecoration" => "underline",
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "horizontal",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "#ffffff",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "vertical",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "spacer",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
"height" => "30px",
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "image",
|
||||
"link" => "",
|
||||
"src" => $this->template_image_url . "/fake-logo.png",
|
||||
"alt" => __("Fake logo", 'mailpoet'),
|
||||
"fullWidth" => false,
|
||||
"width" => "598px",
|
||||
"height" => "71px",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"textAlign" => "center",
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "text",
|
||||
"text" => __("<h1 style=\"text-align: center;\"><strong>Hi, new subscriber!</strong></h1>\n<p> </p>\n<p>[subscriber:firstname | default:Subscriber],</p>\n<p> </p>\n<p>You recently joined our list and we'd like to give you a warm welcome!</p>\n<p> </p>\n<p>Want to get to know us better? Check out some of our most popular articles: </p>\n<ol>\n<li><a href=\"https://www.mailpoet.com/blog/the-importance-of-focus-when-writing/\">The Importance of Focus When Writing</a></li>\n<li><a href=\"https://www.mailpoet.com/blog/writing-next-great-email-subject-line/\">How to Write a Great Subject Line</a></li>\n<li><a href=\"https://www.mailpoet.com/blog/write-advice-motivation/\">Just Sit Down and Write – Advice on Motivation from Ernest Hemingway</a></li>\n</ol>", 'mailpoet'),
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "horizontal",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "#f8f8f8",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "container",
|
||||
"orientation" => "vertical",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
],
|
||||
"blocks" => [
|
||||
[
|
||||
"type" => "divider",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
"padding" => "24.5px",
|
||||
"borderStyle" => "solid",
|
||||
"borderWidth" => "3px",
|
||||
"borderColor" => "#aaaaaa",
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "social",
|
||||
"iconSet" => "grey",
|
||||
"icons" => [
|
||||
[
|
||||
"type" => "socialIcon",
|
||||
"iconType" => "facebook",
|
||||
"link" => "https://www.facebook.com",
|
||||
"image" => $this->social_icon_url . "/02-grey/Facebook.png",
|
||||
"height" => "32px",
|
||||
"width" => "32px",
|
||||
"text" => "Facebook",
|
||||
],
|
||||
[
|
||||
"type" => "socialIcon",
|
||||
"iconType" => "twitter",
|
||||
"link" => "https://www.twitter.com",
|
||||
"image" => $this->social_icon_url . "/02-grey/Twitter.png",
|
||||
"height" => "32px",
|
||||
"width" => "32px",
|
||||
"text" => "Twitter",
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "divider",
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
"padding" => "7.5px",
|
||||
"borderStyle" => "solid",
|
||||
"borderWidth" => "3px",
|
||||
"borderColor" => "#aaaaaa",
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
"type" => "footer",
|
||||
"text" => '<p><a href="[link:subscription_unsubscribe_url]">' . __("Unsubscribe", 'mailpoet') . '</a> | <a href="[link:subscription_manage_url]">' . __("Manage your subscription", 'mailpoet') . '</a><br />' . __("Add your postal address here!", 'mailpoet') . '</p>',
|
||||
"styles" => [
|
||||
"block" => [
|
||||
"backgroundColor" => "transparent",
|
||||
],
|
||||
"text" => [
|
||||
"fontColor" => "#222222",
|
||||
"fontFamily" => "Arial",
|
||||
"fontSize" => "12px",
|
||||
"textAlign" => "center",
|
||||
],
|
||||
"link" => [
|
||||
"fontColor" => "#6cb7d4",
|
||||
"textDecoration" => "none",
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
"globalStyles" => [
|
||||
"text" => [
|
||||
"fontColor" => "#000000",
|
||||
"fontFamily" => "Arial",
|
||||
"fontSize" => "16px",
|
||||
],
|
||||
"h1" => [
|
||||
"fontColor" => "#111111",
|
||||
"fontFamily" => "Trebuchet MS",
|
||||
"fontSize" => "30px",
|
||||
],
|
||||
"h2" => [
|
||||
"fontColor" => "#222222",
|
||||
"fontFamily" => "Trebuchet MS",
|
||||
"fontSize" => "24px",
|
||||
],
|
||||
"h3" => [
|
||||
"fontColor" => "#333333",
|
||||
"fontFamily" => "Trebuchet MS",
|
||||
"fontSize" => "22px",
|
||||
],
|
||||
"link" => [
|
||||
"fontColor" => "#21759B",
|
||||
"textDecoration" => "underline",
|
||||
],
|
||||
"wrapper" => [
|
||||
"backgroundColor" => "#ffffff",
|
||||
],
|
||||
"body" => [
|
||||
"backgroundColor" => "#eeeeee",
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
private function getThumbnail() {
|
||||
return $this->external_template_image_url . '/thumbnail.20190411-1500.jpg';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,779 @@
|
||||
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
|
||||
|
||||
namespace MailPoet\Config\PopulatorData\Templates;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
class WideStoryLayout {
|
||||
|
||||
private $template_image_url;
|
||||
private $social_icon_url;
|
||||
|
||||
public function __construct(
|
||||
$assets_url
|
||||
) {
|
||||
$this->template_image_url = 'https://ps.w.org/mailpoet/assets/newsletter-templates/wide-story-layout';
|
||||
$this->social_icon_url = $assets_url . '/img/newsletter_editor/social-icons';
|
||||
}
|
||||
|
||||
public function get() {
|
||||
return [
|
||||
'name' => __("Wide Story Layout", 'mailpoet'),
|
||||
'categories' => json_encode(['notification', 'all']),
|
||||
'readonly' => 1,
|
||||
'thumbnail' => $this->getThumbnail(),
|
||||
'body' => json_encode($this->getBody()),
|
||||
];
|
||||
}
|
||||
|
||||
private function getThumbnail() {
|
||||
return $this->template_image_url . '/thumbnail.20190411-1500.jpg';
|
||||
}
|
||||
|
||||
private function getBody() {
|
||||
return [
|
||||
'content' =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'image' =>
|
||||
[
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'image' =>
|
||||
[
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#f0f0f0',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'image' =>
|
||||
[
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '50px',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/Wide-Logo.png',
|
||||
'alt' => 'Wide-Logo',
|
||||
'fullWidth' => false,
|
||||
'width' => '200px',
|
||||
'height' => '37px',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
2 =>
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => '<h3 style="text-align: center;"><span style="color: #808080;">Our Latest Posts</span></h3>',
|
||||
],
|
||||
3 =>
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'automatedLatestContentLayout',
|
||||
'withLayout' => true,
|
||||
'amount' => '3',
|
||||
'contentType' => 'post',
|
||||
'terms' =>
|
||||
[
|
||||
],
|
||||
'inclusionType' => 'include',
|
||||
'displayType' => 'excerpt',
|
||||
'titleFormat' => 'h3',
|
||||
'titleAlignment' => 'left',
|
||||
'titleIsLink' => false,
|
||||
'imageFullWidth' => false,
|
||||
'featuredImagePosition' => 'alternate',
|
||||
'showAuthor' => 'no',
|
||||
'authorPrecededBy' => 'Author:',
|
||||
'showCategories' => 'no',
|
||||
'categoriesPrecededBy' => 'Categories:',
|
||||
'readMoreType' => 'button',
|
||||
'readMoreText' => 'Read more',
|
||||
'readMoreButton' =>
|
||||
[
|
||||
'type' => 'button',
|
||||
'text' => 'Read The Post',
|
||||
'url' => '[postLink]',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#5ecd39',
|
||||
'borderColor' => '#000000',
|
||||
'borderWidth' => '0px',
|
||||
'borderRadius' => '5px',
|
||||
'borderStyle' => 'solid',
|
||||
'width' => '288px',
|
||||
'lineHeight' => '36px',
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Lucida',
|
||||
'fontSize' => '16px',
|
||||
'fontWeight' => 'normal',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
'context' => 'automatedLatestContentLayout.readMoreButton',
|
||||
],
|
||||
'sortBy' => 'newest',
|
||||
'showDivider' => true,
|
||||
'divider' =>
|
||||
[
|
||||
'type' => 'divider',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#f0f0f0',
|
||||
'padding' => '13px',
|
||||
'borderStyle' => 'solid',
|
||||
'borderWidth' => '30px',
|
||||
'borderColor' => '#f0f0f0',
|
||||
],
|
||||
],
|
||||
'context' => 'automatedLatestContentLayout.divider',
|
||||
],
|
||||
'backgroundColor' => '#ffffff',
|
||||
'backgroundColorAlternate' => '#eeeeee',
|
||||
],
|
||||
2 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'image' =>
|
||||
[
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'image' =>
|
||||
[
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/Wide-Footer.jpg',
|
||||
'alt' => 'Wide-Footer',
|
||||
'fullWidth' => true,
|
||||
'width' => '1280px',
|
||||
'height' => '721px',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
3 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'image' =>
|
||||
[
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#5ecd39',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'image' =>
|
||||
[
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '21px',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'social',
|
||||
'iconSet' => 'full-symbol-grey',
|
||||
'icons' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'facebook',
|
||||
'link' => 'http://www.facebook.com',
|
||||
'image' => $this->social_icon_url . '/08-full-symbol-grey/Facebook.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Facebook',
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'twitter',
|
||||
'link' => 'http://www.twitter.com',
|
||||
'image' => $this->social_icon_url . '/08-full-symbol-grey/Twitter.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Twitter',
|
||||
],
|
||||
2 =>
|
||||
[
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'website',
|
||||
'link' => '',
|
||||
'image' => $this->social_icon_url . '/08-full-symbol-grey/Website.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Website',
|
||||
],
|
||||
3 =>
|
||||
[
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'instagram',
|
||||
'link' => 'http://instagram.com',
|
||||
'image' => $this->social_icon_url . '/08-full-symbol-grey/Instagram.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Instagram',
|
||||
],
|
||||
],
|
||||
],
|
||||
2 =>
|
||||
[
|
||||
'type' => 'footer',
|
||||
'text' => '<p><span style="color: #ffffff;"><a href="[link:subscription_unsubscribe_url]" style="color: #ffffff;">' . __("Unsubscribe", 'mailpoet') . '</a> | <a href="[link:subscription_manage_url]" style="color: #ffffff;">' . __("Manage your subscription", 'mailpoet') . '</a></span><br /><span style="color: #ffffff;">' . __("Add your postal address here!", 'mailpoet') . '</span></p>',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
'text' =>
|
||||
[
|
||||
'fontColor' => '#222222',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '12px',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
'link' =>
|
||||
[
|
||||
'fontColor' => '#6cb7d4',
|
||||
'textDecoration' => 'none',
|
||||
],
|
||||
],
|
||||
],
|
||||
3 =>
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '40px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
'globalStyles' =>
|
||||
[
|
||||
'text' =>
|
||||
[
|
||||
'fontColor' => '#000000',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '15px',
|
||||
],
|
||||
'h1' =>
|
||||
[
|
||||
'fontColor' => '#111111',
|
||||
'fontFamily' => 'Lucida',
|
||||
'fontSize' => '30px',
|
||||
],
|
||||
'h2' =>
|
||||
[
|
||||
'fontColor' => '#222222',
|
||||
'fontFamily' => 'Lucida',
|
||||
'fontSize' => '24px',
|
||||
],
|
||||
'h3' =>
|
||||
[
|
||||
'fontColor' => '#333333',
|
||||
'fontFamily' => 'Lucida',
|
||||
'fontSize' => '18px',
|
||||
],
|
||||
'link' =>
|
||||
[
|
||||
'fontColor' => '#5ecd39',
|
||||
'textDecoration' => 'underline',
|
||||
],
|
||||
'wrapper' =>
|
||||
[
|
||||
'backgroundColor' => '#ffffff',
|
||||
],
|
||||
'body' =>
|
||||
[
|
||||
'backgroundColor' => '#f0f0f0',
|
||||
],
|
||||
],
|
||||
'blockDefaults' =>
|
||||
[
|
||||
'automatedLatestContent' =>
|
||||
[
|
||||
'amount' => '5',
|
||||
'withLayout' => false,
|
||||
'contentType' => 'post',
|
||||
'inclusionType' => 'include',
|
||||
'displayType' => 'excerpt',
|
||||
'titleFormat' => 'h1',
|
||||
'titleAlignment' => 'left',
|
||||
'titleIsLink' => false,
|
||||
'imageFullWidth' => false,
|
||||
'featuredImagePosition' => 'belowTitle',
|
||||
'showAuthor' => 'no',
|
||||
'authorPrecededBy' => 'Author:',
|
||||
'showCategories' => 'no',
|
||||
'categoriesPrecededBy' => 'Categories:',
|
||||
'readMoreType' => 'button',
|
||||
'readMoreText' => 'Read more',
|
||||
'readMoreButton' =>
|
||||
[
|
||||
'text' => 'Read more',
|
||||
'url' => '[postLink]',
|
||||
'context' => 'automatedLatestContent.readMoreButton',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#2ea1cd',
|
||||
'borderColor' => '#0074a2',
|
||||
'borderWidth' => '1px',
|
||||
'borderRadius' => '5px',
|
||||
'borderStyle' => 'solid',
|
||||
'width' => '180px',
|
||||
'lineHeight' => '40px',
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Verdana',
|
||||
'fontSize' => '18px',
|
||||
'fontWeight' => 'normal',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
'sortBy' => 'newest',
|
||||
'showDivider' => true,
|
||||
'divider' =>
|
||||
[
|
||||
'context' => 'automatedLatestContent.divider',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'padding' => '13px',
|
||||
'borderStyle' => 'solid',
|
||||
'borderWidth' => '3px',
|
||||
'borderColor' => '#aaaaaa',
|
||||
],
|
||||
],
|
||||
],
|
||||
'backgroundColor' => '#ffffff',
|
||||
'backgroundColorAlternate' => '#eeeeee',
|
||||
],
|
||||
'automatedLatestContentLayout' =>
|
||||
[
|
||||
'amount' => '3',
|
||||
'withLayout' => true,
|
||||
'contentType' => 'post',
|
||||
'inclusionType' => 'include',
|
||||
'displayType' => 'excerpt',
|
||||
'titleFormat' => 'h3',
|
||||
'titleAlignment' => 'left',
|
||||
'titleIsLink' => false,
|
||||
'imageFullWidth' => false,
|
||||
'featuredImagePosition' => 'alternate',
|
||||
'showAuthor' => 'no',
|
||||
'authorPrecededBy' => 'Author:',
|
||||
'showCategories' => 'no',
|
||||
'categoriesPrecededBy' => 'Categories:',
|
||||
'readMoreType' => 'button',
|
||||
'readMoreText' => 'Read more',
|
||||
'readMoreButton' =>
|
||||
[
|
||||
'text' => 'Read The Post',
|
||||
'url' => '[postLink]',
|
||||
'context' => 'automatedLatestContentLayout.readMoreButton',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#5ecd39',
|
||||
'borderColor' => '#000000',
|
||||
'borderWidth' => '0px',
|
||||
'borderRadius' => '5px',
|
||||
'borderStyle' => 'solid',
|
||||
'width' => '288px',
|
||||
'lineHeight' => '36px',
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Lucida',
|
||||
'fontSize' => '16px',
|
||||
'fontWeight' => 'normal',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
'type' => 'button',
|
||||
],
|
||||
'sortBy' => 'newest',
|
||||
'showDivider' => true,
|
||||
'divider' =>
|
||||
[
|
||||
'context' => 'automatedLatestContentLayout.divider',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#f0f0f0',
|
||||
'padding' => '13px',
|
||||
'borderStyle' => 'solid',
|
||||
'borderWidth' => '30px',
|
||||
'borderColor' => '#f0f0f0',
|
||||
],
|
||||
],
|
||||
'type' => 'divider',
|
||||
],
|
||||
'backgroundColor' => '#ffffff',
|
||||
'backgroundColorAlternate' => '#eeeeee',
|
||||
'type' => 'automatedLatestContentLayout',
|
||||
'terms' =>
|
||||
[
|
||||
],
|
||||
],
|
||||
'button' =>
|
||||
[
|
||||
'text' => 'Read The Post',
|
||||
'url' => '[postLink]',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#5ecd39',
|
||||
'borderColor' => '#000000',
|
||||
'borderWidth' => '0px',
|
||||
'borderRadius' => '5px',
|
||||
'borderStyle' => 'solid',
|
||||
'width' => '288px',
|
||||
'lineHeight' => '36px',
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Lucida',
|
||||
'fontSize' => '16px',
|
||||
'fontWeight' => 'normal',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
'type' => 'button',
|
||||
],
|
||||
'container' =>
|
||||
[
|
||||
'image' =>
|
||||
[
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
],
|
||||
'divider' =>
|
||||
[
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'padding' => '13px',
|
||||
'borderStyle' => 'solid',
|
||||
'borderWidth' => '3px',
|
||||
'borderColor' => '#aaaaaa',
|
||||
],
|
||||
],
|
||||
],
|
||||
'footer' =>
|
||||
[
|
||||
'text' => '<p><a href="[link:subscription_unsubscribe_url]">' . __("Unsubscribe", 'mailpoet') . '</a> | <a href="[link:subscription_manage_url]">' . __("Manage your subscription", 'mailpoet') . '</a><br />' . __("Add your postal address here!", 'mailpoet') . '</p>',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
'text' =>
|
||||
[
|
||||
'fontColor' => '#222222',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '12px',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
'link' =>
|
||||
[
|
||||
'fontColor' => '#6cb7d4',
|
||||
'textDecoration' => 'none',
|
||||
],
|
||||
],
|
||||
],
|
||||
'posts' =>
|
||||
[
|
||||
'amount' => '10',
|
||||
'withLayout' => true,
|
||||
'contentType' => 'post',
|
||||
'postStatus' => 'publish',
|
||||
'inclusionType' => 'include',
|
||||
'displayType' => 'excerpt',
|
||||
'titleFormat' => 'h1',
|
||||
'titleAlignment' => 'left',
|
||||
'titleIsLink' => false,
|
||||
'imageFullWidth' => false,
|
||||
'featuredImagePosition' => 'alternate',
|
||||
'showAuthor' => 'no',
|
||||
'authorPrecededBy' => 'Author:',
|
||||
'showCategories' => 'no',
|
||||
'categoriesPrecededBy' => 'Categories:',
|
||||
'readMoreType' => 'link',
|
||||
'readMoreText' => 'Read more',
|
||||
'readMoreButton' =>
|
||||
[
|
||||
'text' => 'Read more',
|
||||
'url' => '[postLink]',
|
||||
'context' => 'posts.readMoreButton',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#2ea1cd',
|
||||
'borderColor' => '#0074a2',
|
||||
'borderWidth' => '1px',
|
||||
'borderRadius' => '5px',
|
||||
'borderStyle' => 'solid',
|
||||
'width' => '180px',
|
||||
'lineHeight' => '40px',
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Verdana',
|
||||
'fontSize' => '18px',
|
||||
'fontWeight' => 'normal',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
'sortBy' => 'newest',
|
||||
'showDivider' => true,
|
||||
'divider' =>
|
||||
[
|
||||
'context' => 'posts.divider',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'padding' => '13px',
|
||||
'borderStyle' => 'solid',
|
||||
'borderWidth' => '3px',
|
||||
'borderColor' => '#aaaaaa',
|
||||
],
|
||||
],
|
||||
],
|
||||
'backgroundColor' => '#ffffff',
|
||||
'backgroundColorAlternate' => '#eeeeee',
|
||||
],
|
||||
'social' =>
|
||||
[
|
||||
'iconSet' => 'default',
|
||||
'icons' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'facebook',
|
||||
'link' => 'http://www.facebook.com',
|
||||
'image' => $this->social_icon_url . '/01-social/Facebook.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Facebook',
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'twitter',
|
||||
'link' => 'http://www.twitter.com',
|
||||
'image' => $this->social_icon_url . '/01-social/Twitter.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Twitter',
|
||||
],
|
||||
],
|
||||
],
|
||||
'spacer' =>
|
||||
[
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#ffffff',
|
||||
'height' => '40px',
|
||||
],
|
||||
],
|
||||
'type' => 'spacer',
|
||||
],
|
||||
'header' =>
|
||||
[
|
||||
'text' => '<a href="[link:newsletter_view_in_browser_url]">' . __("View this in your browser.", 'mailpoet') . '</a>',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
'text' =>
|
||||
[
|
||||
'fontColor' => '#222222',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '12px',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
'link' =>
|
||||
[
|
||||
'fontColor' => '#6cb7d4',
|
||||
'textDecoration' => 'underline',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,952 @@
|
||||
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
|
||||
|
||||
namespace MailPoet\Config\PopulatorData\Templates;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
class WineCity {
|
||||
|
||||
private $template_image_url;
|
||||
private $social_icon_url;
|
||||
|
||||
public function __construct(
|
||||
$assets_url
|
||||
) {
|
||||
$this->template_image_url = 'https://ps.w.org/mailpoet/assets/newsletter-templates/wine-city';
|
||||
$this->social_icon_url = $assets_url . '/img/newsletter_editor/social-icons';
|
||||
}
|
||||
|
||||
public function get() {
|
||||
return [
|
||||
'name' => __("Wine City (with coupon)", 'mailpoet'),
|
||||
'categories' => json_encode(['woocommerce', 'all']),
|
||||
'readonly' => 1,
|
||||
'thumbnail' => $this->getThumbnail(),
|
||||
'body' => json_encode($this->getBody()),
|
||||
];
|
||||
}
|
||||
|
||||
private function getThumbnail() {
|
||||
return $this->template_image_url . '/thumbnail.20190411-1500.jpg';
|
||||
}
|
||||
|
||||
private function getBody() {
|
||||
return [
|
||||
'content' =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'image' =>
|
||||
[
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'image' =>
|
||||
[
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'image' =>
|
||||
[
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '37px',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/Wine-Logo.png',
|
||||
'alt' => 'Wine-Logo',
|
||||
'fullWidth' => false,
|
||||
'width' => '136px',
|
||||
'height' => '67px',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'textAlign' => 'left',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'image' =>
|
||||
[
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '31px',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'social',
|
||||
'iconSet' => 'circles',
|
||||
'icons' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'facebook',
|
||||
'link' => 'http://www.facebook.com',
|
||||
'image' => $this->social_icon_url . '/03-circles/Facebook.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Facebook',
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'twitter',
|
||||
'link' => 'http://www.twitter.com',
|
||||
'image' => $this->social_icon_url . '/03-circles/Twitter.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Twitter',
|
||||
],
|
||||
2 =>
|
||||
[
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'instagram',
|
||||
'link' => 'http://instagram.com',
|
||||
'image' => $this->social_icon_url . '/03-circles/Instagram.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Instagram',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'image' =>
|
||||
[
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'image' =>
|
||||
[
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'divider',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'padding' => '13px',
|
||||
'borderStyle' => 'solid',
|
||||
'borderWidth' => '1px',
|
||||
'borderColor' => '#aaaaaa',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
2 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'image' =>
|
||||
[
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'image' =>
|
||||
[
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => '<p style="text-align: left;"><span style="color: #6d6d6d;"><strong>Red Wine</strong></span></p>',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'image' =>
|
||||
[
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => '<p style="text-align: left;"><span style="color: #6d6d6d;"><strong>White Wine</strong></span></p>',
|
||||
],
|
||||
],
|
||||
],
|
||||
2 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'image' =>
|
||||
[
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => '<p style="text-align: left;"><span style="color: #6d6d6d;"><strong>Rose Wine</strong></span></p>',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
3 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'image' =>
|
||||
[
|
||||
'src' => $this->template_image_url . '/Wine-Header-1.jpg',
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'image' =>
|
||||
[
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => '<h1 style="text-align: center;"><span style="color: #ffffff;"><strong>Have a drink on us</strong></span></h1>',
|
||||
],
|
||||
2 =>
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '231px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
4 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'image' =>
|
||||
[
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#ffffff',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'image' =>
|
||||
[
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '34px',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => '<h2 style="text-align: center;"><span style="color: #6d6d6d;"><strong>You\'re our VIP - now it\'s time to celebrate! </strong></span></h2>
|
||||
<p style="text-align: center;"><span style="color: #6d6d6d;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam a elementum ex. Aliquam mollis metus ac nisl luctus pulvinar. Donec tincidunt pharetra sem, nec eleifend augue.</span></p>',
|
||||
],
|
||||
2 =>
|
||||
[
|
||||
'productIds' => [],
|
||||
'excludedProductIds' => [],
|
||||
'productCategoryIds' => [],
|
||||
'excludedProductCategoryIds' => [],
|
||||
'type' => 'coupon',
|
||||
'amount' => 10,
|
||||
'amountMax' => 100,
|
||||
'discountType' => 'percent',
|
||||
'expiryDay' => 10,
|
||||
'usageLimit' => '',
|
||||
'usageLimitPerUser' => '',
|
||||
'minimumAmount' => '',
|
||||
'maximumAmount' => '',
|
||||
'emailRestrictions' => '',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#ffffff',
|
||||
'borderColor' => '#6d6d6d',
|
||||
'borderWidth' => '2px',
|
||||
'borderRadius' => '0px',
|
||||
'borderStyle' => 'solid',
|
||||
'width' => '219px',
|
||||
'lineHeight' => '50px',
|
||||
'fontColor' => '#6d6d6d',
|
||||
'fontFamily' => 'Courier New',
|
||||
'fontSize' => '30px',
|
||||
'fontWeight' => 'bold',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
'source' => 'createNew',
|
||||
'code' => 'XXXX-XXXXXXX-XXXX',
|
||||
],
|
||||
3 =>
|
||||
[
|
||||
'type' => 'divider',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'padding' => '17px',
|
||||
'borderStyle' => 'solid',
|
||||
'borderWidth' => '1px',
|
||||
'borderColor' => '#aaaaaa',
|
||||
],
|
||||
],
|
||||
],
|
||||
4 =>
|
||||
[
|
||||
'type' => 'footer',
|
||||
'text' => '<p><strong><span style="color: #6d6d6d;"><a href="[link:subscription_unsubscribe_url]" style="color: #6d6d6d;">' . __("Unsubscribe", 'mailpoet') . '</a> | <a href="[link:subscription_manage_url]" style="color: #6d6d6d;">' . __("Manage your subscription", 'mailpoet') . '</a></span></strong><br /><span style="color: #6d6d6d;">' . __("Add your postal address here!", 'mailpoet') . '</span></p>',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
'text' =>
|
||||
[
|
||||
'fontColor' => '#222222',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '12px',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
'link' =>
|
||||
[
|
||||
'fontColor' => '#6cb7d4',
|
||||
'textDecoration' => 'none',
|
||||
],
|
||||
],
|
||||
],
|
||||
5 =>
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
5 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'image' =>
|
||||
[
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#eeeeee',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'image' =>
|
||||
[
|
||||
'src' => null,
|
||||
'display' => 'scale',
|
||||
],
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
'globalStyles' =>
|
||||
[
|
||||
'text' =>
|
||||
[
|
||||
'fontColor' => '#000000',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '14px',
|
||||
],
|
||||
'h1' =>
|
||||
[
|
||||
'fontColor' => '#111111',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '40px',
|
||||
],
|
||||
'h2' =>
|
||||
[
|
||||
'fontColor' => '#222222',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '24px',
|
||||
],
|
||||
'h3' =>
|
||||
[
|
||||
'fontColor' => '#333333',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '22px',
|
||||
],
|
||||
'link' =>
|
||||
[
|
||||
'fontColor' => '#21759B',
|
||||
'textDecoration' => 'underline',
|
||||
],
|
||||
'wrapper' =>
|
||||
[
|
||||
'backgroundColor' => '#ffffff',
|
||||
],
|
||||
'body' =>
|
||||
[
|
||||
'backgroundColor' => '#eeeeee',
|
||||
],
|
||||
],
|
||||
'blockDefaults' =>
|
||||
[
|
||||
'automatedLatestContent' =>
|
||||
[
|
||||
'amount' => '5',
|
||||
'contentType' => 'post',
|
||||
'inclusionType' => 'include',
|
||||
'displayType' => 'excerpt',
|
||||
'titleFormat' => 'h1',
|
||||
'titleAlignment' => 'left',
|
||||
'titleIsLink' => false,
|
||||
'imageFullWidth' => false,
|
||||
'featuredImagePosition' => 'belowTitle',
|
||||
'showAuthor' => 'no',
|
||||
'authorPrecededBy' => 'Author:',
|
||||
'showCategories' => 'no',
|
||||
'categoriesPrecededBy' => 'Categories:',
|
||||
'readMoreType' => 'button',
|
||||
'readMoreText' => 'Read more',
|
||||
'readMoreButton' =>
|
||||
[
|
||||
'text' => 'Read more',
|
||||
'url' => '[postLink]',
|
||||
'context' => 'automatedLatestContent.readMoreButton',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#2ea1cd',
|
||||
'borderColor' => '#0074a2',
|
||||
'borderWidth' => '1px',
|
||||
'borderRadius' => '5px',
|
||||
'borderStyle' => 'solid',
|
||||
'width' => '180px',
|
||||
'lineHeight' => '40px',
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Verdana',
|
||||
'fontSize' => '18px',
|
||||
'fontWeight' => 'normal',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
'sortBy' => 'newest',
|
||||
'showDivider' => true,
|
||||
'divider' =>
|
||||
[
|
||||
'context' => 'automatedLatestContent.divider',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'padding' => '13px',
|
||||
'borderStyle' => 'solid',
|
||||
'borderWidth' => '3px',
|
||||
'borderColor' => '#aaaaaa',
|
||||
],
|
||||
],
|
||||
],
|
||||
'backgroundColor' => '#ffffff',
|
||||
'backgroundColorAlternate' => '#eeeeee',
|
||||
],
|
||||
'automatedLatestContentLayout' =>
|
||||
[
|
||||
'amount' => '5',
|
||||
'withLayout' => true,
|
||||
'contentType' => 'post',
|
||||
'inclusionType' => 'include',
|
||||
'displayType' => 'excerpt',
|
||||
'titleFormat' => 'h1',
|
||||
'titleAlignment' => 'left',
|
||||
'titleIsLink' => false,
|
||||
'imageFullWidth' => false,
|
||||
'featuredImagePosition' => 'alternate',
|
||||
'showAuthor' => 'no',
|
||||
'authorPrecededBy' => 'Author:',
|
||||
'showCategories' => 'no',
|
||||
'categoriesPrecededBy' => 'Categories:',
|
||||
'readMoreType' => 'button',
|
||||
'readMoreText' => 'Read more',
|
||||
'readMoreButton' =>
|
||||
[
|
||||
'text' => 'Read more',
|
||||
'url' => '[postLink]',
|
||||
'context' => 'automatedLatestContentLayout.readMoreButton',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#2ea1cd',
|
||||
'borderColor' => '#0074a2',
|
||||
'borderWidth' => '1px',
|
||||
'borderRadius' => '5px',
|
||||
'borderStyle' => 'solid',
|
||||
'width' => '180px',
|
||||
'lineHeight' => '40px',
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Verdana',
|
||||
'fontSize' => '18px',
|
||||
'fontWeight' => 'normal',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
'sortBy' => 'newest',
|
||||
'showDivider' => true,
|
||||
'divider' =>
|
||||
[
|
||||
'context' => 'automatedLatestContentLayout.divider',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'padding' => '13px',
|
||||
'borderStyle' => 'solid',
|
||||
'borderWidth' => '3px',
|
||||
'borderColor' => '#aaaaaa',
|
||||
],
|
||||
],
|
||||
],
|
||||
'backgroundColor' => '#ffffff',
|
||||
'backgroundColorAlternate' => '#eeeeee',
|
||||
],
|
||||
'divider' =>
|
||||
[
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'padding' => '17px',
|
||||
'borderStyle' => 'solid',
|
||||
'borderWidth' => '1px',
|
||||
'borderColor' => '#aaaaaa',
|
||||
],
|
||||
],
|
||||
'type' => 'divider',
|
||||
],
|
||||
'footer' =>
|
||||
[
|
||||
'text' => '<p><a href="[link:subscription_unsubscribe_url]">' . __("Unsubscribe", 'mailpoet') . '</a> | <a href="[link:subscription_manage_url]">' . __("Manage your subscription", 'mailpoet') . '</a><br />' . __("Add your postal address here!", 'mailpoet') . '</p>',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
'text' =>
|
||||
[
|
||||
'fontColor' => '#222222',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '12px',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
'link' =>
|
||||
[
|
||||
'fontColor' => '#6cb7d4',
|
||||
'textDecoration' => 'none',
|
||||
],
|
||||
],
|
||||
'type' => 'footer',
|
||||
],
|
||||
'posts' =>
|
||||
[
|
||||
'amount' => '10',
|
||||
'contentType' => 'post',
|
||||
'postStatus' => 'publish',
|
||||
'inclusionType' => 'include',
|
||||
'displayType' => 'excerpt',
|
||||
'titleFormat' => 'h1',
|
||||
'titleAlignment' => 'left',
|
||||
'titleIsLink' => false,
|
||||
'imageFullWidth' => false,
|
||||
'featuredImagePosition' => 'belowTitle',
|
||||
'showAuthor' => 'no',
|
||||
'authorPrecededBy' => 'Author:',
|
||||
'showCategories' => 'no',
|
||||
'categoriesPrecededBy' => 'Categories:',
|
||||
'readMoreType' => 'link',
|
||||
'readMoreText' => 'Read more',
|
||||
'readMoreButton' =>
|
||||
[
|
||||
'text' => 'Read more',
|
||||
'url' => '[postLink]',
|
||||
'context' => 'posts.readMoreButton',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => '#2ea1cd',
|
||||
'borderColor' => '#0074a2',
|
||||
'borderWidth' => '1px',
|
||||
'borderRadius' => '5px',
|
||||
'borderStyle' => 'solid',
|
||||
'width' => '180px',
|
||||
'lineHeight' => '40px',
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Verdana',
|
||||
'fontSize' => '18px',
|
||||
'fontWeight' => 'normal',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
'sortBy' => 'newest',
|
||||
'showDivider' => true,
|
||||
'divider' =>
|
||||
[
|
||||
'context' => 'posts.divider',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'padding' => '13px',
|
||||
'borderStyle' => 'solid',
|
||||
'borderWidth' => '3px',
|
||||
'borderColor' => '#aaaaaa',
|
||||
],
|
||||
],
|
||||
],
|
||||
'backgroundColor' => '#ffffff',
|
||||
'backgroundColorAlternate' => '#eeeeee',
|
||||
],
|
||||
'social' =>
|
||||
[
|
||||
'iconSet' => 'circles',
|
||||
'icons' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'facebook',
|
||||
'link' => 'http://www.facebook.com',
|
||||
'image' => $this->social_icon_url . '/03-circles/Facebook.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Facebook',
|
||||
],
|
||||
1 =>
|
||||
[
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'twitter',
|
||||
'link' => 'http://www.twitter.com',
|
||||
'image' => $this->social_icon_url . '/03-circles/Twitter.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Twitter',
|
||||
],
|
||||
2 =>
|
||||
[
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'instagram',
|
||||
'link' => 'http://instagram.com',
|
||||
'image' => $this->social_icon_url . '/03-circles/Instagram.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Instagram',
|
||||
],
|
||||
],
|
||||
'type' => 'social',
|
||||
],
|
||||
'spacer' =>
|
||||
[
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '231px',
|
||||
],
|
||||
],
|
||||
'type' => 'spacer',
|
||||
],
|
||||
'header' =>
|
||||
[
|
||||
'text' => '<a href="[link:newsletter_view_in_browser_url]">' . __("View this in your browser.", 'mailpoet') . '</a>',
|
||||
'styles' =>
|
||||
[
|
||||
'block' =>
|
||||
[
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
'text' =>
|
||||
[
|
||||
'fontColor' => '#222222',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '12px',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
'link' =>
|
||||
[
|
||||
'fontColor' => '#6cb7d4',
|
||||
'textDecoration' => 'underline',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,789 @@
|
||||
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
|
||||
|
||||
namespace MailPoet\Config\PopulatorData\Templates;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
class WorldCup {
|
||||
|
||||
private $template_image_url;
|
||||
private $social_icon_url;
|
||||
|
||||
public function __construct(
|
||||
$assets_url
|
||||
) {
|
||||
$this->template_image_url = 'https://ps.w.org/mailpoet/assets/newsletter-templates/world_cup';
|
||||
$this->social_icon_url = $assets_url . '/img/newsletter_editor/social-icons';
|
||||
}
|
||||
|
||||
public function get() {
|
||||
return [
|
||||
'name' => __("World Cup", 'mailpoet'),
|
||||
'categories' => json_encode(['standard', 'all']),
|
||||
'readonly' => 1,
|
||||
'thumbnail' => $this->getThumbnail(),
|
||||
'body' => json_encode($this->getBody()),
|
||||
];
|
||||
}
|
||||
|
||||
private function getBody() {
|
||||
return [
|
||||
'content' => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#222222',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/Sports-Football-Header.png',
|
||||
'alt' => 'Sports-Football-Header',
|
||||
'fullWidth' => true,
|
||||
'width' => '1280px',
|
||||
'height' => '220px',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/Sports-Football-Divider-1.png',
|
||||
'alt' => 'Sports-Football-Divider-1',
|
||||
'fullWidth' => true,
|
||||
'width' => '1280px',
|
||||
'height' => '50px',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#da6110',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => '<p><strong><span style="color: #ffffff; font-size: 14px;">Issue #1</span></strong></p>',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => '<p style="text-align: right;"><a href="[link:newsletter_view_in_browser_url]" target="_blank" style="color: #ffffff; font-size: 14px; text-align: center;">View In Browser</a></p>
|
||||
<p style="text-align: right;"><span style="color: #ffffff; text-align: start;">Monday 1st January 2017</span></p>',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#ffffff',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#da6110',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/Sports-Football-Header-1.png',
|
||||
'alt' => 'Sports-Football-Header',
|
||||
'fullWidth' => true,
|
||||
'width' => '1280px',
|
||||
'height' => '580px',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '30px',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => '<h2 style="text-align: left;"><strong>Welcome Back!</strong></h2>
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam consequat lorem at est congue, non consequat lacus iaculis. Integer euismod mauris velit, vel ultrices nibh bibendum quis. Donec eget fermentum magna.</p>
|
||||
<p></p>
|
||||
<p>Nullam congue dui lectus, quis pellentesque orci placerat eu. Fusce semper neque a mi aliquet vulputate sed sit amet nisi. Etiam sed nisl nec orci pretium lacinia eget in turpis. Maecenas in posuere justo. Vestibulum et sapien vestibulum, imperdiet neque in, maximus velit.</p>
|
||||
<p></p>
|
||||
<p>Proin dignissim elit magna, viverra scelerisque libero vehicula sed</p>',
|
||||
],
|
||||
[
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/Sports-Football-Divider-3.png',
|
||||
'alt' => 'Sports-Football-Divider-3',
|
||||
'fullWidth' => true,
|
||||
'width' => '1280px',
|
||||
'height' => '50px',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#efefef',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#efefef',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => '<h2 style="padding-bottom: 0;"><span style="font-weight: 600;">Latest News</span></h2>',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'button',
|
||||
'text' => 'View All News',
|
||||
'url' => '',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#d35400',
|
||||
'borderColor' => '#d35400',
|
||||
'borderWidth' => '1px',
|
||||
'borderRadius' => '5px',
|
||||
'borderStyle' => 'solid',
|
||||
'width' => '110px',
|
||||
'lineHeight' => '36px',
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Tahoma',
|
||||
'fontSize' => '14px',
|
||||
'fontWeight' => 'normal',
|
||||
'textAlign' => 'right',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#efefef',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#efefef',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'image',
|
||||
'link' => 'http://mailpoet.info/brazils-history-making-hurricane/',
|
||||
'src' => $this->template_image_url . '/2865897_full-lnd.jpg',
|
||||
'alt' => 'Brazil’s history-making Hurricane',
|
||||
'fullWidth' => false,
|
||||
'width' => 652,
|
||||
'height' => 366,
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => '<h3 style="text-align: left;"><strong>Brazil’s history-making Hurricane</strong></h3>
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam consequat lorem at est congue, non consequat lacus iaculis. Integer euismod mauris velit, vel ultrices nibh bibendum quis. Donec eget fermentum magna. Nullam congue dui lectus, quis pellentesque orci placerat eu. Fusce semper neque a mi aliquet vulputate sed sit amet nisi...</p>
|
||||
<p><a href="http://mailpoet.info/brazils-history-making-hurricane/">Read More</a></p>',
|
||||
],
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#efefef',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'image',
|
||||
'link' => 'http://mailpoet.info/icelands-dentist-coach-defying-convention-and-expectations/',
|
||||
'src' => $this->template_image_url . '/2866107_full-lnd.jpg',
|
||||
'alt' => 'Iceland’s dentist-coach defying convention and expectations',
|
||||
'fullWidth' => false,
|
||||
'width' => 652,
|
||||
'height' => 366,
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => '<h3><strong>Iceland’s dentist-coach defying convention and expectations</strong></h3>
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam consequat lorem at est congue, non consequat lacus iaculis. Integer euismod mauris velit...</p>
|
||||
<p><a href="http://mailpoet.info/icelands-dentist-coach-defying-convention-and-expectations/">Read More</a></p>',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'image',
|
||||
'link' => 'http://mailpoet.info/impact-and-legacy-of-2018-fifa-world-cup-russia-facts-and-figures/',
|
||||
'src' => $this->template_image_url . '/2709222_full-lnd.jpg',
|
||||
'alt' => 'Impact and legacy of 2018 FIFA World Cup Russia: facts and figures',
|
||||
'fullWidth' => false,
|
||||
'width' => 652,
|
||||
'height' => 366,
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => '<h3 style="text-align: left;"><strong>Impact and legacy of 2018 FIFA World Cup Russia: facts and figures</strong></h3>
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam consequat lorem at est congue, non consequat lacus iaculis. Integer euismod...</p>
|
||||
<p><a href="http://mailpoet.info/impact-and-legacy-of-2018-fifa-world-cup-russia-facts-and-figures/">Read More</a></p>',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'image',
|
||||
'link' => 'http://mailpoet.info/linekers-life-changing-treble/',
|
||||
'src' => $this->template_image_url . '/2867790_full-lnd.jpg',
|
||||
'alt' => 'Lineker’s life-changing treble',
|
||||
'fullWidth' => false,
|
||||
'width' => 652,
|
||||
'height' => 366,
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
|
||||
[
|
||||
'type' => 'text',
|
||||
'text' => '<h3 style="text-align: left;"><strong>Lineker’s life-changing treble</strong></h3>
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam consequat lorem at est congue, non consequat lacus iaculis. Integer euismod mauris velit <span style="background-color: inherit;">consequat lorem at est congue...</span></p>
|
||||
<p><a href="http://mailpoet.info/linekers-life-changing-treble/">Read More</a></p>',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#f8f8f8',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#efefef',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/Sports-Football-Divider-2.png',
|
||||
'alt' => 'Sports-Football-Divider-2',
|
||||
'fullWidth' => true,
|
||||
'width' => '1280px',
|
||||
'height' => '50px',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#222222',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/Sports-Football-Footer-1.png',
|
||||
'alt' => 'Sports-Football-Footer',
|
||||
'fullWidth' => true,
|
||||
'width' => '1280px',
|
||||
'height' => '500px',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#da6110',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#da6110',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'social',
|
||||
'iconSet' => 'full-symbol-grey',
|
||||
'icons' => [
|
||||
[
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'facebook',
|
||||
'link' => 'http://www.facebook.com',
|
||||
'image' => $this->social_icon_url . '/08-full-symbol-grey/Facebook.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Facebook',
|
||||
],
|
||||
[
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'twitter',
|
||||
'link' => 'http://www.twitter.com',
|
||||
'image' => $this->social_icon_url . '/08-full-symbol-grey/Twitter.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Twitter',
|
||||
],
|
||||
[
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'youtube',
|
||||
'link' => 'http://www.youtube.com',
|
||||
'image' => $this->social_icon_url . '/08-full-symbol-grey/Youtube.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Youtube',
|
||||
],
|
||||
[
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'instagram',
|
||||
'link' => 'http://instagram.com',
|
||||
'image' => $this->social_icon_url . '/08-full-symbol-grey/Instagram.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Instagram',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#b55311',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#da6110',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/Sports-Football-Logo-Small.png',
|
||||
'alt' => 'Sports-Football-Logo-Small',
|
||||
'fullWidth' => false,
|
||||
'width' => '772px',
|
||||
'height' => '171px',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#da6110',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'footer',
|
||||
'text' => '<p><a href="[link:subscription_unsubscribe_url]">' . __("Unsubscribe", 'mailpoet') . '</a> | <a href="[link:subscription_manage_url]">' . __("Manage your subscription", 'mailpoet') . '</a><br />' . __("Add your postal address here!", 'mailpoet') . '</p>',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
'text' => [
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Tahoma',
|
||||
'fontSize' => '12px',
|
||||
'textAlign' => 'right',
|
||||
],
|
||||
'link' => [
|
||||
'fontColor' => '#ffffff',
|
||||
'textDecoration' => 'underline',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
'globalStyles' => [
|
||||
'text' => [
|
||||
'fontColor' => '#000000',
|
||||
'fontFamily' => 'Tahoma',
|
||||
'fontSize' => '14px',
|
||||
],
|
||||
'h1' => [
|
||||
'fontColor' => '#111111',
|
||||
'fontFamily' => 'Tahoma',
|
||||
'fontSize' => '30px',
|
||||
],
|
||||
'h2' => [
|
||||
'fontColor' => '#da6110',
|
||||
'fontFamily' => 'Tahoma',
|
||||
'fontSize' => '24px',
|
||||
],
|
||||
'h3' => [
|
||||
'fontColor' => '#333333',
|
||||
'fontFamily' => 'Tahoma',
|
||||
'fontSize' => '18px',
|
||||
],
|
||||
'link' => [
|
||||
'fontColor' => '#da6110',
|
||||
'textDecoration' => 'underline',
|
||||
],
|
||||
'wrapper' => [
|
||||
'backgroundColor' => '#ffffff',
|
||||
],
|
||||
'body' => [
|
||||
'backgroundColor' => '#222222',
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
private function getThumbnail() {
|
||||
return $this->template_image_url . '/thumbnail.20190411-1500.jpg';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,797 @@
|
||||
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
|
||||
|
||||
namespace MailPoet\Config\PopulatorData\Templates;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
class YogaStudio {
|
||||
|
||||
private $template_image_url;
|
||||
private $social_icon_url;
|
||||
|
||||
public function __construct(
|
||||
$assets_url
|
||||
) {
|
||||
$this->template_image_url = 'https://ps.w.org/mailpoet/assets/newsletter-templates/yoga_studio';
|
||||
$this->social_icon_url = $assets_url . '/img/newsletter_editor/social-icons';
|
||||
}
|
||||
|
||||
public function get() {
|
||||
return [
|
||||
'name' => __("Yoga Studio", 'mailpoet'),
|
||||
'categories' => json_encode(['standard', 'all']),
|
||||
'readonly' => 1,
|
||||
'thumbnail' => $this->getThumbnail(),
|
||||
'body' => json_encode($this->getBody()),
|
||||
];
|
||||
}
|
||||
|
||||
private function getBody() {
|
||||
return [
|
||||
'content' => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#f8f8f8',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#1e2937',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#ffffff',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/yoga-1.png',
|
||||
'alt' => 'yoga-1',
|
||||
'fullWidth' => true,
|
||||
'width' => '1280px',
|
||||
'height' => '740px',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '30px',
|
||||
],
|
||||
],
|
||||
],
|
||||
2 => [
|
||||
'type' => 'text',
|
||||
'text' => '<h2 style="text-align: center;"><strong>Here\'s your classes for this week:</strong></h2>',
|
||||
],
|
||||
3 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
2 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'text',
|
||||
'text' => '<h3><strong><span style="color: #83bd31;"><em>Weekdays</em></span></strong></h3>
|
||||
<p><strong>Monday</strong>: 7am, 9am, 11am, 3pm and 5pm.</p>
|
||||
<p><strong>Tuesday</strong>: 7am, 9am, 11am, 3pm and 5pm.</p>
|
||||
<p><strong>Wednesday</strong>: 7am, 9am, 11am, 3pm and 5pm.</p>
|
||||
<p><strong>Thursday</strong>: CLOSED FOR PRIVATE CLASS.</p>
|
||||
<p><strong>Friday</strong>: 7am, 9am, 11am, and 3pm.</p>',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'text',
|
||||
'text' => '<h3><strong><span style="color: #83bd31;"><em>Weekend</em></span></strong></h3>
|
||||
<p><strong>Saturday</strong>: 7am, 9am, 11am, 3pm and 5pm.</p>
|
||||
<p><strong>Sunday</strong>: 7am, 9am, 11am, 3pm and 5pm.</p>
|
||||
<p></p>',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
3 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'divider',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'padding' => '22px',
|
||||
'borderStyle' => 'solid',
|
||||
'borderWidth' => '1px',
|
||||
'borderColor' => '#d5d5d5',
|
||||
],
|
||||
],
|
||||
],
|
||||
2 => [
|
||||
'type' => 'text',
|
||||
'text' => '<h3 style="text-align: center;"><span style="font-weight: 600;">Meet the instructors</span></h3>',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
4 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/yoga-person-1.png',
|
||||
'alt' => 'yoga-person-1',
|
||||
'fullWidth' => false,
|
||||
'width' => '400px',
|
||||
'height' => '400px',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
2 => [
|
||||
'type' => 'text',
|
||||
'text' => '<h3 style="text-align: center;"><span style="color: #83bd31;"><span style="font-weight: 600;">Maria Smith</span></span></h3>
|
||||
<p style="text-align: center;">Nullam hendrerit feugiat feugiat. Praesent mollis ante lacus, quis tempor leo sagittis vel. Donec sagittis eros at felis venenatis ultricies.</p>',
|
||||
],
|
||||
3 => [
|
||||
'type' => 'button',
|
||||
'text' => 'Find Out More',
|
||||
'url' => '',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#83bd31',
|
||||
'borderColor' => '#83bd31',
|
||||
'borderWidth' => '1px',
|
||||
'borderRadius' => '40px',
|
||||
'borderStyle' => 'solid',
|
||||
'width' => '180px',
|
||||
'lineHeight' => '30px',
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '14px',
|
||||
'fontWeight' => 'normal',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
4 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '30px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/yoga-person-2.png',
|
||||
'alt' => 'yoga-person-2',
|
||||
'fullWidth' => false,
|
||||
'width' => '400px',
|
||||
'height' => '400px',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
2 => [
|
||||
'type' => 'text',
|
||||
'text' => '<h3 style="text-align: center;"><span style="color: #83bd31;"><span style="font-weight: 600;">Fiona Davies</span></span></h3>
|
||||
<p style="text-align: center;">Nullam hendrerit feugiat feugiat. Praesent mollis ante lacus, quis tempor leo sagittis vel. Donec sagittis eros at felis venenatis ultricies.</p>',
|
||||
],
|
||||
3 => [
|
||||
'type' => 'button',
|
||||
'text' => 'Find Out More',
|
||||
'url' => '',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#83bd31',
|
||||
'borderColor' => '#83bd31',
|
||||
'borderWidth' => '1px',
|
||||
'borderRadius' => '40px',
|
||||
'borderStyle' => 'solid',
|
||||
'width' => '180px',
|
||||
'lineHeight' => '30px',
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '14px',
|
||||
'fontWeight' => 'normal',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
4 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '30px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
2 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/yoga-person-3.png',
|
||||
'alt' => 'yoga-person-3',
|
||||
'fullWidth' => false,
|
||||
'width' => '400px',
|
||||
'height' => '400px',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
2 => [
|
||||
'type' => 'text',
|
||||
'text' => '<h3 style="text-align: center;"><span style="color: #83bd31;"><span style="font-weight: 600;">Matthew Johnson</span></span></h3>
|
||||
<p style="text-align: center;">Nullam hendrerit feugiat feugiat. Praesent mollis ante lacus, quis tempor leo sagittis vel. Donec sagittis eros at felis venenatis ultricies.</p>',
|
||||
],
|
||||
3 => [
|
||||
'type' => 'button',
|
||||
'text' => 'Find Out More',
|
||||
'url' => '',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#83bd31',
|
||||
'borderColor' => '#83bd31',
|
||||
'borderWidth' => '1px',
|
||||
'borderRadius' => '40px',
|
||||
'borderStyle' => 'solid',
|
||||
'width' => '180px',
|
||||
'lineHeight' => '31px',
|
||||
'fontColor' => '#ffffff',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '14px',
|
||||
'fontWeight' => 'normal',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
4 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '30px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
5 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#83bd31',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '40px',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'text',
|
||||
'text' => '<p><strong>Pose of the week:</strong></p>
|
||||
<h2>Virabhadrasana I</h2>
|
||||
<p>The myth is that the powerful priest Daksha made a great yagna (ritual sacrifice) but did not invite his youngest daughter Sati and her husband Shiva, the supreme ruler of the universe. Sati found out and decided to go alone to the yagna.</p>
|
||||
<p></p>
|
||||
<p>When she arrived, Sati entered into an argument with her father. Unable to withstand his insults, she spoke a vow to her father, “Since it was you who gave me this body, I no longer wish to be associated with it.”</p>',
|
||||
],
|
||||
2 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '40px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '40px',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/yoga-pose.png',
|
||||
'alt' => 'yoga-pose',
|
||||
'fullWidth' => false,
|
||||
'width' => '400px',
|
||||
'height' => '400px',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
2 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '35px',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
6 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#ffffff',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
'height' => '40px',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'text',
|
||||
'text' => '<h3 style="text-align: center;"><span style="font-weight: 600;">Quote of the week</span></h3>',
|
||||
],
|
||||
2 => [
|
||||
'type' => 'text',
|
||||
'text' => '<h2 style="text-align: center;"><em>Be a lamp to yourself. Be your own confidence. Hold on to the truth within yourself as to the only truth.</em></h2>
|
||||
<p style="text-align: center;"><span style="font-family: Arial, sans-serif; font-size: 14px; text-align: center; color: #999999;">Buddha</span><em></em></p>',
|
||||
],
|
||||
3 => [
|
||||
'type' => 'spacer',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#ffffff',
|
||||
'height' => '20px',
|
||||
],
|
||||
],
|
||||
],
|
||||
4 => [
|
||||
'type' => 'divider',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#d5d5d5',
|
||||
'padding' => '15px',
|
||||
'borderStyle' => 'solid',
|
||||
'borderWidth' => '1px',
|
||||
'borderColor' => '#b3b3b3',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
7 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#d5d5d5',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'image',
|
||||
'link' => '',
|
||||
'src' => $this->template_image_url . '/yoga-logo-small.png',
|
||||
'alt' => 'yoga-logo-small',
|
||||
'fullWidth' => false,
|
||||
'width' => '50px',
|
||||
'height' => '50px',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'social',
|
||||
'iconSet' => 'full-symbol-black',
|
||||
'icons' => [
|
||||
0 => [
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'facebook',
|
||||
'link' => 'http://www.facebook.com',
|
||||
'image' => $this->social_icon_url . '/07-full-symbol-black/Facebook.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Facebook',
|
||||
],
|
||||
1 => [
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'twitter',
|
||||
'link' => 'http://www.twitter.com',
|
||||
'image' => $this->social_icon_url . '/07-full-symbol-black/Twitter.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Twitter',
|
||||
],
|
||||
2 => [
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'instagram',
|
||||
'link' => 'http://instagram.com',
|
||||
'image' => $this->social_icon_url . '/07-full-symbol-black/Instagram.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Instagram',
|
||||
],
|
||||
3 => [
|
||||
'type' => 'socialIcon',
|
||||
'iconType' => 'youtube',
|
||||
'link' => 'http://www.youtube.com',
|
||||
'image' => $this->social_icon_url . '/07-full-symbol-black/Youtube.png',
|
||||
'height' => '32px',
|
||||
'width' => '32px',
|
||||
'text' => 'Youtube',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
1 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'text',
|
||||
'text' => '<p style="font-size: 13px; text-align: center;"><strong>Yoga Studio</strong></p>
|
||||
<p style="font-size: 11px; text-align: center;">Address Line 1</p>
|
||||
<p style="font-size: 11px; text-align: center;">Address Line 2</p>
|
||||
<p style="font-size: 11px; text-align: center;">City/Town</p>
|
||||
<p style="font-size: 11px; text-align: center;">Country</p>',
|
||||
],
|
||||
],
|
||||
],
|
||||
2 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'footer',
|
||||
'text' => '<p><a href="[link:subscription_unsubscribe_url]">' . __("Unsubscribe", 'mailpoet') . '</a></p><p><a href="[link:subscription_manage_url]">' . __("Manage your subscription", 'mailpoet') . '</a></p>',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
'text' => [
|
||||
'fontColor' => '#222222',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '11px',
|
||||
'textAlign' => 'center',
|
||||
],
|
||||
'link' => [
|
||||
'fontColor' => '#000000',
|
||||
'textDecoration' => 'underline',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
8 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'horizontal',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'container',
|
||||
'orientation' => 'vertical',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => 'transparent',
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
0 => [
|
||||
'type' => 'divider',
|
||||
'styles' => [
|
||||
'block' => [
|
||||
'backgroundColor' => '#d5d5d5',
|
||||
'padding' => '13px',
|
||||
'borderStyle' => 'solid',
|
||||
'borderWidth' => '1px',
|
||||
'borderColor' => '#aaaaaa',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
'globalStyles' => [
|
||||
'text' => [
|
||||
'fontColor' => '#1e2937',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '13px',
|
||||
],
|
||||
'h1' => [
|
||||
'fontColor' => '#1e2937',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '30px',
|
||||
],
|
||||
'h2' => [
|
||||
'fontColor' => '#1e2937',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '24px',
|
||||
],
|
||||
'h3' => [
|
||||
'fontColor' => '#1e2937',
|
||||
'fontFamily' => 'Arial',
|
||||
'fontSize' => '20px',
|
||||
],
|
||||
'link' => [
|
||||
'fontColor' => '#83bd31',
|
||||
'textDecoration' => 'underline',
|
||||
],
|
||||
'wrapper' => [
|
||||
'backgroundColor' => '#ffffff',
|
||||
],
|
||||
'body' => [
|
||||
'backgroundColor' => '#1e2937',
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
private function getThumbnail() {
|
||||
return $this->template_image_url . '/thumbnail.20190411-1500.jpg';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<?php
|
||||
@@ -0,0 +1 @@
|
||||
<?php
|
||||
@@ -0,0 +1,91 @@
|
||||
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
|
||||
|
||||
namespace MailPoet\Config;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
use MailPoet\Util\Helpers;
|
||||
use MailPoet\WooCommerce\Helper as WooCommerceHelper;
|
||||
use MailPoet\WP\Functions as WPFunctions;
|
||||
|
||||
class PrivacyPolicy {
|
||||
public function init() {
|
||||
if (function_exists('wp_add_privacy_policy_content')) {
|
||||
wp_add_privacy_policy_content(__('MailPoet', 'mailpoet'), $this->getPrivacyPolicyContent());
|
||||
}
|
||||
}
|
||||
|
||||
public function getPrivacyPolicyContent() {
|
||||
$content = (
|
||||
'<h2>' .
|
||||
__('MailPoet newsletter & emails', 'mailpoet') .
|
||||
'</h2>' .
|
||||
'<p>' .
|
||||
__('If you have subscribed to our newsletter or if you are a member of our website (you can log in) or if you have purchased on our website, there is a good chance you will receive emails from us.', 'mailpoet') .
|
||||
'</p>' .
|
||||
'<p>' .
|
||||
__('We will only send you emails which you have signed up to receive, or which pertain to the services we provided to you.', 'mailpoet') .
|
||||
'</p>' .
|
||||
'<p>' .
|
||||
__('To send you emails, we use the name and email address you provide us. Our site also logs the IP address you used when you signed up for the service to prevent abuse of the system.', 'mailpoet') .
|
||||
'</p>' .
|
||||
'<p>' .
|
||||
Helpers::replaceLinkTags(
|
||||
__('This website can send emails through the [link]MailPoet Sending Service[/link]. This service allows us to track opens and clicks on our emails. We use this information to improve the content of our newsletters.', 'mailpoet'),
|
||||
'https://www.mailpoet.com/privacy-notice/',
|
||||
['target' => '_blank']
|
||||
) .
|
||||
'</p>' .
|
||||
'<p>' .
|
||||
__('No identifiable information is otherwise tracked outside this website except for the email address.', 'mailpoet') .
|
||||
'</p>'
|
||||
);
|
||||
$helper = new WooCommerceHelper(WPFunctions::get());
|
||||
if ($helper->isWooCommerceActive()) {
|
||||
$content .= (
|
||||
'<p> ' .
|
||||
__('Below is a list of cookies that may be generated by MailPoet (note that some cookies are only utilized when WooCommerce is installed and activated):', 'mailpoet') .
|
||||
'</p>' .
|
||||
'<p>' .
|
||||
// translators: %s is the name of the cookie.
|
||||
sprintf(__('Cookie name: %s', 'mailpoet'), 'mailpoet_page_view') .
|
||||
'<br>' .
|
||||
// translators: %s is the number of days.
|
||||
sprintf(__('Cookie expiry: %s days.', 'mailpoet'), WPFunctions::get()->numberFormatI18n(3650)) .
|
||||
'<br>' .
|
||||
__('Cookie description: The purpose of this cookie is to track the last time a subscriber viewed any page on the site.', 'mailpoet') .
|
||||
'</p> ' .
|
||||
'<p>' .
|
||||
// translators: %s is the name of the cookie.
|
||||
sprintf(__('Cookie name: %s', 'mailpoet'), 'mailpoet_revenue_tracking') .
|
||||
'<br>' .
|
||||
// translators: %s is the number of days.
|
||||
sprintf(__('Cookie expiry: %s days.', 'mailpoet'), WPFunctions::get()->numberFormatI18n(14)) .
|
||||
'<br>' .
|
||||
__('Cookie description: The purpose of this cookie is to track which newsletter sent from your website has acquired a click-through and a subsequent purchase in your WooCommerce store.', 'mailpoet') .
|
||||
'</p> ' .
|
||||
'<p>' .
|
||||
// translators: %s is the name of the cookie.
|
||||
sprintf(__('Cookie name: %s', 'mailpoet'), 'mailpoet_subscriber') .
|
||||
'<br>' .
|
||||
// translators: %s is the number of days.
|
||||
sprintf(__('Cookie expiry: %s days.', 'mailpoet'), WPFunctions::get()->numberFormatI18n(3650)) .
|
||||
'<br>' .
|
||||
__('Cookie description: The purpose of this cookie is to track subscriber engagement. It is used when the user logs in, signs up in a form, confirms subscription to a newsletter, or places an order through WooCommerce.', 'mailpoet') .
|
||||
'<br>' .
|
||||
__('Note: User must be opted-in and a confirmed subscriber.', 'mailpoet') .
|
||||
'</p>' .
|
||||
'<p>' .
|
||||
// translators: %s is the name of the cookie.
|
||||
sprintf(__('Cookie name: %s', 'mailpoet'), 'popup_form_dismissed_{$formId}') .
|
||||
'<br>' .
|
||||
__('Cookie expiry: the expiration date varies and can be set per form.', 'mailpoet') .
|
||||
'<br>' .
|
||||
__("Cookie description: This cookie is used to track if a user has previously dismissed a specific form, preventing the re-display of the form until the cookie's expiration date. It is applicable for popup, slide-in, or fixed bar forms.", 'mailpoet') .
|
||||
'</p>'
|
||||
);
|
||||
}
|
||||
return $content;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,150 @@
|
||||
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
|
||||
|
||||
namespace MailPoet\Config;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
use MailPoet\Twig;
|
||||
use MailPoet\WP\Functions as WPFunctions;
|
||||
use MailPoetVendor\Twig\Extension\DebugExtension;
|
||||
use MailPoetVendor\Twig\Lexer as TwigLexer;
|
||||
use MailPoetVendor\Twig\Loader\FilesystemLoader as TwigFileSystem;
|
||||
|
||||
class Renderer {
|
||||
protected $cachePath;
|
||||
protected $debuggingEnabled;
|
||||
protected $renderer;
|
||||
public $assetsManifestJs;
|
||||
public $assetsManifestCss;
|
||||
|
||||
public function __construct(
|
||||
bool $debuggingEnabled,
|
||||
string $cachePath,
|
||||
TwigFileSystem $fileSystem,
|
||||
bool $autoReload = false
|
||||
) {
|
||||
$this->debuggingEnabled = $debuggingEnabled;
|
||||
$this->cachePath = $cachePath;
|
||||
$this->renderer = new TwigEnvironment(
|
||||
$fileSystem,
|
||||
[
|
||||
'cache' => new TwigFileSystemCache($cachePath),
|
||||
'debug' => $this->debuggingEnabled,
|
||||
'auto_reload' => $autoReload,
|
||||
]
|
||||
);
|
||||
|
||||
$this->assetsManifestJs = $this->getAssetManifest(Env::$assetsPath . '/dist/js/manifest.json');
|
||||
$this->assetsManifestCss = $this->getAssetManifest(Env::$assetsPath . '/dist/css/manifest.json');
|
||||
$this->setupDebug();
|
||||
$this->setupTranslations();
|
||||
$this->setupFunctions();
|
||||
$this->setupFilters();
|
||||
$this->setupHandlebars();
|
||||
$this->setupAnalytics();
|
||||
$this->setupGlobalVariables();
|
||||
$this->setupSyntax();
|
||||
}
|
||||
|
||||
public function getTwig(): TwigEnvironment {
|
||||
return $this->renderer;
|
||||
}
|
||||
|
||||
public function setupTranslations() {
|
||||
$this->renderer->addExtension(new Twig\I18n(Env::$pluginName));
|
||||
}
|
||||
|
||||
public function setupFunctions() {
|
||||
$this->renderer->addExtension(new Twig\Functions());
|
||||
}
|
||||
|
||||
public function setupFilters() {
|
||||
$this->renderer->addExtension(new Twig\Filters());
|
||||
}
|
||||
|
||||
public function setupHandlebars() {
|
||||
$this->renderer->addExtension(new Twig\Handlebars());
|
||||
}
|
||||
|
||||
public function setupAnalytics() {
|
||||
$this->renderer->addExtension(new Twig\Analytics());
|
||||
}
|
||||
|
||||
public function setupGlobalVariables() {
|
||||
$this->renderer->addExtension(
|
||||
new Twig\Assets(
|
||||
[
|
||||
'version' => Env::$version,
|
||||
'assets_url' => Env::$assetsUrl,
|
||||
'assets_manifest_js' => $this->assetsManifestJs,
|
||||
'assets_manifest_css' => $this->assetsManifestCss,
|
||||
],
|
||||
WPFunctions::get()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public function setupSyntax() {
|
||||
$lexer = new TwigLexer($this->renderer, [
|
||||
'tag_comment' => ['<#', '#>'],
|
||||
'tag_block' => ['<%', '%>'],
|
||||
'tag_variable' => ['<%=', '%>'],
|
||||
'interpolation' => ['%{', '}'],
|
||||
]);
|
||||
$this->renderer->setLexer($lexer);
|
||||
}
|
||||
|
||||
public function setupDebug() {
|
||||
if ($this->debuggingEnabled) {
|
||||
$this->renderer->addExtension(new DebugExtension());
|
||||
}
|
||||
}
|
||||
|
||||
public function render($template, $context = []) {
|
||||
try {
|
||||
$loaded = $this->renderer->load($template);
|
||||
|
||||
// schedule "after_javascript" block to be printed only after other scripts
|
||||
if ($loaded->hasBlock('after_javascript')) {
|
||||
$afterJs = $loaded->renderBlock('after_javascript', $context);
|
||||
WPFunctions::get()->addAction('admin_print_footer_scripts', function () use ($afterJs): void {
|
||||
// This is content is generated by Twig.
|
||||
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
echo $afterJs;
|
||||
});
|
||||
}
|
||||
return $loaded->render($context);
|
||||
} catch (\RuntimeException $e) {
|
||||
throw new \Exception(sprintf(
|
||||
// translators: %1$s is the name of the render, %2$s the folder path, %3$s the error message.
|
||||
__('Failed to render template "%1$s". Please ensure the template cache folder "%2$s" exists and has write permissions. Terminated with error: "%3$s"', 'mailpoet'),
|
||||
$template,
|
||||
$this->cachePath,
|
||||
$e->getMessage()
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
public function getAssetManifest($manifestFile) {
|
||||
if (is_readable($manifestFile)) {
|
||||
$contents = file_get_contents($manifestFile);
|
||||
if (is_string($contents)) {
|
||||
return json_decode($contents, true);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getJsAsset($asset) {
|
||||
return (!empty($this->assetsManifestJs[$asset])) ?
|
||||
$this->assetsManifestJs[$asset] :
|
||||
$asset;
|
||||
}
|
||||
|
||||
public function getCssAsset($asset) {
|
||||
return (!empty($this->assetsManifestCss[$asset])) ?
|
||||
$this->assetsManifestCss[$asset] :
|
||||
$asset;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
|
||||
|
||||
namespace MailPoet\Config;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
use MailPoetVendor\Twig\Loader\FilesystemLoader as TwigFileSystem;
|
||||
|
||||
class RendererFactory {
|
||||
|
||||
/** @var Renderer|null */
|
||||
private $renderer;
|
||||
|
||||
public function getRenderer() {
|
||||
if (!$this->renderer) {
|
||||
$debugging = WP_DEBUG;
|
||||
$autoReload = defined('MAILPOET_DEVELOPMENT') && MAILPOET_DEVELOPMENT;
|
||||
$this->renderer = new Renderer(
|
||||
$debugging,
|
||||
Env::$cachePath,
|
||||
new TwigFileSystem(Env::$viewsPath),
|
||||
$autoReload
|
||||
);
|
||||
}
|
||||
return $this->renderer;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
|
||||
|
||||
namespace MailPoet\Config;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
use MailPoet\Util\Helpers;
|
||||
use MailPoet\WP\Notice as WPNotice;
|
||||
|
||||
class RequirementsChecker {
|
||||
const TEST_FOLDER_PERMISSIONS = 'TempFolderCreation';
|
||||
const TEST_XML_EXTENSION = 'XmlExtension';
|
||||
const TEST_VENDOR_SOURCE = 'VendorSource';
|
||||
|
||||
public $displayErrorNotice;
|
||||
public $vendorClasses = [
|
||||
'\Cron\CronExpression',
|
||||
];
|
||||
|
||||
public function __construct(
|
||||
$displayErrorNotice = true
|
||||
) {
|
||||
$this->displayErrorNotice = $displayErrorNotice;
|
||||
}
|
||||
|
||||
public function checkAllRequirements() {
|
||||
$availableTests = [
|
||||
self::TEST_FOLDER_PERMISSIONS,
|
||||
self::TEST_XML_EXTENSION,
|
||||
self::TEST_VENDOR_SOURCE,
|
||||
];
|
||||
$results = [];
|
||||
foreach ($availableTests as $test) {
|
||||
$callback = [$this, 'check' . $test];
|
||||
if (is_callable($callback)) {
|
||||
$results[$test] = call_user_func($callback);
|
||||
}
|
||||
}
|
||||
return $results;
|
||||
}
|
||||
|
||||
public function checkTempFolderCreation() {
|
||||
$paths = [
|
||||
'temp_path' => Env::$tempPath,
|
||||
];
|
||||
if (!is_dir($paths['temp_path']) && !wp_mkdir_p($paths['temp_path'])) {
|
||||
$error = Helpers::replaceLinkTags(
|
||||
__('MailPoet requires write permissions inside the /wp-content/uploads folder. Please read our [link]instructions[/link] on how to resolve this issue.', 'mailpoet'),
|
||||
'https://kb.mailpoet.com/article/152-minimum-requirements-for-mailpoet-3#folder_permissions',
|
||||
['target' => '_blank']
|
||||
);
|
||||
return $this->processError($error);
|
||||
}
|
||||
foreach ($paths as $path) {
|
||||
$indexFile = $path . '/index.php';
|
||||
if (!file_exists($indexFile)) {
|
||||
file_put_contents(
|
||||
$path . '/index.php',
|
||||
str_replace('\n', PHP_EOL, '<?php\n\n// Silence is golden')
|
||||
);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function checkXmlExtension() {
|
||||
if (extension_loaded('xml')) return true;
|
||||
$error = Helpers::replaceLinkTags(
|
||||
__('MailPoet requires an XML PHP extension. Please read our [link]instructions[/link] on how to resolve this issue.', 'mailpoet'),
|
||||
'https://kb.mailpoet.com/article/152-minimum-requirements-for-mailpoet-3#php_extension',
|
||||
['target' => '_blank']
|
||||
);
|
||||
return $this->processError($error);
|
||||
}
|
||||
|
||||
public function checkVendorSource() {
|
||||
foreach ($this->vendorClasses as $dependency) {
|
||||
$dependencyPath = $this->getDependencyPath($dependency);
|
||||
if (!$dependencyPath) {
|
||||
$error = sprintf(
|
||||
// translators: %s is the dependency.
|
||||
__('A MailPoet dependency (%s) does not appear to be loaded correctly, thus MailPoet will not work correctly. Please reinstall the plugin.', 'mailpoet'),
|
||||
$dependency
|
||||
);
|
||||
|
||||
return $this->processError($error);
|
||||
}
|
||||
|
||||
$pattern = '#' . preg_quote(Env::$path) . '[\\\/]#';
|
||||
$isLoadedByPlugin = preg_match($pattern, $dependencyPath);
|
||||
if (!$isLoadedByPlugin) {
|
||||
$error = sprintf(
|
||||
// translators: %1$s is the dependency and %2$s the plugin.
|
||||
__('MailPoet has detected a dependency conflict (%1$s) with another plugin (%2$s), which may cause unexpected behavior. Please disable the offending plugin to fix this issue.', 'mailpoet'),
|
||||
$dependency,
|
||||
$dependencyPath
|
||||
);
|
||||
|
||||
return $this->processError($error);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private function getDependencyPath($namespacedClass) {
|
||||
try {
|
||||
$reflector = new \ReflectionClass($namespacedClass);
|
||||
return $reflector->getFileName();
|
||||
} catch (\ReflectionException $ex) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function processError($error) {
|
||||
if ($this->displayErrorNotice) {
|
||||
WPNotice::displayError($error);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user