Compare commits
148 Commits
Author | SHA1 | Date | |
---|---|---|---|
c3a97b7139 | |||
d59ace50f5 | |||
ff6f686333 | |||
2ef8512fa7 | |||
cabea5dadb | |||
b80505a17c | |||
df4d3bacab | |||
6dc0acb63a | |||
9ec6f52098 | |||
222d6b4eac | |||
0683dc9817 | |||
45e6ddd9cb | |||
c556ec64fc | |||
5bc9573ac6 | |||
a3d7afd1ca | |||
8c44ef561c | |||
c51a3f208c | |||
5524805ec3 | |||
816ec7e1d7 | |||
d74283ecad | |||
e810840445 | |||
b2e2087cfc | |||
69d920376f | |||
22efacd2d7 | |||
25c72c6ce7 | |||
e94d85fd47 | |||
c6b379c840 | |||
71bf3bbe19 | |||
6e60056061 | |||
96edbc159f | |||
c3c0765b78 | |||
b614997150 | |||
f81323ad52 | |||
cfc0d79bed | |||
c6adfc6a5c | |||
53149c291c | |||
e8f0a0067d | |||
cc4ff09aea | |||
be11558b68 | |||
77dfd28479 | |||
088a44a107 | |||
6b850d9d91 | |||
b878a73607 | |||
9fb5b80f21 | |||
d7b2cfd759 | |||
00be4849a5 | |||
5a13ed746f | |||
cd283c11fe | |||
57baff7b1d | |||
fd72756622 | |||
9b3abea2e5 | |||
19086f8457 | |||
42c557a981 | |||
e4db455a47 | |||
da059ad4b2 | |||
5d1f3153cd | |||
fcd8509cef | |||
b0f5b4cfe9 | |||
281e3c7eaa | |||
94efc67658 | |||
fc5bba9f11 | |||
ad731fc5ed | |||
4257ff6313 | |||
f9a3875de1 | |||
fcca86d607 | |||
b17d217669 | |||
556e4a0ce0 | |||
a72d84b940 | |||
049074e793 | |||
486c0ce4ee | |||
00d5623d72 | |||
7b6d8afc53 | |||
08cd4e09f9 | |||
7853271148 | |||
5614a7a4b2 | |||
acc7100109 | |||
e8c7dc937d | |||
c6273a6c3f | |||
15b4f7feb1 | |||
02e1f7f6dc | |||
356ca4c9d3 | |||
93f9c65736 | |||
5d5f3b8888 | |||
85c2d40492 | |||
0bb81660a5 | |||
07c63bbb89 | |||
a0007c048e | |||
b94d014e58 | |||
94f2d3f1df | |||
b208dca01d | |||
3e12ac8928 | |||
54e518e664 | |||
41eeae2d14 | |||
fdd1bce566 | |||
2215ce83b2 | |||
101ab67a83 | |||
deaebae034 | |||
4ae1f4a107 | |||
f5db5c3881 | |||
31067364f6 | |||
2c89b767a4 | |||
5b7a5bbf0f | |||
827c0860fc | |||
91364b391f | |||
57cfdee9ad | |||
814fceb297 | |||
ef17e82685 | |||
f6bf32de01 | |||
41880f72fd | |||
7d98de521d | |||
31f0a62a7a | |||
44c1d865ba | |||
bcb9f3cc86 | |||
4515cb345b | |||
c2bb93f3b7 | |||
868930d43a | |||
be17a35faa | |||
d42d48c716 | |||
017918c870 | |||
de6ba39595 | |||
4a641ba94e | |||
ed2ebeee52 | |||
c17c9d239d | |||
9b50163b10 | |||
0bab112f2b | |||
e7e091cb36 | |||
809240abb9 | |||
cb8ef72a85 | |||
079fe6f280 | |||
78967c8d6a | |||
64f83ef86c | |||
faed435500 | |||
edd447ce82 | |||
bb8a94d580 | |||
1f116d8cef | |||
f5c9d0f7db | |||
665fce9dbb | |||
624c6d900e | |||
ea4c5f46fb | |||
3ae8763837 | |||
fe69b56692 | |||
45433c9deb | |||
6437f4a1b3 | |||
6df1db933e | |||
db3ddd22f1 | |||
223c2e1562 | |||
0923c892c1 | |||
8cf5d17cfd |
@ -1,24 +1,28 @@
|
|||||||
version: 2
|
version: 2
|
||||||
jobs:
|
jobs:
|
||||||
qa_js_security_php5:
|
build_and_code_qa:
|
||||||
working_directory: /home/circleci/mailpoet
|
working_directory: /home/circleci/mailpoet
|
||||||
docker:
|
docker:
|
||||||
- image: mailpoet/wordpress:5.6.30_20180417.1
|
- image: mailpoet/wordpress:7.1_20180417.1
|
||||||
- image: circleci/mysql:5.7
|
|
||||||
environment:
|
environment:
|
||||||
TZ: /usr/share/zoneinfo/Etc/UTC
|
TZ: /usr/share/zoneinfo/Etc/UTC
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- run:
|
|
||||||
name: "Set up virtual host"
|
|
||||||
command: echo 127.0.0.1 mailpoet.loc | sudo tee -a /etc/hosts
|
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
key: composer-{{ checksum "composer.json" }}-{{ checksum "composer.lock" }}
|
key: composer-{{ checksum "composer.json" }}-{{ checksum "composer.lock" }}
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
key: npm-{{ checksum "package.json" }}
|
key: npm-{{ checksum "package.json" }}
|
||||||
- run:
|
- run:
|
||||||
name: "Set up test environment"
|
name: "Set up test environment"
|
||||||
command: source ./.circleci/setup.bash && setup php5
|
command: |
|
||||||
|
# Install NodeJS+NPM
|
||||||
|
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
|
||||||
|
sudo apt-get install nodejs build-essential
|
||||||
|
# install plugin dependencies
|
||||||
|
curl -sS https://getcomposer.org/installer | php
|
||||||
|
./composer.phar install
|
||||||
|
./do install
|
||||||
|
./do compile:all --env production
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: composer-{{ checksum "composer.json" }}-{{ checksum "composer.lock" }}
|
key: composer-{{ checksum "composer.json" }}-{{ checksum "composer.lock" }}
|
||||||
paths:
|
paths:
|
||||||
@ -27,50 +31,67 @@ jobs:
|
|||||||
key: npm-{{ checksum "package.json" }}
|
key: npm-{{ checksum "package.json" }}
|
||||||
paths:
|
paths:
|
||||||
- node_modules
|
- node_modules
|
||||||
- run:
|
|
||||||
name: "QA Scripts"
|
|
||||||
command: ./do qa
|
|
||||||
- run:
|
|
||||||
name: "Preparing test results folder"
|
|
||||||
command: mkdir test-results
|
|
||||||
- run:
|
|
||||||
name: "JS tests"
|
|
||||||
command: |
|
|
||||||
mkdir test-results/mocha
|
|
||||||
./do t:j test-results/mocha/junit.xml
|
|
||||||
- run:
|
- run:
|
||||||
name: "Composer security check"
|
name: "Composer security check"
|
||||||
command: |
|
command: |
|
||||||
./do s:composer
|
./do s:composer
|
||||||
- run:
|
- run:
|
||||||
name: "PHP Unit tests"
|
name: "QA Scripts"
|
||||||
command: |
|
command: ./do qa
|
||||||
WP_TEST_PATH="/home/circleci/mailpoet/wordpress" ./do t:u --xml
|
- persist_to_workspace:
|
||||||
- store_test_results:
|
root: /home/circleci/mailpoet
|
||||||
path: test-results/mocha
|
paths:
|
||||||
- store_artifacts:
|
- .
|
||||||
path: test-results/mocha
|
php5_and_js:
|
||||||
destination: mocha
|
working_directory: /home/circleci/mailpoet
|
||||||
- store_test_results:
|
docker:
|
||||||
path: tests/_output
|
- image: mailpoet/wordpress:5.6.30_20180417.1
|
||||||
- store_artifacts:
|
- image: circleci/mysql:5.7
|
||||||
path: tests/_output
|
environment:
|
||||||
destination: codeception
|
TZ: /usr/share/zoneinfo/Etc/UTC
|
||||||
- store_artifacts:
|
steps:
|
||||||
path: /tmp/fake-mailer/
|
- attach_workspace:
|
||||||
destination: fake-mailer
|
at: /home/circleci/mailpoet
|
||||||
|
- run:
|
||||||
|
name: "Set up virtual host"
|
||||||
|
command: echo 127.0.0.1 mailpoet.loc | sudo tee -a /etc/hosts
|
||||||
|
- run:
|
||||||
|
name: "Set up test environment"
|
||||||
|
command: source ./.circleci/setup.bash && setup php5
|
||||||
|
- run:
|
||||||
|
name: "Preparing test results folder"
|
||||||
|
command: mkdir test-results
|
||||||
|
- run:
|
||||||
|
name: "JS tests"
|
||||||
|
command: |
|
||||||
|
mkdir test-results/mocha
|
||||||
|
./do t:j test-results/mocha/junit.xml
|
||||||
|
- run:
|
||||||
|
name: "PHP Unit tests"
|
||||||
|
command: |
|
||||||
|
WP_TEST_PATH="/home/circleci/mailpoet/wordpress" ./do t:u --xml
|
||||||
|
- store_test_results:
|
||||||
|
path: test-results/mocha
|
||||||
|
- store_artifacts:
|
||||||
|
path: test-results/mocha
|
||||||
|
destination: mocha
|
||||||
|
- store_test_results:
|
||||||
|
path: tests/_output
|
||||||
|
- store_artifacts:
|
||||||
|
path: tests/_output
|
||||||
|
destination: codeception
|
||||||
|
- store_artifacts:
|
||||||
|
path: /tmp/fake-mailer/
|
||||||
|
destination: fake-mailer
|
||||||
acceptance_tests:
|
acceptance_tests:
|
||||||
working_directory: /home/circleci/mailpoet
|
working_directory: /home/circleci/mailpoet
|
||||||
machine: true
|
machine: true
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- attach_workspace:
|
||||||
|
at: /home/circleci/mailpoet
|
||||||
- run:
|
- run:
|
||||||
name: "Set up virtual host"
|
name: "Set up virtual host"
|
||||||
command: echo 127.0.0.1 mailpoet.loc | sudo tee -a /etc/hosts
|
command: echo 127.0.0.1 mailpoet.loc | sudo tee -a /etc/hosts
|
||||||
- restore_cache:
|
|
||||||
key: composer-{{ checksum "composer.json" }}-{{ checksum "composer.lock" }}
|
|
||||||
- restore_cache:
|
|
||||||
key: npm-{{ checksum "package.json" }}
|
|
||||||
- run:
|
- run:
|
||||||
name: "Set up test environment"
|
name: "Set up test environment"
|
||||||
command: |
|
command: |
|
||||||
@ -78,73 +99,38 @@ jobs:
|
|||||||
sudo apt-get install circleci-php-5.6.23
|
sudo apt-get install circleci-php-5.6.23
|
||||||
sudo rm /usr/bin/php
|
sudo rm /usr/bin/php
|
||||||
sudo ln -s /opt/circleci/php/5.6.23/bin/php /usr/bin/php
|
sudo ln -s /opt/circleci/php/5.6.23/bin/php /usr/bin/php
|
||||||
# Install NodeJS+NPM
|
|
||||||
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
|
|
||||||
sudo apt-get install nodejs build-essential
|
|
||||||
# install plugin dependencies
|
|
||||||
curl -sS https://getcomposer.org/installer | php
|
|
||||||
php composer.phar install
|
|
||||||
./do install
|
|
||||||
./do compile:all --env production
|
|
||||||
- save_cache:
|
|
||||||
key: composer-{{ checksum "composer.json" }}-{{ checksum "composer.lock" }}
|
|
||||||
paths:
|
|
||||||
- vendor
|
|
||||||
- save_cache:
|
|
||||||
key: npm-{{ checksum "package.json" }}
|
|
||||||
paths:
|
|
||||||
- node_modules
|
|
||||||
- run:
|
- run:
|
||||||
name: Run acceptance tests
|
name: Run acceptance tests
|
||||||
command: |
|
command: |
|
||||||
docker-compose run codeception --steps --debug -vvv --html --xml
|
docker-compose run -e SKIP_DEPS=1 codeception --steps --debug -vvv --html --xml
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: tests/_output
|
path: tests/_output
|
||||||
- store_test_results:
|
- store_test_results:
|
||||||
path: tests/_output
|
path: tests/_output
|
||||||
acceptance_tests_multisite:
|
acceptance_tests_multisite:
|
||||||
working_directory: /home/circleci/mailpoet
|
working_directory: /home/circleci/mailpoet
|
||||||
machine: true
|
machine: true
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- attach_workspace:
|
||||||
- run:
|
at: /home/circleci/mailpoet
|
||||||
name: "Set up virtual host"
|
- run:
|
||||||
command: echo 127.0.0.1 mailpoet.loc | sudo tee -a /etc/hosts
|
name: "Set up virtual host"
|
||||||
- restore_cache:
|
command: echo 127.0.0.1 mailpoet.loc | sudo tee -a /etc/hosts
|
||||||
key: composer-{{ checksum "composer.json" }}-{{ checksum "composer.lock" }}
|
- run:
|
||||||
- restore_cache:
|
name: "Set up test environment"
|
||||||
key: npm-{{ checksum "package.json" }}
|
command: |
|
||||||
- run:
|
sudo apt-get update
|
||||||
name: "Set up test environment"
|
sudo apt-get install circleci-php-5.6.23
|
||||||
command: |
|
sudo rm /usr/bin/php
|
||||||
sudo apt-get update
|
sudo ln -s /opt/circleci/php/5.6.23/bin/php /usr/bin/php
|
||||||
sudo apt-get install circleci-php-5.6.23
|
- run:
|
||||||
sudo rm /usr/bin/php
|
name: Run acceptance tests
|
||||||
sudo ln -s /opt/circleci/php/5.6.23/bin/php /usr/bin/php
|
command: |
|
||||||
# Install NodeJS+NPM
|
docker-compose run -e SKIP_DEPS=1 -e MULTISITE=1 codeception --steps --debug -vvv --html --xml
|
||||||
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
|
- store_artifacts:
|
||||||
sudo apt-get install nodejs build-essential
|
path: tests/_output
|
||||||
# install plugin dependencies
|
- store_test_results:
|
||||||
curl -sS https://getcomposer.org/installer | php
|
path: tests/_output
|
||||||
php composer.phar install
|
|
||||||
./do install
|
|
||||||
./do compile:all --env production
|
|
||||||
- save_cache:
|
|
||||||
key: composer-{{ checksum "composer.json" }}-{{ checksum "composer.lock" }}
|
|
||||||
paths:
|
|
||||||
- vendor
|
|
||||||
- save_cache:
|
|
||||||
key: npm-{{ checksum "package.json" }}
|
|
||||||
paths:
|
|
||||||
- node_modules
|
|
||||||
- run:
|
|
||||||
name: Run acceptance tests
|
|
||||||
command: |
|
|
||||||
docker-compose run -e MULTISITE=1 codeception --steps --debug -vvv --html --xml
|
|
||||||
- store_artifacts:
|
|
||||||
path: tests/_output
|
|
||||||
- store_test_results:
|
|
||||||
path: tests/_output
|
|
||||||
php7:
|
php7:
|
||||||
working_directory: /home/circleci/mailpoet
|
working_directory: /home/circleci/mailpoet
|
||||||
docker:
|
docker:
|
||||||
@ -153,17 +139,14 @@ jobs:
|
|||||||
environment:
|
environment:
|
||||||
TZ: /usr/share/zoneinfo/Etc/UTC
|
TZ: /usr/share/zoneinfo/Etc/UTC
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- attach_workspace:
|
||||||
|
at: /home/circleci/mailpoet
|
||||||
- run:
|
- run:
|
||||||
name: "Set up virtual host"
|
name: "Set up virtual host"
|
||||||
command: echo 127.0.0.1 mailpoet.loc | sudo tee -a /etc/hosts
|
command: echo 127.0.0.1 mailpoet.loc | sudo tee -a /etc/hosts
|
||||||
- run:
|
- run:
|
||||||
name: "Prepare example.com for testing"
|
name: "Prepare example.com for testing"
|
||||||
command: echo 127.0.0.1 example.com | sudo tee -a /etc/hosts
|
command: echo 127.0.0.1 example.com | sudo tee -a /etc/hosts
|
||||||
- restore_cache:
|
|
||||||
key: composer-{{ checksum "composer.json" }}-{{ checksum "composer.lock" }}
|
|
||||||
- restore_cache:
|
|
||||||
key: npm-{{ checksum "package.json" }}
|
|
||||||
- run:
|
- run:
|
||||||
name: "Set up test environment"
|
name: "Set up test environment"
|
||||||
command: source ./.circleci/setup.bash && setup php7
|
command: source ./.circleci/setup.bash && setup php7
|
||||||
@ -187,17 +170,14 @@ jobs:
|
|||||||
environment:
|
environment:
|
||||||
TZ: /usr/share/zoneinfo/Etc/UTC
|
TZ: /usr/share/zoneinfo/Etc/UTC
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- attach_workspace:
|
||||||
|
at: /home/circleci/mailpoet
|
||||||
- run:
|
- run:
|
||||||
name: "Set up virtual host"
|
name: "Set up virtual host"
|
||||||
command: echo 127.0.0.1 mailpoet.loc | sudo tee -a /etc/hosts
|
command: echo 127.0.0.1 mailpoet.loc | sudo tee -a /etc/hosts
|
||||||
- run:
|
- run:
|
||||||
name: "Prepare example.com for testing"
|
name: "Prepare example.com for testing"
|
||||||
command: echo 127.0.0.1 example.com | sudo tee -a /etc/hosts
|
command: echo 127.0.0.1 example.com | sudo tee -a /etc/hosts
|
||||||
- restore_cache:
|
|
||||||
key: composer-{{ checksum "composer.json" }}-{{ checksum "composer.lock" }}
|
|
||||||
- restore_cache:
|
|
||||||
key: npm-{{ checksum "package.json" }}
|
|
||||||
- run:
|
- run:
|
||||||
name: "Set up test environment"
|
name: "Set up test environment"
|
||||||
command: source ./.circleci/setup.bash && setup php7_multisite
|
command: source ./.circleci/setup.bash && setup php7_multisite
|
||||||
@ -217,8 +197,21 @@ workflows:
|
|||||||
version: 2
|
version: 2
|
||||||
build_and_test:
|
build_and_test:
|
||||||
jobs:
|
jobs:
|
||||||
- qa_js_security_php5
|
- build_and_code_qa
|
||||||
- php7
|
- php7:
|
||||||
- acceptance_tests
|
requires:
|
||||||
- php7_multisite
|
- build_and_code_qa
|
||||||
- acceptance_tests_multisite
|
- php5_and_js:
|
||||||
|
requires:
|
||||||
|
- build_and_code_qa
|
||||||
|
- acceptance_tests:
|
||||||
|
requires:
|
||||||
|
- build_and_code_qa
|
||||||
|
- php7_multisite:
|
||||||
|
requires:
|
||||||
|
- build_and_code_qa
|
||||||
|
- php7
|
||||||
|
- acceptance_tests_multisite:
|
||||||
|
requires:
|
||||||
|
- build_and_code_qa
|
||||||
|
- acceptance_tests
|
||||||
|
@ -16,11 +16,6 @@ function setup {
|
|||||||
sudo a2enmod rewrite
|
sudo a2enmod rewrite
|
||||||
sudo service apache2 restart
|
sudo service apache2 restart
|
||||||
|
|
||||||
# install plugin dependencies
|
|
||||||
curl -sS https://getcomposer.org/installer | php
|
|
||||||
./composer.phar install
|
|
||||||
./do install
|
|
||||||
|
|
||||||
until mysql -h 127.0.0.1 -u root -e "select 1"; do
|
until mysql -h 127.0.0.1 -u root -e "select 1"; do
|
||||||
>&2 echo "Mysql is starting up ... will try again momentarily"
|
>&2 echo "Mysql is starting up ... will try again momentarily"
|
||||||
sleep 1
|
sleep 1
|
||||||
|
@ -8,9 +8,6 @@ WP_TEST_MAILER_ENABLE_SENDING="true"
|
|||||||
WP_TEST_MAILER_AMAZON_ACCESS=""
|
WP_TEST_MAILER_AMAZON_ACCESS=""
|
||||||
WP_TEST_MAILER_AMAZON_SECRET=""
|
WP_TEST_MAILER_AMAZON_SECRET=""
|
||||||
WP_TEST_MAILER_AMAZON_REGION=""
|
WP_TEST_MAILER_AMAZON_REGION=""
|
||||||
WP_TEST_MAILER_ELASTICEMAIL_API=""
|
|
||||||
WP_TEST_MAILER_MAILGUN_API=""
|
|
||||||
WP_TEST_MAILER_MAILGUN_DOMAIN=""
|
|
||||||
WP_TEST_MAILER_MAILPOET_API=""
|
WP_TEST_MAILER_MAILPOET_API=""
|
||||||
WP_TEST_MAILER_SENDGRID_API=""
|
WP_TEST_MAILER_SENDGRID_API=""
|
||||||
WP_TEST_MAILER_SMTP_HOST=""
|
WP_TEST_MAILER_SMTP_HOST=""
|
||||||
@ -19,4 +16,4 @@ WP_TEST_MAILER_SMTP_PASSWORD=""
|
|||||||
WP_SVN_USERNAME=""
|
WP_SVN_USERNAME=""
|
||||||
WP_SVN_PASSWORD=""
|
WP_SVN_PASSWORD=""
|
||||||
WP_TRANSIFEX_API_TOKEN=""
|
WP_TRANSIFEX_API_TOKEN=""
|
||||||
HTTP_HOST="" // URL of your site (used for multisite env and equals to DOMAIN_CURRENT_SITE from wp-config.php)
|
HTTP_HOST="" // URL of your site (used for multisite env and equals to DOMAIN_CURRENT_SITE from wp-config.php)
|
||||||
|
@ -4,15 +4,6 @@ ENV COMPOSER_ALLOW_SUPERUSER=1
|
|||||||
|
|
||||||
RUN composer global require --optimize-autoloader "hirak/prestissimo"
|
RUN composer global require --optimize-autoloader "hirak/prestissimo"
|
||||||
|
|
||||||
# Prepare application
|
|
||||||
WORKDIR /repo
|
|
||||||
|
|
||||||
# Install vendor
|
|
||||||
COPY ./composer.json /repo/composer.json
|
|
||||||
|
|
||||||
# Add source-code
|
|
||||||
COPY . /repo
|
|
||||||
|
|
||||||
WORKDIR /wp-core/wp-content/plugins/mailpoet
|
WORKDIR /wp-core/wp-content/plugins/mailpoet
|
||||||
ENV WP_TEST_PATH=/wp-core
|
ENV WP_TEST_PATH=/wp-core
|
||||||
|
|
||||||
|
@ -197,4 +197,9 @@ If you’re on a Mac, you can open vnc://localhost:5900 in Safari to watch the t
|
|||||||
To run tests:
|
To run tests:
|
||||||
```sh
|
```sh
|
||||||
$ ./do test:acceptance
|
$ ./do test:acceptance
|
||||||
```
|
```
|
||||||
|
|
||||||
|
You can skip installation of composer dependencies using --skip-deps parameter.
|
||||||
|
```sh
|
||||||
|
$ ./do test:acceptance --skip-deps
|
||||||
|
```
|
||||||
|
10
RoboFile.php
10
RoboFile.php
@ -231,19 +231,19 @@ class RoboFile extends \Robo\Tasks {
|
|||||||
return $this->_exec($command);
|
return $this->_exec($command);
|
||||||
}
|
}
|
||||||
|
|
||||||
function testAcceptance($opts=['file' => null, 'keep-deps' => false]) {
|
function testAcceptance($opts=['file' => null, 'skip-deps' => false]) {
|
||||||
return $this->_exec(
|
return $this->_exec(
|
||||||
'COMPOSE_HTTP_TIMEOUT=200 docker-compose run ' .
|
'COMPOSE_HTTP_TIMEOUT=200 docker-compose run ' .
|
||||||
($opts['keep-deps'] ? '-e KEEP_DEPS=1 ' : '') .
|
($opts['skip-deps'] ? '-e SKIP_DEPS=1 ' : '') .
|
||||||
'codeception --steps --debug -vvv ' .
|
'codeception --steps --debug -vvv ' .
|
||||||
'-f ' . ($opts['file'] ? $opts['file'] : '')
|
'-f ' . ($opts['file'] ? $opts['file'] : '')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function testAcceptanceMultisite($opts=['file' => null, 'keep-deps' => false]) {
|
function testAcceptanceMultisite($opts=['file' => null, 'skip-deps' => false]) {
|
||||||
return $this->_exec(
|
return $this->_exec(
|
||||||
'COMPOSE_HTTP_TIMEOUT=200 docker-compose run ' .
|
'COMPOSE_HTTP_TIMEOUT=200 docker-compose run ' .
|
||||||
($opts['keep-deps'] ? '-e KEEP_DEPS=1 ' : '') .
|
($opts['skip-deps'] ? '-e SKIP_DEPS=1 ' : '') .
|
||||||
'-e MULTISITE=1 ' .
|
'-e MULTISITE=1 ' .
|
||||||
'codeception --steps --debug -vvv' .
|
'codeception --steps --debug -vvv' .
|
||||||
'-f ' . ($opts['file'] ? $opts['file'] : '')
|
'-f ' . ($opts['file'] ? $opts['file'] : '')
|
||||||
@ -299,7 +299,7 @@ class RoboFile extends \Robo\Tasks {
|
|||||||
'--standard=./tasks/code_sniffer/MailPoet '.
|
'--standard=./tasks/code_sniffer/MailPoet '.
|
||||||
'--runtime-set testVersion 5.5-7.2 '.
|
'--runtime-set testVersion 5.5-7.2 '.
|
||||||
'--ignore=./tests/unit/_bootstrap.php '.
|
'--ignore=./tests/unit/_bootstrap.php '.
|
||||||
'tests/unit/ '.
|
'tests/unit/ tests/acceptance tests/DataFactories '.
|
||||||
$severityFlag
|
$severityFlag
|
||||||
)
|
)
|
||||||
->run();
|
->run();
|
||||||
|
@ -35,3 +35,4 @@
|
|||||||
@require 'newsletter_templates'
|
@require 'newsletter_templates'
|
||||||
@require 'welcome_wizard'
|
@require 'welcome_wizard'
|
||||||
@require 'intro'
|
@require 'intro'
|
||||||
|
@require 'in_app_announcements'
|
||||||
|
48
assets/css/src/in_app_announcements.styl
Normal file
48
assets/css/src/in_app_announcements.styl
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
.mailpoet_in_app_announcement_pulsing_dot
|
||||||
|
display: inline-block
|
||||||
|
width: 10px
|
||||||
|
height: 10px
|
||||||
|
border-radius: 50%
|
||||||
|
background: #ff5301
|
||||||
|
cursor: pointer
|
||||||
|
box-shadow: 0 0 0 rgba(255, 83, 1, 0.4)
|
||||||
|
animation: mailpoet_in_app_dot_pulse 2s infinite
|
||||||
|
|
||||||
|
@-webkit-keyframes mailpoet_in_app_dot_pulse
|
||||||
|
0%
|
||||||
|
-webkit-box-shadow: 0 0 0 0 rgba(255, 83, 1, 0.4)
|
||||||
|
70%
|
||||||
|
-webkit-box-shadow: 0 0 0 10px rgba(255, 83, 1, 0)
|
||||||
|
100%
|
||||||
|
-webkit-box-shadow: 0 0 0 0 rgba(255, 83, 1, 0)
|
||||||
|
|
||||||
|
@keyframes mailpoet_in_app_dot_pulse
|
||||||
|
0%
|
||||||
|
-moz-box-shadow: 0 0 0 0 rgba(255, 83, 1, 0.4)
|
||||||
|
box-shadow: 0 0 0 0 rgba(255, 83, 1, 0.4)
|
||||||
|
70%
|
||||||
|
-moz-box-shadow: 0 0 0 10px rgba(255, 83, 1, 0)
|
||||||
|
box-shadow: 0 0 0 10px rgba(255, 83, 1, 0)
|
||||||
|
100%
|
||||||
|
-moz-box-shadow: 0 0 0 0 rgba(255, 83, 1, 0)
|
||||||
|
box-shadow: 0 0 0 0 rgba(255, 83, 1, 0)
|
||||||
|
|
||||||
|
.mailpoet_in_app_announcement_free_welcome_emails
|
||||||
|
text-align: center
|
||||||
|
h2
|
||||||
|
font-size: 28px
|
||||||
|
img
|
||||||
|
width: 640px
|
||||||
|
margin-top: -20px
|
||||||
|
|
||||||
|
.mailpoet_in_app_announcement_free_welcome_emails_dot
|
||||||
|
position: relative
|
||||||
|
top: -3px
|
||||||
|
left: 8px
|
||||||
|
|
||||||
|
.mailpoet_in_app_announcement_background_videos, .mailpoet_drag_and_drop_tutorial
|
||||||
|
text-align: center
|
||||||
|
h2
|
||||||
|
font-size: 28px
|
||||||
|
video
|
||||||
|
margin-top: 20px
|
@ -20,3 +20,8 @@
|
|||||||
|
|
||||||
p
|
p
|
||||||
margin: 0
|
margin: 0
|
||||||
|
|
||||||
|
.mailpoet_editor_announcement
|
||||||
|
position: absolute
|
||||||
|
right: 20px
|
||||||
|
top: 90px
|
||||||
|
@ -4,6 +4,7 @@ $content-border-color = $structure-border-color
|
|||||||
#mailpoet_editor
|
#mailpoet_editor
|
||||||
width: 100%
|
width: 100%
|
||||||
clear: both
|
clear: both
|
||||||
|
position: relative
|
||||||
|
|
||||||
#mailpoet_editor_heading
|
#mailpoet_editor_heading
|
||||||
padding-left: 15px
|
padding-left: 15px
|
||||||
|
@ -41,3 +41,9 @@ Custom styles for MailPoet pages.
|
|||||||
list-style-type: disc
|
list-style-type: disc
|
||||||
margin-left: 40px
|
margin-left: 40px
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.half-width-centered
|
||||||
|
display block
|
||||||
|
max-width 50%
|
||||||
|
margin-left auto
|
||||||
|
margin-right auto
|
||||||
|
Binary file not shown.
After Width: | Height: | Size: 154 KiB |
BIN
assets/img/newsletter_editor/background-image-demo.mp4
Normal file
BIN
assets/img/newsletter_editor/background-image-demo.mp4
Normal file
Binary file not shown.
@ -1,8 +1,8 @@
|
|||||||
import jQuery from 'jquery';
|
import jQuery from 'jquery';
|
||||||
|
|
||||||
jQuery(($) => {
|
jQuery(($) => {
|
||||||
$(document).on('click', '.notice-php-warning .notice-dismiss', function xyz() {
|
$(document).on('click', '.mailpoet-dismissible-notice .notice-dismiss', function dismiss() {
|
||||||
const type = $(this).closest('.notice-php-warning').data('notice');
|
const type = $(this).closest('.mailpoet-dismissible-notice').data('notice');
|
||||||
$.ajax(window.ajaxurl,
|
$.ajax(window.ajaxurl,
|
||||||
{
|
{
|
||||||
type: 'POST',
|
type: 'POST',
|
121
assets/js/src/in_app_announcements/in_app_announcement.jsx
Normal file
121
assets/js/src/in_app_announcements/in_app_announcement.jsx
Normal file
@ -0,0 +1,121 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import MailPoet from 'mailpoet';
|
||||||
|
import InAppAnnouncementDot from './in_app_announcement_dot.jsx';
|
||||||
|
|
||||||
|
class InAppAnnouncement extends React.Component {
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
this.saveDisplayed = this.saveDisplayed.bind(this);
|
||||||
|
|
||||||
|
this.state = {
|
||||||
|
announcementsSettings: window.mailpoet_in_app_announcements || null,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
saveDisplayed() {
|
||||||
|
const settings = Object.assign({}, this.state.announcementsSettings);
|
||||||
|
settings.displayed.push(this.props.showOnlyOnceSlug);
|
||||||
|
return MailPoet.Ajax.post({
|
||||||
|
api_version: window.mailpoet_api_version,
|
||||||
|
endpoint: 'settings',
|
||||||
|
action: 'set',
|
||||||
|
data: { in_app_announcements: settings },
|
||||||
|
}).always(() => (this.setState({ announcementsSettings: settings })));
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
if (this.props.showToNewUser !== null &&
|
||||||
|
window.mailpoet_is_new_user !== this.props.showToNewUser
|
||||||
|
) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.props.validUntil !== null
|
||||||
|
&& this.props.validUntil < new Date()
|
||||||
|
) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.props.showToPremiumUser !== null &&
|
||||||
|
window.mailpoet_premium_active !== this.props.showToPremiumUser
|
||||||
|
) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.props.showOnlyOnceSlug &&
|
||||||
|
this.state.announcementsSettings.displayed.includes(this.props.showOnlyOnceSlug)
|
||||||
|
) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<InAppAnnouncementDot
|
||||||
|
className={this.props.className}
|
||||||
|
width={this.props.width}
|
||||||
|
height={this.props.height}
|
||||||
|
onUserTrigger={() => {
|
||||||
|
if (!this.props.showOnlyOnceSlug) { return; }
|
||||||
|
this.saveDisplayed();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{this.props.children}
|
||||||
|
</InAppAnnouncementDot>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const validateBooleanWithWindowDependency = (props, propName, componentName, windowProperty) => {
|
||||||
|
const propValue = props[propName];
|
||||||
|
if (propValue !== null && propValue !== true && propValue !== false) {
|
||||||
|
return new Error(`Invalid property in ${componentName}. newUser must be of type boolean`);
|
||||||
|
}
|
||||||
|
if (propValue !== null && typeof window[windowProperty] === 'undefined') {
|
||||||
|
return new Error(
|
||||||
|
`Missing data for evaluation of ${componentName} display condition. ${propName} requires window.${windowProperty}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
|
||||||
|
InAppAnnouncement.propTypes = {
|
||||||
|
width: React.PropTypes.string,
|
||||||
|
height: React.PropTypes.string,
|
||||||
|
className: React.PropTypes.string,
|
||||||
|
children: React.PropTypes.element.isRequired,
|
||||||
|
validUntil: React.PropTypes.instanceOf(Date),
|
||||||
|
showToNewUser: (props, propName, componentName) => (
|
||||||
|
validateBooleanWithWindowDependency(props, propName, componentName, 'mailpoet_is_new_user')
|
||||||
|
),
|
||||||
|
showToPremiumUser: (props, propName, componentName) => (
|
||||||
|
validateBooleanWithWindowDependency(props, propName, componentName, 'mailpoet_premium_active')
|
||||||
|
),
|
||||||
|
showOnlyOnceSlug: (props, propName, componentName) => {
|
||||||
|
const propValue = props[propName];
|
||||||
|
if (propValue !== null && typeof propValue !== 'string') {
|
||||||
|
return new Error(`Invalid property in ${componentName}. ${propName} must be of type string`);
|
||||||
|
}
|
||||||
|
if (propValue === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
typeof window.mailpoet_in_app_announcements === 'undefined'
|
||||||
|
) {
|
||||||
|
return new Error(
|
||||||
|
`Missing data for evaluation of ${componentName} display condition. ${propName} requires window.mailpoet_in_app_announcements`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
InAppAnnouncement.defaultProps = {
|
||||||
|
width: '900px',
|
||||||
|
height: '600px',
|
||||||
|
className: null,
|
||||||
|
validUntil: null,
|
||||||
|
showToNewUser: null,
|
||||||
|
showToPremiumUser: null,
|
||||||
|
showOnlyOnceSlug: null,
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = InAppAnnouncement;
|
@ -0,0 +1,37 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import ReactDOMServer from 'react-dom/server';
|
||||||
|
import classNames from 'classnames';
|
||||||
|
import MailPoet from 'mailpoet';
|
||||||
|
|
||||||
|
const InAppAnnouncementDot = props => (
|
||||||
|
<span
|
||||||
|
role="button"
|
||||||
|
tabIndex="-1"
|
||||||
|
className={classNames('mailpoet_in_app_announcement_pulsing_dot', props.className)}
|
||||||
|
onClick={() => {
|
||||||
|
MailPoet.Modal.popup({
|
||||||
|
template: ReactDOMServer.renderToString(props.children),
|
||||||
|
width: props.width,
|
||||||
|
height: props.height,
|
||||||
|
});
|
||||||
|
if (props.onUserTrigger) props.onUserTrigger();
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
|
||||||
|
InAppAnnouncementDot.propTypes = {
|
||||||
|
children: React.PropTypes.element.isRequired,
|
||||||
|
width: React.PropTypes.string,
|
||||||
|
height: React.PropTypes.string,
|
||||||
|
className: React.PropTypes.string,
|
||||||
|
onUserTrigger: React.PropTypes.func,
|
||||||
|
};
|
||||||
|
|
||||||
|
InAppAnnouncementDot.defaultProps = {
|
||||||
|
width: 'auto',
|
||||||
|
height: 'auto',
|
||||||
|
className: null,
|
||||||
|
onUserTrigger: null,
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = InAppAnnouncementDot;
|
@ -456,55 +456,56 @@ const Listing = React.createClass({
|
|||||||
this.initWithParams(params);
|
this.initWithParams(params);
|
||||||
},
|
},
|
||||||
getItems: function getItems() {
|
getItems: function getItems() {
|
||||||
if (this.isComponentMounted) {
|
if (!this.isComponentMounted) return;
|
||||||
this.setState({ loading: true });
|
|
||||||
|
|
||||||
this.clearSelection();
|
this.setState({ loading: true });
|
||||||
|
this.clearSelection();
|
||||||
|
|
||||||
MailPoet.Ajax.post({
|
MailPoet.Ajax.post({
|
||||||
api_version: window.mailpoet_api_version,
|
api_version: window.mailpoet_api_version,
|
||||||
endpoint: this.props.endpoint,
|
endpoint: this.props.endpoint,
|
||||||
action: 'listing',
|
action: 'listing',
|
||||||
data: {
|
data: {
|
||||||
params: this.getParams(),
|
params: this.getParams(),
|
||||||
offset: (this.state.page - 1) * this.state.limit,
|
offset: (this.state.page - 1) * this.state.limit,
|
||||||
limit: this.state.limit,
|
limit: this.state.limit,
|
||||||
group: this.state.group,
|
group: this.state.group,
|
||||||
filter: this.state.filter,
|
filter: this.state.filter,
|
||||||
search: this.state.search,
|
search: this.state.search,
|
||||||
sort_by: this.state.sort_by,
|
sort_by: this.state.sort_by,
|
||||||
sort_order: this.state.sort_order,
|
sort_order: this.state.sort_order,
|
||||||
},
|
},
|
||||||
}).always(() => {
|
}).always(() => {
|
||||||
this.setState({ loading: false });
|
if (!this.isComponentMounted) return;
|
||||||
}).done((response) => {
|
this.setState({ loading: false });
|
||||||
this.setState({
|
}).done((response) => {
|
||||||
items: response.data || [],
|
if (!this.isComponentMounted) return;
|
||||||
filters: response.meta.filters || {},
|
this.setState({
|
||||||
groups: response.meta.groups || [],
|
items: response.data || [],
|
||||||
count: response.meta.count || 0,
|
filters: response.meta.filters || {},
|
||||||
meta: _.omit(response.meta, ['filters', 'groups', 'count']),
|
groups: response.meta.groups || [],
|
||||||
}, () => {
|
count: response.meta.count || 0,
|
||||||
// if viewing an empty trash
|
meta: _.omit(response.meta, ['filters', 'groups', 'count']),
|
||||||
if (this.state.group === 'trash' && response.meta.count === 0) {
|
}, () => {
|
||||||
// redirect to default group
|
// if viewing an empty trash
|
||||||
this.handleGroup('all');
|
if (this.state.group === 'trash' && response.meta.count === 0) {
|
||||||
}
|
// redirect to default group
|
||||||
|
this.handleGroup('all');
|
||||||
|
}
|
||||||
|
|
||||||
// trigger afterGetItems callback if specified
|
// trigger afterGetItems callback if specified
|
||||||
if (this.props.afterGetItems !== undefined) {
|
if (this.props.afterGetItems !== undefined) {
|
||||||
this.props.afterGetItems(this.state);
|
this.props.afterGetItems(this.state);
|
||||||
}
|
|
||||||
});
|
|
||||||
}).fail((response) => {
|
|
||||||
if (response.errors.length > 0) {
|
|
||||||
MailPoet.Notice.error(
|
|
||||||
response.errors.map(error => error.message),
|
|
||||||
{ scroll: true }
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}).fail((response) => {
|
||||||
|
if (response.errors.length > 0) {
|
||||||
|
MailPoet.Notice.error(
|
||||||
|
response.errors.map(error => error.message),
|
||||||
|
{ scroll: true }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
handleRestoreItem: function handleRestoreItem(id) {
|
handleRestoreItem: function handleRestoreItem(id) {
|
||||||
this.setState({
|
this.setState({
|
||||||
|
@ -0,0 +1,26 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import MailPoet from 'mailpoet';
|
||||||
|
import InAppAnnouncement from 'in_app_announcements/in_app_announcement.jsx';
|
||||||
|
|
||||||
|
const BackgroundImageAnnouncement = props => (
|
||||||
|
<InAppAnnouncement
|
||||||
|
validUntil={new Date('2018-10-06')}
|
||||||
|
height="700px"
|
||||||
|
showOnlyOnceSlug="background_image"
|
||||||
|
>
|
||||||
|
<div className="mailpoet_in_app_announcement_background_videos">
|
||||||
|
<h2>
|
||||||
|
{MailPoet.I18n.t('announcementBackgroundImagesHeading').replace('%username%', props.username)}
|
||||||
|
</h2>
|
||||||
|
<p>{MailPoet.I18n.t('announcementBackgroundImagesMessage')}</p>
|
||||||
|
<video src={props.videoUrl} controls autoPlay><track kind="captions" /></video>
|
||||||
|
</div>
|
||||||
|
</InAppAnnouncement>
|
||||||
|
);
|
||||||
|
|
||||||
|
BackgroundImageAnnouncement.propTypes = {
|
||||||
|
username: React.PropTypes.string.isRequired,
|
||||||
|
videoUrl: React.PropTypes.string.isRequired,
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = BackgroundImageAnnouncement;
|
@ -3,7 +3,8 @@ import Breadcrumb from 'newsletters/breadcrumb.jsx';
|
|||||||
import MailPoet from 'mailpoet';
|
import MailPoet from 'mailpoet';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ReactDOM from 'react-dom';
|
import ReactDOM from 'react-dom';
|
||||||
import moment from 'moment';
|
import BackgroundImageAnnouncement from './background_image_announcement.jsx';
|
||||||
|
import displayTutorial from './tutorial.jsx';
|
||||||
|
|
||||||
const renderBreadcrumb = (newsletterType) => {
|
const renderBreadcrumb = (newsletterType) => {
|
||||||
const breadcrumbContainer = document.getElementById('mailpoet_editor_breadcrumb');
|
const breadcrumbContainer = document.getElementById('mailpoet_editor_breadcrumb');
|
||||||
@ -17,27 +18,15 @@ const renderBreadcrumb = (newsletterType) => {
|
|||||||
ReactDOM.render(breadcrumb, breadcrumbContainer);
|
ReactDOM.render(breadcrumb, breadcrumbContainer);
|
||||||
};
|
};
|
||||||
|
|
||||||
function displayTutorial() {
|
const renderAnnouncement = () => {
|
||||||
const key = `user_seen_editor_tutorial${window.config.currentUserId}`;
|
const container = document.getElementById('mailpoet_editor_announcement');
|
||||||
if (window.config.dragDemoUrlSettings) {
|
ReactDOM.render(
|
||||||
return;
|
<BackgroundImageAnnouncement
|
||||||
}
|
username={window.config.currentUserFirstName || window.config.currentUserUsername}
|
||||||
if (moment(window.config.installedAt).isBefore(moment().subtract(7, 'days'))) {
|
videoUrl={window.config.backgroundImageDemoUrl}
|
||||||
return;
|
/>, container
|
||||||
}
|
);
|
||||||
MailPoet.Modal.popup({
|
};
|
||||||
title: MailPoet.I18n.t('tutorialVideoTitle'),
|
|
||||||
template: `<video style="height:640px;" src="${window.config.dragDemoUrl}" controls autoplay></video>`,
|
|
||||||
onCancel: () => {
|
|
||||||
MailPoet.Ajax.post({
|
|
||||||
api_version: window.mailpoet_api_version,
|
|
||||||
endpoint: 'settings',
|
|
||||||
action: 'set',
|
|
||||||
data: { [key]: 1 },
|
|
||||||
});
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const initializeEditor = (config) => {
|
const initializeEditor = (config) => {
|
||||||
const editorContainer = document.getElementById('mailpoet_editor');
|
const editorContainer = document.getElementById('mailpoet_editor');
|
||||||
@ -73,6 +62,7 @@ const initializeEditor = (config) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
renderBreadcrumb(newsletter.type);
|
renderBreadcrumb(newsletter.type);
|
||||||
|
renderAnnouncement();
|
||||||
|
|
||||||
if (newsletter.status === 'sending' && newsletter.queue && newsletter.queue.status === null) {
|
if (newsletter.status === 'sending' && newsletter.queue && newsletter.queue.status === null) {
|
||||||
MailPoet.Ajax.post({
|
MailPoet.Ajax.post({
|
||||||
|
25
assets/js/src/newsletter_editor/tutorial.jsx
Normal file
25
assets/js/src/newsletter_editor/tutorial.jsx
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
import MailPoet from 'mailpoet';
|
||||||
|
import moment from 'moment';
|
||||||
|
|
||||||
|
const displayTutorial = () => {
|
||||||
|
const key = `user_seen_editor_tutorial${window.config.currentUserId}`;
|
||||||
|
if (window.config.dragDemoUrlSettings) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (moment(window.config.installedAt).isBefore(moment().subtract(7, 'days'))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
MailPoet.Modal.popup({
|
||||||
|
template: `<div class="mailpoet_drag_and_drop_tutorial"><h2>${MailPoet.I18n.t('tutorialVideoTitle')}</h2><video style="height:640px;" src="${window.config.dragDemoUrl}" controls autoplay></video></div>`,
|
||||||
|
onCancel: () => {
|
||||||
|
MailPoet.Ajax.post({
|
||||||
|
api_version: window.mailpoet_api_version,
|
||||||
|
endpoint: 'settings',
|
||||||
|
action: 'set',
|
||||||
|
data: { [key]: 1 },
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export default displayTutorial;
|
@ -1,6 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Link } from 'react-router';
|
import { Link } from 'react-router';
|
||||||
import MailPoet from 'mailpoet';
|
import MailPoet from 'mailpoet';
|
||||||
|
import InAppAnnoucement from 'in_app_announcements/in_app_announcement.jsx';
|
||||||
|
|
||||||
const ListingHeading = () => (
|
const ListingHeading = () => (
|
||||||
<h1 className="title">
|
<h1 className="title">
|
||||||
@ -17,6 +18,23 @@ const ListingHeading = () => (
|
|||||||
>
|
>
|
||||||
{MailPoet.I18n.t('new')}
|
{MailPoet.I18n.t('new')}
|
||||||
</Link>
|
</Link>
|
||||||
|
<InAppAnnoucement
|
||||||
|
className="mailpoet_in_app_announcement_free_welcome_emails_dot"
|
||||||
|
showToNewUser={false}
|
||||||
|
showToPremiumUser={false}
|
||||||
|
showOnlyOnceSlug="free_welcome_emails"
|
||||||
|
height="650px"
|
||||||
|
validUntil={new Date('2018-10-31')}
|
||||||
|
>
|
||||||
|
<div className="mailpoet_in_app_announcement_free_welcome_emails">
|
||||||
|
<h2>{MailPoet.I18n.t('freeWelcomeEmailsHeading')}</h2>
|
||||||
|
<img
|
||||||
|
src={window.mailpoet_free_welcome_emails_image}
|
||||||
|
alt={MailPoet.I18n.t('freeWelcomeEmailsHeading')}
|
||||||
|
/>
|
||||||
|
<p>{MailPoet.I18n.t('freeWelcomeEmailsParagraph')}</p>
|
||||||
|
</div>
|
||||||
|
</InAppAnnoucement>
|
||||||
</h1>
|
</h1>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -142,7 +142,7 @@ const DateText = React.createClass({
|
|||||||
return (
|
return (
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
size="10"
|
size="30"
|
||||||
name={this.getFieldName()}
|
name={this.getFieldName()}
|
||||||
value={this.getDisplayDate(this.props.value)}
|
value={this.getDisplayDate(this.props.value)}
|
||||||
readOnly
|
readOnly
|
||||||
|
@ -24,6 +24,10 @@ const templatesCategories = [
|
|||||||
name: 'notification',
|
name: 'notification',
|
||||||
label: MailPoet.I18n.t('tabNotificationTitle'),
|
label: MailPoet.I18n.t('tabNotificationTitle'),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'woocommerce',
|
||||||
|
label: MailPoet.I18n.t('tabWoocommerceTitle'),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'sample',
|
name: 'sample',
|
||||||
label: MailPoet.I18n.t('sample'),
|
label: MailPoet.I18n.t('sample'),
|
||||||
@ -70,7 +74,7 @@ class NewsletterTemplates extends React.Component {
|
|||||||
{
|
{
|
||||||
name:
|
name:
|
||||||
MailPoet.I18n.t('mailpoetGuideTemplateTitle'),
|
MailPoet.I18n.t('mailpoetGuideTemplateTitle'),
|
||||||
categories: '["welcome", "notification", "standard"]',
|
categories: '["welcome", "notification", "standard", "woocommerce"]',
|
||||||
readonly: '1',
|
readonly: '1',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
@ -42,7 +42,7 @@ class AutomaticEmailEventsList extends React.Component {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
const heading = MailPoet.I18n.t('selectAutomaticEmailsEventsHeading')
|
const heading = MailPoet.I18n.t('selectAutomaticEmailsEventsHeading')
|
||||||
.replace('%1s', this.email.title);
|
.replace('%$1s', this.email.title);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
15
assets/js/src/nps_poll.jsx
Normal file
15
assets/js/src/nps_poll.jsx
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
function displayPoll() {
|
||||||
|
if (window.mailpoet_display_nps_poll && window.satismeter) {
|
||||||
|
window.satismeter({
|
||||||
|
writeKey: '6L479eVPXk7pBn6S',
|
||||||
|
userId: window.mailpoet_current_wp_user.ID + window.mailpoet_site_url,
|
||||||
|
traits: {
|
||||||
|
name: window.mailpoet_current_wp_user.user_nicename,
|
||||||
|
email: window.mailpoet_current_wp_user.user_email,
|
||||||
|
createdAt: window.mailpoet_settings.installed_at,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
setImmediate(displayPoll);
|
1
build.sh
1
build.sh
@ -74,6 +74,7 @@ rm -f $plugin_name/assets/js/lib/tinymce/package.json
|
|||||||
echo '[BUILD] Copying release files'
|
echo '[BUILD] Copying release files'
|
||||||
cp license.txt $plugin_name
|
cp license.txt $plugin_name
|
||||||
cp index.php $plugin_name
|
cp index.php $plugin_name
|
||||||
|
cp $plugin_name-cron.php $plugin_name
|
||||||
cp $plugin_name.php $plugin_name
|
cp $plugin_name.php $plugin_name
|
||||||
cp mailpoet_initializer.php $plugin_name
|
cp mailpoet_initializer.php $plugin_name
|
||||||
cp readme.txt $plugin_name
|
cp readme.txt $plugin_name
|
||||||
|
@ -92,16 +92,12 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
sed -i "s/define( *'WP_DEBUG', false *);/define('WP_DEBUG', true);define('WP_DEBUG_DISPLAY', true);define('WP_DEBUG_LOG', true);/" ./wp-config.php
|
sed -i "s/define( *'WP_DEBUG', false *);/define('WP_DEBUG', true);define('WP_DEBUG_DISPLAY', true);define('WP_DEBUG_LOG', true);/" ./wp-config.php
|
||||||
|
sed -i "s/.*That's all, stop editing! Happy blogging.*/define('COOKIE_DOMAIN', \$_SERVER['HTTP_HOST'] );/" ./wp-config.php
|
||||||
|
|
||||||
# Load Composer dependencies
|
# Load Composer dependencies
|
||||||
# Set KEEP_DEPS environment flag to not redownload them on each run, only for the 1st time, useful for development.
|
# Set SKIP_DEPS environment flag to not download them. E.g. you have downloaded them yourself
|
||||||
# Example: docker-compose run -e KEEP_DEPS=1 codeception ...
|
# Example: docker-compose run -e SKIP_DEPS=1 codeception ...
|
||||||
# Don't forget to restore your original /vendor folder from /vendor_backup manually or by running acceptance tests without this flag.
|
if [[ -z "${SKIP_DEPS}" ]]; then
|
||||||
if [[ -z "${KEEP_DEPS}" ]]; then
|
|
||||||
rm -rf /project/vendor_backup
|
|
||||||
fi
|
|
||||||
if [ ! -d "/project/vendor_backup" ]; then
|
|
||||||
mv /project/vendor /project/vendor_backup
|
|
||||||
cd /project
|
cd /project
|
||||||
php composer.phar install
|
php composer.phar install
|
||||||
fi
|
fi
|
||||||
@ -111,9 +107,4 @@ cd /wp-core/wp-content/plugins/mailpoet
|
|||||||
/project/vendor/bin/codecept run acceptance -c codeception.acceptance.yml $@
|
/project/vendor/bin/codecept run acceptance -c codeception.acceptance.yml $@
|
||||||
exitcode=$?
|
exitcode=$?
|
||||||
|
|
||||||
if [[ -z "${KEEP_DEPS}" ]]; then
|
|
||||||
rm -rf /project/vendor
|
|
||||||
mv /project/vendor_backup /project/vendor
|
|
||||||
fi
|
|
||||||
|
|
||||||
exit $exitcode
|
exit $exitcode
|
||||||
|
@ -21,10 +21,7 @@ class Mailer extends APIEndpoint {
|
|||||||
(isset($data['sender'])) ? $data['sender'] : false,
|
(isset($data['sender'])) ? $data['sender'] : false,
|
||||||
(isset($data['reply_to'])) ? $data['reply_to'] : false
|
(isset($data['reply_to'])) ? $data['reply_to'] : false
|
||||||
);
|
);
|
||||||
$extra_params = array(
|
$result = $mailer->send($data['newsletter'], $data['subscriber']);
|
||||||
'test_email' => true
|
|
||||||
);
|
|
||||||
$result = $mailer->send($data['newsletter'], $data['subscriber'], $extra_params);
|
|
||||||
} catch(\Exception $e) {
|
} catch(\Exception $e) {
|
||||||
return $this->errorResponse(array(
|
return $this->errorResponse(array(
|
||||||
$e->getCode() => $e->getMessage()
|
$e->getCode() => $e->getMessage()
|
||||||
@ -34,7 +31,7 @@ class Mailer extends APIEndpoint {
|
|||||||
if($result['response'] === false) {
|
if($result['response'] === false) {
|
||||||
$error = sprintf(
|
$error = sprintf(
|
||||||
__('The email could not be sent: %s', 'mailpoet'),
|
__('The email could not be sent: %s', 'mailpoet'),
|
||||||
$result['error_message']
|
$result['error']->getMessage()
|
||||||
);
|
);
|
||||||
return $this->errorResponse(array(APIError::BAD_REQUEST => $error));
|
return $this->errorResponse(array(APIError::BAD_REQUEST => $error));
|
||||||
} else {
|
} else {
|
||||||
@ -46,4 +43,4 @@ class Mailer extends APIEndpoint {
|
|||||||
MailerLog::resumeSending();
|
MailerLog::resumeSending();
|
||||||
return $this->successResponse(null);
|
return $this->successResponse(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,8 +31,9 @@ class NewsletterTemplates extends APIEndpoint {
|
|||||||
function getAll() {
|
function getAll() {
|
||||||
$collection = NewsletterTemplate
|
$collection = NewsletterTemplate
|
||||||
::selectExpr('id, categories, thumbnail, name, description, readonly')
|
::selectExpr('id, categories, thumbnail, name, description, readonly')
|
||||||
|
->orderByAsc('readonly')
|
||||||
->orderByDesc('created_at')
|
->orderByDesc('created_at')
|
||||||
->orderByAsc('name')
|
->orderByDesc('id')
|
||||||
->findMany();
|
->findMany();
|
||||||
$templates = array_map(function($item) {
|
$templates = array_map(function($item) {
|
||||||
return $item->asArray();
|
return $item->asArray();
|
||||||
|
@ -8,6 +8,7 @@ use MailPoet\Models\Setting;
|
|||||||
use MailPoet\Router;
|
use MailPoet\Router;
|
||||||
use MailPoet\Util\ConflictResolver;
|
use MailPoet\Util\ConflictResolver;
|
||||||
use MailPoet\Util\Helpers;
|
use MailPoet\Util\Helpers;
|
||||||
|
use MailPoet\Util\Notices\PermanentNotices;
|
||||||
use MailPoet\WP\Notice as WPNotice;
|
use MailPoet\WP\Notice as WPNotice;
|
||||||
|
|
||||||
if(!defined('ABSPATH')) exit;
|
if(!defined('ABSPATH')) exit;
|
||||||
@ -144,7 +145,7 @@ class Initializer {
|
|||||||
|
|
||||||
$this->setupPages();
|
$this->setupPages();
|
||||||
|
|
||||||
$this->setupPHPVersionWarnings();
|
$this->setupPermanentNotices();
|
||||||
$this->setupDeactivationSurvey();
|
$this->setupDeactivationSurvey();
|
||||||
|
|
||||||
do_action('mailpoet_initialized', MAILPOET_VERSION);
|
do_action('mailpoet_initialized', MAILPOET_VERSION);
|
||||||
@ -289,9 +290,9 @@ class Initializer {
|
|||||||
$erasers->init();
|
$erasers->init();
|
||||||
}
|
}
|
||||||
|
|
||||||
function setupPHPVersionWarnings() {
|
function setupPermanentNotices() {
|
||||||
$php_version_warnings = new PHPVersionWarnings();
|
$notices = new PermanentNotices();
|
||||||
$php_version_warnings->init(phpversion(), Menu::isOnMailPoetAdminPage());
|
$notices->init();
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleFailedInitialization($exception) {
|
function handleFailedInitialization($exception) {
|
||||||
|
@ -10,6 +10,7 @@ use MailPoet\Models\Setting;
|
|||||||
use MailPoet\Models\Subscriber;
|
use MailPoet\Models\Subscriber;
|
||||||
use MailPoet\Models\SubscriberCustomField;
|
use MailPoet\Models\SubscriberCustomField;
|
||||||
use MailPoet\Models\SubscriberSegment;
|
use MailPoet\Models\SubscriberSegment;
|
||||||
|
use MailPoet\Util\Notices\AfterMigrationNotice;
|
||||||
use MailPoet\Util\ProgressBar;
|
use MailPoet\Util\ProgressBar;
|
||||||
|
|
||||||
if(!defined('ABSPATH')) exit;
|
if(!defined('ABSPATH')) exit;
|
||||||
@ -169,6 +170,8 @@ class MP2Migrator {
|
|||||||
if(!$this->importStopped()) {
|
if(!$this->importStopped()) {
|
||||||
Setting::setValue('mailpoet_migration_complete', true);
|
Setting::setValue('mailpoet_migration_complete', true);
|
||||||
$this->log(mb_strtoupper(__('Import complete', 'mailpoet'), 'UTF-8'));
|
$this->log(mb_strtoupper(__('Import complete', 'mailpoet'), 'UTF-8'));
|
||||||
|
$after_migration_notice = new AfterMigrationNotice();
|
||||||
|
$after_migration_notice->enable();
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->log(sprintf('=== ' . mb_strtoupper(__('End import', 'mailpoet'), 'UTF-8') . ' %s ===', $datetime->formatTime(time(), \MailPoet\WP\DateTime::DEFAULT_DATE_TIME_FORMAT)));
|
$this->log(sprintf('=== ' . mb_strtoupper(__('End import', 'mailpoet'), 'UTF-8') . ' %s ===', $datetime->formatTime(time(), \MailPoet\WP\DateTime::DEFAULT_DATE_TIME_FORMAT)));
|
||||||
|
@ -419,6 +419,8 @@ class Menu {
|
|||||||
'pages' => Pages::getAll(),
|
'pages' => Pages::getAll(),
|
||||||
'flags' => $flags,
|
'flags' => $flags,
|
||||||
'current_user' => wp_get_current_user(),
|
'current_user' => wp_get_current_user(),
|
||||||
|
'linux_cron_path' => dirname(dirname(__DIR__)),
|
||||||
|
'ABSPATH' => ABSPATH,
|
||||||
'hosts' => array(
|
'hosts' => array(
|
||||||
'web' => Hosts::getWebHosts(),
|
'web' => Hosts::getWebHosts(),
|
||||||
'smtp' => Hosts::getSMTPHosts()
|
'smtp' => Hosts::getSMTPHosts()
|
||||||
@ -522,8 +524,6 @@ class Menu {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function segments() {
|
function segments() {
|
||||||
if($this->subscribers_over_limit) return $this->displaySubscriberLimitExceededTemplate();
|
|
||||||
|
|
||||||
$data = array();
|
$data = array();
|
||||||
$data['items_per_page'] = $this->getLimitPerPage('segments');
|
$data['items_per_page'] = $this->getLimitPerPage('segments');
|
||||||
$this->displayPage('segments.html', $data);
|
$this->displayPage('segments.html', $data);
|
||||||
@ -560,6 +560,8 @@ class Menu {
|
|||||||
});
|
});
|
||||||
$data['segments'] = $segments;
|
$data['segments'] = $segments;
|
||||||
$data['settings'] = Setting::getAll();
|
$data['settings'] = Setting::getAll();
|
||||||
|
$data['current_wp_user'] = wp_get_current_user()->to_array();
|
||||||
|
$data['site_url'] = site_url();
|
||||||
$data['roles'] = $wp_roles->get_names();
|
$data['roles'] = $wp_roles->get_names();
|
||||||
$data['roles']['mailpoet_all'] = __('In any WordPress role', 'mailpoet');
|
$data['roles']['mailpoet_all'] = __('In any WordPress role', 'mailpoet');
|
||||||
|
|
||||||
@ -636,10 +638,12 @@ class Menu {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function newletterEditor() {
|
function newletterEditor() {
|
||||||
|
$subscriber = Subscriber::getCurrentWPUser();
|
||||||
|
$subscriber_data = $subscriber ? $subscriber->asArray() : [];
|
||||||
$data = array(
|
$data = array(
|
||||||
'shortcodes' => ShortcodesHelper::getShortcodes(),
|
'shortcodes' => ShortcodesHelper::getShortcodes(),
|
||||||
'settings' => Setting::getAll(),
|
'settings' => Setting::getAll(),
|
||||||
'current_wp_user' => Subscriber::getCurrentWPUser(),
|
'current_wp_user' => array_merge($subscriber_data, wp_get_current_user()->to_array()),
|
||||||
'sub_menu' => self::MAIN_PAGE_SLUG,
|
'sub_menu' => self::MAIN_PAGE_SLUG,
|
||||||
'mss_active' => Bridge::isMPSendingServiceEnabled()
|
'mss_active' => Bridge::isMPSendingServiceEnabled()
|
||||||
);
|
);
|
||||||
|
@ -131,6 +131,8 @@ class Migrator {
|
|||||||
'task_id int(11) unsigned NOT NULL,',
|
'task_id int(11) unsigned NOT NULL,',
|
||||||
'subscriber_id int(11) unsigned NOT NULL,',
|
'subscriber_id int(11) unsigned NOT NULL,',
|
||||||
'processed int(1) NOT NULL,',
|
'processed int(1) NOT NULL,',
|
||||||
|
'failed int(1) NOT NULL,',
|
||||||
|
'error text NULL,',
|
||||||
'created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,',
|
'created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,',
|
||||||
'PRIMARY KEY (task_id, subscriber_id),',
|
'PRIMARY KEY (task_id, subscriber_id),',
|
||||||
'KEY subscriber_id (subscriber_id)'
|
'KEY subscriber_id (subscriber_id)'
|
||||||
|
@ -35,27 +35,46 @@ class Populator {
|
|||||||
'NewsletterBlank12Column',
|
'NewsletterBlank12Column',
|
||||||
'NewsletterBlank121Column',
|
'NewsletterBlank121Column',
|
||||||
'NewsletterBlank13Column',
|
'NewsletterBlank13Column',
|
||||||
'PostNotificationsBlank1Column',
|
|
||||||
'WelcomeBlank1Column',
|
|
||||||
'WelcomeBlank12Column',
|
|
||||||
'SimpleText',
|
'SimpleText',
|
||||||
'BurgerJoint',
|
'TakeAHike',
|
||||||
'AppWelcome',
|
'Faith',
|
||||||
|
'NewsDay',
|
||||||
'WorldCup',
|
'WorldCup',
|
||||||
'FoodBox',
|
'FoodBox',
|
||||||
'Discount',
|
|
||||||
'KickOff',
|
|
||||||
'TakeAHike',
|
|
||||||
'FestivalEvent',
|
'FestivalEvent',
|
||||||
'PieceOfCake',
|
'RetroComputingMagazine',
|
||||||
'Shoes',
|
'Shoes',
|
||||||
'ScienceWeekly',
|
'PieceOfCake',
|
||||||
'ChocolateStore',
|
'Coffee',
|
||||||
'Faith',
|
'Drone',
|
||||||
'TravelNomads',
|
'Retro',
|
||||||
'CoffeeShop',
|
'Hotels',
|
||||||
'NewsDay',
|
'Music',
|
||||||
'YogaStudio',
|
'YogaStudio',
|
||||||
|
'Charity',
|
||||||
|
'FashionStore',
|
||||||
|
|
||||||
|
'WelcomeBlank1Column',
|
||||||
|
'WelcomeBlank12Column',
|
||||||
|
'GiftWelcome',
|
||||||
|
'Minimal',
|
||||||
|
'Phone',
|
||||||
|
'Sunglasses',
|
||||||
|
'RealEstate',
|
||||||
|
'AppWelcome',
|
||||||
|
|
||||||
|
'PostNotificationsBlank1Column',
|
||||||
|
'ModularStyleStories',
|
||||||
|
'NotSoMedium',
|
||||||
|
'RssSimpleNews',
|
||||||
|
'WideStoryLayout',
|
||||||
|
'ScienceWeekly',
|
||||||
|
|
||||||
|
'WineCity',
|
||||||
|
'DogFood',
|
||||||
|
'Fitness',
|
||||||
|
'KidsClothing',
|
||||||
|
'Avocado',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ class AppWelcome {
|
|||||||
private $social_icon_url;
|
private $social_icon_url;
|
||||||
|
|
||||||
function __construct($assets_url) {
|
function __construct($assets_url) {
|
||||||
$this->template_image_url = 'https://ps.w.org/mailpoet/assets/newsletter-templates/app_welcome';
|
$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';
|
$this->social_icon_url = $assets_url . '/img/newsletter_editor/social-icons';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
1035
lib/Config/PopulatorData/Templates/Avocado.php
Normal file
1035
lib/Config/PopulatorData/Templates/Avocado.php
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,497 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace MailPoet\Config\PopulatorData\Templates;
|
|
||||||
|
|
||||||
class BurgerJoint {
|
|
||||||
|
|
||||||
private $template_image_url;
|
|
||||||
private $social_icon_url;
|
|
||||||
|
|
||||||
function __construct($assets_url) {
|
|
||||||
$this->template_image_url = 'https://ps.w.org/mailpoet/assets/newsletter-templates/burger_joint';
|
|
||||||
$this->social_icon_url = $assets_url . '/img/newsletter_editor/social-icons';
|
|
||||||
}
|
|
||||||
|
|
||||||
function get() {
|
|
||||||
return array(
|
|
||||||
'name' => __("Burger Joint", 'mailpoet'),
|
|
||||||
'categories' => json_encode(array('standard', 'sample')),
|
|
||||||
'readonly' => 1,
|
|
||||||
'thumbnail' => $this->getThumbnail(),
|
|
||||||
'body' => json_encode($this->getBody()),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
private function getBody() {
|
|
||||||
return array(
|
|
||||||
'content' => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'horizontal',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
array(
|
|
||||||
'type' => 'image',
|
|
||||||
'link' => 'http://example.org',
|
|
||||||
'src' => $this->template_image_url . '/header.jpg',
|
|
||||||
'alt' => 'Joe\'s Burger Joint',
|
|
||||||
'fullWidth' => true,
|
|
||||||
'width' => '660px',
|
|
||||||
'height' => '100px',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'horizontal',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
array(
|
|
||||||
'type' => 'image',
|
|
||||||
'link' => 'http://example.org',
|
|
||||||
'src' => $this->template_image_url . '/burger-03.jpg',
|
|
||||||
'alt' => 'burger-03',
|
|
||||||
'fullWidth' => true,
|
|
||||||
'width' => '1200px',
|
|
||||||
'height' => '613px',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '30px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'type' => 'button',
|
|
||||||
'text' => 'Make a reservation',
|
|
||||||
'url' => 'http://example.org',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => '#d83b3b',
|
|
||||||
'borderColor' => '#ffffff',
|
|
||||||
'borderWidth' => '0px',
|
|
||||||
'borderRadius' => '0px',
|
|
||||||
'borderStyle' => 'solid',
|
|
||||||
'width' => '225px',
|
|
||||||
'lineHeight' => '50px',
|
|
||||||
'fontColor' => '#ffffff',
|
|
||||||
'fontFamily' => 'Verdana',
|
|
||||||
'fontSize' => '18px',
|
|
||||||
'fontWeight' => 'normal',
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => '<h1 style="text-align: center;"><em>Upgrade! Add these sides</em></h1>',
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '20px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'horizontal',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
array(
|
|
||||||
'type' => 'image',
|
|
||||||
'link' => 'http://example.org',
|
|
||||||
'src' => $this->template_image_url . '/fries-01.jpg',
|
|
||||||
'alt' => 'fries-01',
|
|
||||||
'fullWidth' => false,
|
|
||||||
'width' => '1000px',
|
|
||||||
'height' => '1500px',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => '<blockquote><p>Cras cursus viverra nulla non tempus. Curabitur sed neque vel sapien! - Morbi ullamcorper, Tellus Diam</p></blockquote>',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
array(
|
|
||||||
'type' => 'image',
|
|
||||||
'link' => 'http://example.org',
|
|
||||||
'src' => $this->template_image_url . '/rolls-01.jpg',
|
|
||||||
'alt' => 'rolls-01',
|
|
||||||
'fullWidth' => false,
|
|
||||||
'width' => '1000px',
|
|
||||||
'height' => '1500px',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => '<blockquote><p>Morbi ex diam, venenatis a efficitur et, iaculis at nibh. - Quis Ullamcorper, Tortor Ligula</p></blockquote>',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'horizontal',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
array(
|
|
||||||
'type' => 'divider',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'padding' => '34px',
|
|
||||||
'borderStyle' => 'dashed',
|
|
||||||
'borderWidth' => '3px',
|
|
||||||
'borderColor' => '#aaaaaa',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'horizontal',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => '#e0e0e0',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '30px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => '<h2 style="text-align: center;">Find us at these locations</h2>',
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '20px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'horizontal',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => '#e0e0e0',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
array(
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => '<h3><span style="text-decoration: underline;"><em>Denver</em></span></h3><p>1263 Schoville Street</p><p>53355 DENVER</p><p>CO</p>',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
array(
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => '<h3><span style="text-decoration: underline;"><em>Fort Collins</em></span></h3><p><em></em>157 Maine Street</p><p>86432 FORT COLLINS<br />CO</p><p></p>',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
array(
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => '<h3><span style="text-decoration: underline;"><em>Pueblo</em></span></h3><p><em></em>5390 York Avenue</p><p>64297 Pueblo</p><p>CO</p>',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'horizontal',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '30px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'type' => 'social',
|
|
||||||
'iconSet' => 'full-symbol-black',
|
|
||||||
'icons' => array(
|
|
||||||
array(
|
|
||||||
'type' => 'socialIcon',
|
|
||||||
'iconType' => 'facebook',
|
|
||||||
'link' => 'http://example.com',
|
|
||||||
'image' => $this->social_icon_url . '/07-full-symbol-black/Facebook.png',
|
|
||||||
'height' => '32px',
|
|
||||||
'width' => '32px',
|
|
||||||
'text' => 'Facebook',
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'type' => 'socialIcon',
|
|
||||||
'iconType' => 'twitter',
|
|
||||||
'link' => 'http://example.com',
|
|
||||||
'image' => $this->social_icon_url . '/07-full-symbol-black/Twitter.png',
|
|
||||||
'height' => '32px',
|
|
||||||
'width' => '32px',
|
|
||||||
'text' => 'Twitter',
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'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',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'type' => 'header',
|
|
||||||
'text' => '<p><a href="[link:newsletter_view_in_browser_url]">View this email in your web browser</a></p>',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
'text' => array(
|
|
||||||
'fontColor' => '#222222',
|
|
||||||
'fontFamily' => 'Verdana',
|
|
||||||
'fontSize' => '12px',
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
'link' => array(
|
|
||||||
'fontColor' => '#d83b3b',
|
|
||||||
'textDecoration' => 'underline',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'type' => 'footer',
|
|
||||||
'text' => '<p><a href="[link:subscription_unsubscribe_url]">Unsubscribe</a> | <a href="[link:subscription_manage_url]">Manage subscription</a><br />Address: Colorado</p>',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
'text' => array(
|
|
||||||
'fontColor' => '#222222',
|
|
||||||
'fontFamily' => 'Verdana',
|
|
||||||
'fontSize' => '12px',
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
'link' => array(
|
|
||||||
'fontColor' => '#d83b3b',
|
|
||||||
'textDecoration' => 'none',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'globalStyles' => array(
|
|
||||||
'text' => array(
|
|
||||||
'fontColor' => '#434343',
|
|
||||||
'fontFamily' => 'Tahoma',
|
|
||||||
'fontSize' => '16px',
|
|
||||||
),
|
|
||||||
'h1' => array(
|
|
||||||
'fontColor' => '#222222',
|
|
||||||
'fontFamily' => 'Verdana',
|
|
||||||
'fontSize' => '24px',
|
|
||||||
),
|
|
||||||
'h2' => array(
|
|
||||||
'fontColor' => '#222222',
|
|
||||||
'fontFamily' => 'Verdana',
|
|
||||||
'fontSize' => '22px',
|
|
||||||
),
|
|
||||||
'h3' => array(
|
|
||||||
'fontColor' => '#222222',
|
|
||||||
'fontFamily' => 'Verdana',
|
|
||||||
'fontSize' => '20px',
|
|
||||||
),
|
|
||||||
'link' => array(
|
|
||||||
'fontColor' => '#21759B',
|
|
||||||
'textDecoration' => 'underline',
|
|
||||||
),
|
|
||||||
'wrapper' => array(
|
|
||||||
'backgroundColor' => '#f0f0f0',
|
|
||||||
),
|
|
||||||
'body' => array(
|
|
||||||
'backgroundColor' => '#ffffff',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
private function getThumbnail() {
|
|
||||||
return $this->template_image_url . '/burger-joint.jpg';
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
1136
lib/Config/PopulatorData/Templates/Charity.php
Normal file
1136
lib/Config/PopulatorData/Templates/Charity.php
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,846 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace MailPoet\Config\PopulatorData\Templates;
|
|
||||||
|
|
||||||
class ChocolateStore {
|
|
||||||
|
|
||||||
private $template_image_url;
|
|
||||||
private $social_icon_url;
|
|
||||||
|
|
||||||
function __construct($assets_url) {
|
|
||||||
$this->template_image_url = 'https://ps.w.org/mailpoet/assets/newsletter-templates/chocolate_store';
|
|
||||||
$this->social_icon_url = $assets_url . '/img/newsletter_editor/social-icons';
|
|
||||||
}
|
|
||||||
|
|
||||||
function get() {
|
|
||||||
return array(
|
|
||||||
'name' => __("Chocolate Store", 'mailpoet'),
|
|
||||||
'categories' => json_encode(array('standard', 'sample')),
|
|
||||||
'readonly' => 1,
|
|
||||||
'thumbnail' => $this->getThumbnail(),
|
|
||||||
'body' => json_encode($this->getBody()),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
private function getBody() {
|
|
||||||
return array(
|
|
||||||
'content' => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'horizontal',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '28px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'horizontal',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'image',
|
|
||||||
'link' => '',
|
|
||||||
'src' => $this->template_image_url . '/cafe-cocoa-logo_small.png',
|
|
||||||
'alt' => 'cafe-cocoa-logo_small',
|
|
||||||
'fullWidth' => true,
|
|
||||||
'width' => '648px',
|
|
||||||
'height' => '80px',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'social',
|
|
||||||
'iconSet' => 'full-symbol-grey',
|
|
||||||
'icons' => array(
|
|
||||||
0 => array(
|
|
||||||
'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 => array(
|
|
||||||
'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 => array(
|
|
||||||
'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 => array(
|
|
||||||
'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 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'horizontal',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '36px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
3 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'horizontal',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => '#5b5b5b',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'image',
|
|
||||||
'link' => '',
|
|
||||||
'src' => $this->template_image_url . '/cocoa-hero.jpg',
|
|
||||||
'alt' => 'cocoa-hero',
|
|
||||||
'fullWidth' => true,
|
|
||||||
'width' => '1320px',
|
|
||||||
'height' => '677px',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '40px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
2 => array(
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => '<h1 style="text-align: center;">SEASONAL SPECIAL: RUM TRUFFLE</h1>
|
|
||||||
<p style="text-align: left;">Vestibulum eu nulla quis nulla rutrum efficitur ac in orci. Praesent vulputate neque et scelerisque porttitor. Duis mauris ipsum, sagittis nec semper et, dapibus eget nunc. Fusce ornare eros non mauris tempus varius.</p>',
|
|
||||||
),
|
|
||||||
3 => array(
|
|
||||||
'type' => 'button',
|
|
||||||
'text' => 'Shop Truffles',
|
|
||||||
'url' => '',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => '#a4a4a4',
|
|
||||||
'borderColor' => '#4e4e4e',
|
|
||||||
'borderWidth' => '2px',
|
|
||||||
'borderRadius' => '5px',
|
|
||||||
'borderStyle' => 'solid',
|
|
||||||
'width' => '180px',
|
|
||||||
'lineHeight' => '40px',
|
|
||||||
'fontColor' => '#000000',
|
|
||||||
'fontFamily' => 'Arial',
|
|
||||||
'fontSize' => '18px',
|
|
||||||
'fontWeight' => 'bold',
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
4 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '20px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
4 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'horizontal',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'image',
|
|
||||||
'link' => '',
|
|
||||||
'src' => $this->template_image_url . '/bottom-divider-1.png',
|
|
||||||
'alt' => 'bottom-divider',
|
|
||||||
'fullWidth' => true,
|
|
||||||
'width' => '1320px',
|
|
||||||
'height' => '102px',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '50px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
2 => array(
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => '<h2 style="text-align: center;">Store News</h2>',
|
|
||||||
),
|
|
||||||
3 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '20px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
5 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'horizontal',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'image',
|
|
||||||
'link' => '',
|
|
||||||
'src' => $this->template_image_url . '/cake-shop.png',
|
|
||||||
'alt' => 'cake-shop',
|
|
||||||
'fullWidth' => true,
|
|
||||||
'width' => '300px',
|
|
||||||
'height' => '300px',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'image',
|
|
||||||
'link' => '',
|
|
||||||
'src' => $this->template_image_url . '/bottom-divider_lightgrey-1.png',
|
|
||||||
'alt' => 'bottom-divider_lightgrey',
|
|
||||||
'fullWidth' => true,
|
|
||||||
'width' => '440px',
|
|
||||||
'height' => '60px',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
2 => array(
|
|
||||||
'type' => 'header',
|
|
||||||
'text' => '<p><span style="font-family: \'Open Sans\', Arial, sans-serif;"><span style="font-size: 14px;">Duis pellentesque nibh in lectus blandit.</span></span></p>',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
'text' => array(
|
|
||||||
'fontColor' => '#ffffff',
|
|
||||||
'fontFamily' => 'Arial',
|
|
||||||
'fontSize' => '14px',
|
|
||||||
'textAlign' => 'left',
|
|
||||||
),
|
|
||||||
'link' => array(
|
|
||||||
'fontColor' => '#ffffff',
|
|
||||||
'textDecoration' => 'underline',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'image',
|
|
||||||
'link' => '',
|
|
||||||
'src' => $this->template_image_url . '/new-desserts.png',
|
|
||||||
'alt' => 'new-desserts',
|
|
||||||
'fullWidth' => true,
|
|
||||||
'width' => '300px',
|
|
||||||
'height' => '300px',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'image',
|
|
||||||
'link' => '',
|
|
||||||
'src' => $this->template_image_url . '/bottom-divider_lightgrey-1.png',
|
|
||||||
'alt' => 'bottom-divider_lightgrey',
|
|
||||||
'fullWidth' => true,
|
|
||||||
'width' => '440px',
|
|
||||||
'height' => '60px',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
2 => array(
|
|
||||||
'type' => 'header',
|
|
||||||
'text' => '<p>Phasellus feugiat laoreet ex ac elementum.</p>',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
'text' => array(
|
|
||||||
'fontColor' => '#ffffff',
|
|
||||||
'fontFamily' => 'Arial',
|
|
||||||
'fontSize' => '14px',
|
|
||||||
'textAlign' => 'left',
|
|
||||||
),
|
|
||||||
'link' => array(
|
|
||||||
'fontColor' => '#a4a4a4',
|
|
||||||
'textDecoration' => 'underline',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
2 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'image',
|
|
||||||
'link' => '',
|
|
||||||
'src' => $this->template_image_url . '/cupcakes.jpg',
|
|
||||||
'alt' => 'cupcakes',
|
|
||||||
'fullWidth' => true,
|
|
||||||
'width' => '300px',
|
|
||||||
'height' => '300px',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'image',
|
|
||||||
'link' => '',
|
|
||||||
'src' => $this->template_image_url . '/bottom-divider_lightgrey-1.png',
|
|
||||||
'alt' => 'bottom-divider_lightgrey',
|
|
||||||
'fullWidth' => true,
|
|
||||||
'width' => '440px',
|
|
||||||
'height' => '60px',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
2 => array(
|
|
||||||
'type' => 'header',
|
|
||||||
'text' => '<p>Mauris lacinia venenatis luctus. </p>',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
'text' => array(
|
|
||||||
'fontColor' => '#ffffff',
|
|
||||||
'fontFamily' => 'Arial',
|
|
||||||
'fontSize' => '14px',
|
|
||||||
'textAlign' => 'left',
|
|
||||||
),
|
|
||||||
'link' => array(
|
|
||||||
'fontColor' => '#ffffff',
|
|
||||||
'textDecoration' => 'underline',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
6 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'horizontal',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '40px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'button',
|
|
||||||
'text' => 'Visit Store',
|
|
||||||
'url' => '',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => '#a4a4a4',
|
|
||||||
'borderColor' => '#4e4e4e',
|
|
||||||
'borderWidth' => '2px',
|
|
||||||
'borderRadius' => '5px',
|
|
||||||
'borderStyle' => 'solid',
|
|
||||||
'width' => '180px',
|
|
||||||
'lineHeight' => '40px',
|
|
||||||
'fontColor' => '#000000',
|
|
||||||
'fontFamily' => 'Arial',
|
|
||||||
'fontSize' => '20px',
|
|
||||||
'fontWeight' => 'bold',
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
2 => array(
|
|
||||||
'type' => 'divider',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'padding' => '13px',
|
|
||||||
'borderStyle' => 'double',
|
|
||||||
'borderWidth' => '7px',
|
|
||||||
'borderColor' => '#4e4e4e',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
3 => array(
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => '<h1 style="text-align: center;">Cocoa Blogs...</h1>',
|
|
||||||
),
|
|
||||||
4 => array(
|
|
||||||
'type' => 'divider',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'padding' => '8.5px',
|
|
||||||
'borderStyle' => 'double',
|
|
||||||
'borderWidth' => '7px',
|
|
||||||
'borderColor' => '#4e4e4e',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
5 => array(
|
|
||||||
'type' => 'automatedLatestContent',
|
|
||||||
'amount' => '1',
|
|
||||||
'contentType' => 'post',
|
|
||||||
'terms' => array(),
|
|
||||||
'inclusionType' => 'include',
|
|
||||||
'displayType' => 'excerpt',
|
|
||||||
'titleFormat' => 'h1',
|
|
||||||
'titleAlignment' => 'center',
|
|
||||||
'titleIsLink' => false,
|
|
||||||
'imageFullWidth' => false,
|
|
||||||
'featuredImagePosition' => 'belowTitle',
|
|
||||||
'showAuthor' => 'belowText',
|
|
||||||
'authorPrecededBy' => 'Author:',
|
|
||||||
'showCategories' => 'no',
|
|
||||||
'categoriesPrecededBy' => 'Categories:',
|
|
||||||
'readMoreType' => 'button',
|
|
||||||
'readMoreText' => 'Read more',
|
|
||||||
'readMoreButton' => array(
|
|
||||||
'type' => 'button',
|
|
||||||
'text' => 'Read more',
|
|
||||||
'url' => '[postLink]',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => '#a4a4a4',
|
|
||||||
'borderColor' => '#4e4e4e',
|
|
||||||
'borderWidth' => '2px',
|
|
||||||
'borderRadius' => '5px',
|
|
||||||
'borderStyle' => 'solid',
|
|
||||||
'width' => '180px',
|
|
||||||
'lineHeight' => '40px',
|
|
||||||
'fontColor' => '#000001',
|
|
||||||
'fontFamily' => 'Georgia',
|
|
||||||
'fontSize' => '20px',
|
|
||||||
'fontWeight' => 'normal',
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'sortBy' => 'newest',
|
|
||||||
'showDivider' => false,
|
|
||||||
'divider' => array(
|
|
||||||
'type' => 'divider',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'padding' => '13px',
|
|
||||||
'borderStyle' => 'solid',
|
|
||||||
'borderWidth' => '3px',
|
|
||||||
'borderColor' => '#aaaaaa',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'backgroundColor' => '#ffffff',
|
|
||||||
'backgroundColorAlternate' => '#eeeeee',
|
|
||||||
),
|
|
||||||
6 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '20px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
7 => array(
|
|
||||||
'type' => 'divider',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'padding' => '10.5px',
|
|
||||||
'borderStyle' => 'double',
|
|
||||||
'borderWidth' => '7px',
|
|
||||||
'borderColor' => '#4e4e4e',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
7 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'horizontal',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'social',
|
|
||||||
'iconSet' => 'full-symbol-grey',
|
|
||||||
'icons' => array(
|
|
||||||
0 => array(
|
|
||||||
'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 => array(
|
|
||||||
'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',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => '<p>Add your postal address here!</p>',
|
|
||||||
),
|
|
||||||
2 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '20px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'footer',
|
|
||||||
'text' => '<p><em>Praesent metus ante, venenatis egestas nisl ac, molestie viverra ante. </em></p>
|
|
||||||
<p><em> </em></p>
|
|
||||||
<p><a href="[link:subscription_unsubscribe_url]">Unsubscribe<br /></a><a href="[link:subscription_manage_url]">Manage subscription</a></p>',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
'text' => array(
|
|
||||||
'fontColor' => '#dadada',
|
|
||||||
'fontFamily' => 'Arial',
|
|
||||||
'fontSize' => '14px',
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
'link' => array(
|
|
||||||
'fontColor' => '#dadada',
|
|
||||||
'textDecoration' => 'underline',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '20px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
2 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => '<p><em>Aliquam feugiat nisl eget eleifend congue.</em></p>',
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'image',
|
|
||||||
'link' => '',
|
|
||||||
'src' => $this->template_image_url . '/owner-1.jpg',
|
|
||||||
'alt' => 'owner',
|
|
||||||
'fullWidth' => false,
|
|
||||||
'width' => '100px',
|
|
||||||
'height' => '100px',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
2 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '20px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'globalStyles' => array(
|
|
||||||
'text' => array(
|
|
||||||
'fontColor' => '#ffffff',
|
|
||||||
'fontFamily' => 'Arial',
|
|
||||||
'fontSize' => '16px',
|
|
||||||
),
|
|
||||||
'h1' => array(
|
|
||||||
'fontColor' => '#ffffff',
|
|
||||||
'fontFamily' => 'Georgia',
|
|
||||||
'fontSize' => '24px',
|
|
||||||
),
|
|
||||||
'h2' => array(
|
|
||||||
'fontColor' => '#ffffff',
|
|
||||||
'fontFamily' => 'Georgia',
|
|
||||||
'fontSize' => '32px',
|
|
||||||
),
|
|
||||||
'h3' => array(
|
|
||||||
'fontColor' => '#ffffff',
|
|
||||||
'fontFamily' => 'Georgia',
|
|
||||||
'fontSize' => '24px',
|
|
||||||
),
|
|
||||||
'link' => array(
|
|
||||||
'fontColor' => '#ffffff',
|
|
||||||
'textDecoration' => 'underline',
|
|
||||||
),
|
|
||||||
'wrapper' => array(
|
|
||||||
'backgroundColor' => '#000000',
|
|
||||||
),
|
|
||||||
'body' => array(
|
|
||||||
'backgroundColor' => '#000000',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
private function getThumbnail() {
|
|
||||||
return $this->template_image_url . '/chocolate-store.jpg';
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
1002
lib/Config/PopulatorData/Templates/Coffee.php
Normal file
1002
lib/Config/PopulatorData/Templates/Coffee.php
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,425 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace MailPoet\Config\PopulatorData\Templates;
|
|
||||||
|
|
||||||
class CoffeeShop {
|
|
||||||
|
|
||||||
private $social_icon_url;
|
|
||||||
private $template_image_url;
|
|
||||||
|
|
||||||
function __construct($assets_url) {
|
|
||||||
$this->template_image_url = 'https://ps.w.org/mailpoet/assets/newsletter-templates/franks-roast-house';
|
|
||||||
$this->social_icon_url = $assets_url . '/img/newsletter_editor/social-icons';
|
|
||||||
}
|
|
||||||
|
|
||||||
function get() {
|
|
||||||
return array(
|
|
||||||
'name' => __("Coffee Shop", 'mailpoet'),
|
|
||||||
'categories' => json_encode(array('standard', 'sample')),
|
|
||||||
'readonly' => 1,
|
|
||||||
'thumbnail' => $this->getThumbnail(),
|
|
||||||
'body' => json_encode($this->getBody()),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
private function getBody() {
|
|
||||||
return array(
|
|
||||||
'content' => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'horizontal',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => '#ccc6c6',
|
|
||||||
'height' => '20px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '40px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
2 => array(
|
|
||||||
'type' => 'image',
|
|
||||||
'link' => 'http://www.example.com',
|
|
||||||
'src' => $this->template_image_url . '/header-v2.jpg',
|
|
||||||
'alt' => 'Frank\'s Café',
|
|
||||||
'fullWidth' => true,
|
|
||||||
'width' => '600px',
|
|
||||||
'height' => '220px',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
3 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '30px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
4 => array(
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => '<p>Hi there [subscriber:firstname | default:coffee drinker]</p>
|
|
||||||
<p></p>
|
|
||||||
<p>Sit back and enjoy your favorite roast as you read this week\'s newsletter. </p>',
|
|
||||||
),
|
|
||||||
5 => array(
|
|
||||||
'type' => 'image',
|
|
||||||
'link' => 'http://example.org',
|
|
||||||
'src' => $this->template_image_url . '/coffee-grain.jpg',
|
|
||||||
'alt' => 'Coffee grain',
|
|
||||||
'fullWidth' => true,
|
|
||||||
'width' => '1599px',
|
|
||||||
'height' => '777px',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
6 => array(
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => '<h1 style="text-align: center;">--- Guest Roaster: <em>Brew Bros. ---</em></h1>
|
|
||||||
<p><em></em></p>
|
|
||||||
<p>Visit our Center Avenue store to try the latest guest coffee from Brew Bros, a local coffee roaster. This young duo started only two years ago, but have quickly gained popularity through pop-up shops, local events, and collaborations with food trucks.</p>
|
|
||||||
<p></p>
|
|
||||||
<blockquote>
|
|
||||||
<p><span style="color: #ff6600;"><em><strong>Tasting notes:</strong> A rich, caramel flavor with subtle hints of molasses. The perfect wake-up morning espresso!</em></span></p>
|
|
||||||
</blockquote>',
|
|
||||||
),
|
|
||||||
7 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '22px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'horizontal',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => '#ebebeb',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '40px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => '<h2>Sandwich Competition</h2>',
|
|
||||||
),
|
|
||||||
2 => array(
|
|
||||||
'type' => 'image',
|
|
||||||
'link' => 'http://example.org',
|
|
||||||
'src' => $this->template_image_url . '/sandwich.jpg',
|
|
||||||
'alt' => 'Sandwich',
|
|
||||||
'fullWidth' => false,
|
|
||||||
'width' => '640px',
|
|
||||||
'height' => '344px',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
3 => array(
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => '<p>Have an idea for the Next Great Sandwich? Tell us! We\'re offering free lunch for a month if you can invent an awesome new sandwich for our menu.</p>
|
|
||||||
<p></p>
|
|
||||||
<p>Simply tweet your ideas to <a href="http://www.example.com" title="This isn\'t a real twitter account">@franksroasthouse</a> and use #sandwichcomp and we\'ll let you know if you\'re a winner.</p>',
|
|
||||||
),
|
|
||||||
4 => array(
|
|
||||||
'type' => 'button',
|
|
||||||
'text' => 'Find out more',
|
|
||||||
'url' => 'http://example.org',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => '#604b4b',
|
|
||||||
'borderColor' => '#443232',
|
|
||||||
'borderWidth' => '1px',
|
|
||||||
'borderRadius' => '3px',
|
|
||||||
'borderStyle' => 'solid',
|
|
||||||
'width' => '180px',
|
|
||||||
'lineHeight' => '34px',
|
|
||||||
'fontColor' => '#ffffff',
|
|
||||||
'fontFamily' => 'Arial',
|
|
||||||
'fontSize' => '14px',
|
|
||||||
'fontWeight' => 'normal',
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
5 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '40px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
6 => array(
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => '<h3 style="text-align: center;">Follow Us</h3>',
|
|
||||||
),
|
|
||||||
7 => array(
|
|
||||||
'type' => 'social',
|
|
||||||
'iconSet' => 'full-symbol-black',
|
|
||||||
'icons' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'socialIcon',
|
|
||||||
'iconType' => 'facebook',
|
|
||||||
'link' => 'http://www.facebook.com/mailpoetplugin',
|
|
||||||
'image' => $this->social_icon_url . '/07-full-symbol-black/Facebook.png',
|
|
||||||
'height' => '32px',
|
|
||||||
'width' => '32px',
|
|
||||||
'text' => 'Facebook',
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'socialIcon',
|
|
||||||
'iconType' => 'twitter',
|
|
||||||
'link' => 'http://www.twitter.com/mailpoet',
|
|
||||||
'image' => $this->social_icon_url . '/07-full-symbol-black/Twitter.png',
|
|
||||||
'height' => '32px',
|
|
||||||
'width' => '32px',
|
|
||||||
'text' => 'Twitter',
|
|
||||||
),
|
|
||||||
2 => array(
|
|
||||||
'type' => 'socialIcon',
|
|
||||||
'iconType' => 'instagram',
|
|
||||||
'link' => 'http://www.instagram.com/test',
|
|
||||||
'image' => $this->social_icon_url . '/07-full-symbol-black/Instagram.png',
|
|
||||||
'height' => '32px',
|
|
||||||
'width' => '32px',
|
|
||||||
'text' => 'Instagram',
|
|
||||||
),
|
|
||||||
3 => array(
|
|
||||||
'type' => 'socialIcon',
|
|
||||||
'iconType' => 'website',
|
|
||||||
'link' => 'http://www.mailpoet.com',
|
|
||||||
'image' => $this->social_icon_url . '/07-full-symbol-black/Website.png',
|
|
||||||
'height' => '32px',
|
|
||||||
'width' => '32px',
|
|
||||||
'text' => 'Website',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '40px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => '<h2>New Store Opening!</h2>',
|
|
||||||
),
|
|
||||||
2 => array(
|
|
||||||
'type' => 'image',
|
|
||||||
'link' => 'http://example.org',
|
|
||||||
'src' => $this->template_image_url . '/map-v2.jpg',
|
|
||||||
'alt' => 'Map',
|
|
||||||
'fullWidth' => false,
|
|
||||||
'width' => '636px',
|
|
||||||
'height' => '342px',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
3 => array(
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => '<p>Watch out Broad Street, we\'re coming to you very soon! </p>
|
|
||||||
<p></p>
|
|
||||||
<p>Keep an eye on your inbox, as we\'ll have some special offers for our email subscribers plus an exclusive launch party invite!<br /><br /></p>',
|
|
||||||
),
|
|
||||||
4 => array(
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => '<h2>New and Improved Hours!</h2>
|
|
||||||
<p></p>
|
|
||||||
<p>Frank\'s is now open even later, so you can get your caffeine fix all day (and night) long! Here\'s our new opening hours:</p>
|
|
||||||
<p></p>
|
|
||||||
<ul>
|
|
||||||
<li>Monday - Thursday: 6am - 12am</li>
|
|
||||||
<li>Friday - Saturday: 6am - 1:30am</li>
|
|
||||||
<li>Sunday: 7:30am - 11pm</li>
|
|
||||||
</ul>',
|
|
||||||
),
|
|
||||||
5 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '33px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
2 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'horizontal',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '20px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'footer',
|
|
||||||
'text' => '<p><a href="[link:subscription_unsubscribe_url]">Unsubscribe</a> | <a href="[link:subscription_manage_url]">Manage subscription</a><br />12345 MailPoet Drive, EmailVille, 76543</p>',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => '#a9a7a7',
|
|
||||||
),
|
|
||||||
'text' => array(
|
|
||||||
'fontColor' => '#000000',
|
|
||||||
'fontFamily' => 'Arial',
|
|
||||||
'fontSize' => '12px',
|
|
||||||
'textAlign' => 'right',
|
|
||||||
),
|
|
||||||
'link' => array(
|
|
||||||
'fontColor' => '#000000',
|
|
||||||
'textDecoration' => 'underline',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'globalStyles' => array(
|
|
||||||
'text' => array(
|
|
||||||
'fontColor' => '#000000',
|
|
||||||
'fontFamily' => 'Arial',
|
|
||||||
'fontSize' => '14px',
|
|
||||||
),
|
|
||||||
'h1' => array(
|
|
||||||
'fontColor' => '#604b4b',
|
|
||||||
'fontFamily' => 'Lucida',
|
|
||||||
'fontSize' => '30px',
|
|
||||||
),
|
|
||||||
'h2' => array(
|
|
||||||
'fontColor' => '#5c4242',
|
|
||||||
'fontFamily' => 'Lucida',
|
|
||||||
'fontSize' => '22px',
|
|
||||||
),
|
|
||||||
'h3' => array(
|
|
||||||
'fontColor' => '#333333',
|
|
||||||
'fontFamily' => 'Lucida',
|
|
||||||
'fontSize' => '20px',
|
|
||||||
),
|
|
||||||
'link' => array(
|
|
||||||
'fontColor' => '#047da7',
|
|
||||||
'textDecoration' => 'underline',
|
|
||||||
),
|
|
||||||
'wrapper' => array(
|
|
||||||
'backgroundColor' => '#ffffff',
|
|
||||||
),
|
|
||||||
'body' => array(
|
|
||||||
'backgroundColor' => '#ccc6c6',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
private function getThumbnail() {
|
|
||||||
return $this->template_image_url . '/coffee-shop.jpg';
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,467 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace MailPoet\Config\PopulatorData\Templates;
|
|
||||||
|
|
||||||
class Discount {
|
|
||||||
|
|
||||||
private $template_image_url;
|
|
||||||
private $social_icon_url;
|
|
||||||
|
|
||||||
function __construct($assets_url) {
|
|
||||||
$this->template_image_url = 'https://ps.w.org/mailpoet/assets/newsletter-templates/discount';
|
|
||||||
$this->social_icon_url = $assets_url . '/img/newsletter_editor/social-icons';
|
|
||||||
}
|
|
||||||
|
|
||||||
function get() {
|
|
||||||
return array(
|
|
||||||
'name' => __("Discount", 'mailpoet'),
|
|
||||||
'categories' => json_encode(array('standard', 'sample')),
|
|
||||||
'readonly' => 1,
|
|
||||||
'thumbnail' => $this->getThumbnail(),
|
|
||||||
'body' => json_encode($this->getBody()),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
private function getBody() {
|
|
||||||
return array(
|
|
||||||
'content' => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'horizontal',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '20px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'image',
|
|
||||||
'link' => 'http://example.org',
|
|
||||||
'src' => $this->template_image_url . '/bicycle-header3.png',
|
|
||||||
'alt' => 'bicycle-header3',
|
|
||||||
'fullWidth' => false,
|
|
||||||
'width' => '423px',
|
|
||||||
'height' => '135px',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
2 => array(
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => '<p></p>
|
|
||||||
<p>Hi [subscriber:firstname | default:reader]</p>
|
|
||||||
<p class=""></p>
|
|
||||||
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec ut venenatis ipsum. Etiam efficitur magna a convallis consectetur. Nunc dapibus cursus mauris vel sollicitudin. Etiam magna libero, posuere ac nulla nec, iaculis pulvinar arcu.</p>',
|
|
||||||
),
|
|
||||||
3 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '20px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'horizontal',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => '#ebdddd',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'divider',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'padding' => '16px',
|
|
||||||
'borderStyle' => 'dashed',
|
|
||||||
'borderWidth' => '2px',
|
|
||||||
'borderColor' => '#9a5fa1',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => '<h1 style="text-align: center;"><em><strong>15% odio felis fringilla eget enim</strong></em></h1>',
|
|
||||||
),
|
|
||||||
2 => array(
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => '<h2 style="text-align: center;">FUSCE LOBORTIS<strong>: WELOVEMAILPOET</strong></h2>',
|
|
||||||
),
|
|
||||||
3 => array(
|
|
||||||
'type' => 'divider',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'padding' => '16px',
|
|
||||||
'borderStyle' => 'dashed',
|
|
||||||
'borderWidth' => '2px',
|
|
||||||
'borderColor' => '#9a5fa1',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
2 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'horizontal',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '20px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'button',
|
|
||||||
'text' => 'SHOP NOW',
|
|
||||||
'url' => 'http://example.org',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => '#9a5fa1',
|
|
||||||
'borderColor' => '#854f8b',
|
|
||||||
'borderWidth' => '3px',
|
|
||||||
'borderRadius' => '5px',
|
|
||||||
'borderStyle' => 'solid',
|
|
||||||
'width' => '288px',
|
|
||||||
'lineHeight' => '50px',
|
|
||||||
'fontColor' => '#ffffff',
|
|
||||||
'fontFamily' => 'Verdana',
|
|
||||||
'fontSize' => '18px',
|
|
||||||
'fontWeight' => 'normal',
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
2 => array(
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => '<h1 style="text-align: center;"><strong><em>Use your discount on these great products...</em></strong></h1>',
|
|
||||||
),
|
|
||||||
3 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '20px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
3 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'horizontal',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'image',
|
|
||||||
'link' => 'http://example.org',
|
|
||||||
'src' => $this->template_image_url . '/red-icycle-2.jpg',
|
|
||||||
'alt' => 'red-icycle',
|
|
||||||
'fullWidth' => false,
|
|
||||||
'width' => '558px',
|
|
||||||
'height' => '399px',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => '<h3 style="text-align: center;">Lovely Red Bicycle</h3>
|
|
||||||
<p>Quisque nec vulputate velit, non sagittis ex. Suspendisse ligula urna, tempus sed iaculis sit amet, convallis at arcu.</p>
|
|
||||||
<h3 style="text-align: center;"><strong><span style="color: #488e88;">$289.99</span></strong></h3>',
|
|
||||||
),
|
|
||||||
2 => array(
|
|
||||||
'type' => 'button',
|
|
||||||
'text' => 'Tempus',
|
|
||||||
'url' => 'http://example.org',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => '#9a5fa1',
|
|
||||||
'borderColor' => '#854f8b',
|
|
||||||
'borderWidth' => '3px',
|
|
||||||
'borderRadius' => '5px',
|
|
||||||
'borderStyle' => 'solid',
|
|
||||||
'width' => '180px',
|
|
||||||
'lineHeight' => '40px',
|
|
||||||
'fontColor' => '#ffffff',
|
|
||||||
'fontFamily' => 'Verdana',
|
|
||||||
'fontSize' => '18px',
|
|
||||||
'fontWeight' => 'normal',
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'image',
|
|
||||||
'link' => 'http://example.org',
|
|
||||||
'src' => $this->template_image_url . '/orange-bicycle.jpg',
|
|
||||||
'alt' => 'orange-bicycle',
|
|
||||||
'fullWidth' => false,
|
|
||||||
'width' => '639px',
|
|
||||||
'height' => '457px',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => '<h3 style="text-align: center;">Little Orange Bicycle</h3>
|
|
||||||
<p>Praesent molestie mollis sapien vel dignissim. Maecenas ultrices, odio eget dapibus iaculis, ligula ex aliquet leo.</p>
|
|
||||||
<h3 style="line-height: 22.4px; text-align: center;"><span style="color: #488e88;"><strong>$209.99</strong></span></h3>',
|
|
||||||
),
|
|
||||||
2 => array(
|
|
||||||
'type' => 'button',
|
|
||||||
'text' => 'Tempus',
|
|
||||||
'url' => 'http://example.org',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => '#9a5fa1',
|
|
||||||
'borderColor' => '#854f8b',
|
|
||||||
'borderWidth' => '3px',
|
|
||||||
'borderRadius' => '5px',
|
|
||||||
'borderStyle' => 'solid',
|
|
||||||
'width' => '180px',
|
|
||||||
'lineHeight' => '40px',
|
|
||||||
'fontColor' => '#ffffff',
|
|
||||||
'fontFamily' => 'Verdana',
|
|
||||||
'fontSize' => '18px',
|
|
||||||
'fontWeight' => 'normal',
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
4 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'horizontal',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '22px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'divider',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'padding' => '20px',
|
|
||||||
'borderStyle' => 'solid',
|
|
||||||
'borderWidth' => '1px',
|
|
||||||
'borderColor' => '#9e9e9e',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
2 => array(
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => '<p><em>Diam et vestibulum facilisis:</em></p>
|
|
||||||
<ul>
|
|
||||||
<li>Massa justo tincidunt magna, a volutpat dolor leo vel mi.</li>
|
|
||||||
<li>Curabitur ornare tellus libero, nec porta dolor elementum et.</li>
|
|
||||||
<li>Vestibulum sodales congue ex quis euismod.</li>
|
|
||||||
</ul>',
|
|
||||||
),
|
|
||||||
3 => array(
|
|
||||||
'type' => 'social',
|
|
||||||
'iconSet' => 'grey',
|
|
||||||
'icons' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'socialIcon',
|
|
||||||
'iconType' => 'facebook',
|
|
||||||
'link' => 'http://example.com',
|
|
||||||
'image' => $this->social_icon_url . '/02-grey/Facebook.png',
|
|
||||||
'height' => '32px',
|
|
||||||
'width' => '32px',
|
|
||||||
'text' => 'Facebook',
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'socialIcon',
|
|
||||||
'iconType' => 'twitter',
|
|
||||||
'link' => 'http://example.com',
|
|
||||||
'image' => $this->social_icon_url . '/02-grey/Twitter.png',
|
|
||||||
'height' => '32px',
|
|
||||||
'width' => '32px',
|
|
||||||
'text' => 'Twitter',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
4 => array(
|
|
||||||
'type' => 'footer',
|
|
||||||
'text' => '<p><a href="[link:subscription_unsubscribe_url]">Unsubscribe</a> | <a href="[link:subscription_manage_url]">Manage subscription</a></p><p>1 Store Street, Shopville, CA 1345</p>',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
'text' => array(
|
|
||||||
'fontColor' => '#343434',
|
|
||||||
'fontFamily' => 'Verdana',
|
|
||||||
'fontSize' => '12px',
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
'link' => array(
|
|
||||||
'fontColor' => '#488e88',
|
|
||||||
'textDecoration' => 'none',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'globalStyles' => array(
|
|
||||||
'text' => array(
|
|
||||||
'fontColor' => '#343434',
|
|
||||||
'fontFamily' => 'Verdana',
|
|
||||||
'fontSize' => '14px',
|
|
||||||
),
|
|
||||||
'h1' => array(
|
|
||||||
'fontColor' => '#488e88',
|
|
||||||
'fontFamily' => 'Trebuchet MS',
|
|
||||||
'fontSize' => '22px',
|
|
||||||
),
|
|
||||||
'h2' => array(
|
|
||||||
'fontColor' => '#9a5fa1',
|
|
||||||
'fontFamily' => 'Verdana',
|
|
||||||
'fontSize' => '24px',
|
|
||||||
),
|
|
||||||
'h3' => array(
|
|
||||||
'fontColor' => '#9a5fa1',
|
|
||||||
'fontFamily' => 'Trebuchet MS',
|
|
||||||
'fontSize' => '18px',
|
|
||||||
),
|
|
||||||
'link' => array(
|
|
||||||
'fontColor' => '#488e88',
|
|
||||||
'textDecoration' => 'underline',
|
|
||||||
),
|
|
||||||
'wrapper' => array(
|
|
||||||
'backgroundColor' => '#afe3de',
|
|
||||||
),
|
|
||||||
'body' => array(
|
|
||||||
'backgroundColor' => '#afe3de',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
private function getThumbnail() {
|
|
||||||
return $this->template_image_url . '/discount.jpg';
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
1149
lib/Config/PopulatorData/Templates/DogFood.php
Normal file
1149
lib/Config/PopulatorData/Templates/DogFood.php
Normal file
File diff suppressed because it is too large
Load Diff
1192
lib/Config/PopulatorData/Templates/Drone.php
Normal file
1192
lib/Config/PopulatorData/Templates/Drone.php
Normal file
File diff suppressed because it is too large
Load Diff
1425
lib/Config/PopulatorData/Templates/FashionStore.php
Normal file
1425
lib/Config/PopulatorData/Templates/FashionStore.php
Normal file
File diff suppressed because it is too large
Load Diff
1114
lib/Config/PopulatorData/Templates/Fitness.php
Normal file
1114
lib/Config/PopulatorData/Templates/Fitness.php
Normal file
File diff suppressed because it is too large
Load Diff
348
lib/Config/PopulatorData/Templates/GiftWelcome.php
Normal file
348
lib/Config/PopulatorData/Templates/GiftWelcome.php
Normal file
@ -0,0 +1,348 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace MailPoet\Config\PopulatorData\Templates;
|
||||||
|
|
||||||
|
class GiftWelcome {
|
||||||
|
|
||||||
|
private $template_image_url;
|
||||||
|
private $social_icon_url;
|
||||||
|
|
||||||
|
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';
|
||||||
|
}
|
||||||
|
|
||||||
|
function get() {
|
||||||
|
return array(
|
||||||
|
'name' => __("Gift Welcome", 'mailpoet'),
|
||||||
|
'categories' => json_encode(array('welcome', 'sample')),
|
||||||
|
'readonly' => 1,
|
||||||
|
'thumbnail' => $this->getThumbnail(),
|
||||||
|
'body' => json_encode($this->getBody()),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getThumbnail() {
|
||||||
|
return $this->template_image_url . '/gift.jpg';
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getBody() {
|
||||||
|
return array (
|
||||||
|
'content' =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'horizontal',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#ffffff',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'spacer',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'height' => '40px',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'type' => 'image',
|
||||||
|
'link' => '',
|
||||||
|
'src' => $this->template_image_url . '/Gift-Header-1.jpg',
|
||||||
|
'alt' => 'Gift-Header-1',
|
||||||
|
'fullWidth' => true,
|
||||||
|
'width' => '1280px',
|
||||||
|
'height' => '920px',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'textAlign' => 'center',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'horizontal',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#e7e7e7',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'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 =>
|
||||||
|
array (
|
||||||
|
'type' => 'button',
|
||||||
|
'text' => 'Get Started',
|
||||||
|
'url' => '',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'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 =>
|
||||||
|
array (
|
||||||
|
'type' => 'image',
|
||||||
|
'link' => '',
|
||||||
|
'src' => $this->template_image_url . '/Gift-Footer.jpg',
|
||||||
|
'alt' => 'Gift-Footer',
|
||||||
|
'fullWidth' => true,
|
||||||
|
'width' => '1280px',
|
||||||
|
'height' => '920px',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'textAlign' => 'center',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
2 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'horizontal',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#ffffff',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'spacer',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'height' => '23px',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'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 =>
|
||||||
|
array (
|
||||||
|
'type' => 'divider',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'padding' => '5.5px',
|
||||||
|
'borderStyle' => 'solid',
|
||||||
|
'borderWidth' => '1px',
|
||||||
|
'borderColor' => '#aaaaaa',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
3 =>
|
||||||
|
array (
|
||||||
|
'type' => 'spacer',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'height' => '20px',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
4 =>
|
||||||
|
array (
|
||||||
|
'type' => 'social',
|
||||||
|
'iconSet' => 'grey',
|
||||||
|
'icons' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'socialIcon',
|
||||||
|
'iconType' => 'facebook',
|
||||||
|
'link' => 'http://www.facebook.com',
|
||||||
|
'image' => $this->social_icon_url . '/02-grey/Facebook.png?mailpoet_version=3.0.0-rc.2.0.0',
|
||||||
|
'height' => '32px',
|
||||||
|
'width' => '32px',
|
||||||
|
'text' => 'Facebook',
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'type' => 'socialIcon',
|
||||||
|
'iconType' => 'twitter',
|
||||||
|
'link' => 'http://www.twitter.com',
|
||||||
|
'image' => $this->social_icon_url . '/02-grey/Twitter.png?mailpoet_version=3.0.0-rc.2.0.0',
|
||||||
|
'height' => '32px',
|
||||||
|
'width' => '32px',
|
||||||
|
'text' => 'Twitter',
|
||||||
|
),
|
||||||
|
2 =>
|
||||||
|
array (
|
||||||
|
'type' => 'socialIcon',
|
||||||
|
'iconType' => 'instagram',
|
||||||
|
'link' => 'http://instagram.com',
|
||||||
|
'image' => $this->social_icon_url . '/02-grey/Instagram.png?mailpoet_version=3.0.0-rc.2.0.0',
|
||||||
|
'height' => '32px',
|
||||||
|
'width' => '32px',
|
||||||
|
'text' => 'Instagram',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
5 =>
|
||||||
|
array (
|
||||||
|
'type' => 'text',
|
||||||
|
'text' => '<p style="text-align: center; font-size: 11px;"><a href="[link:subscription_unsubscribe_url]">Unsubscribe</a><span> | </span><a href="[link:subscription_manage_url]">Manage your subscription</a></p>',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'globalStyles' =>
|
||||||
|
array (
|
||||||
|
'text' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#000000',
|
||||||
|
'fontFamily' => 'Arial',
|
||||||
|
'fontSize' => '15px',
|
||||||
|
),
|
||||||
|
'h1' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#111111',
|
||||||
|
'fontFamily' => 'Arial',
|
||||||
|
'fontSize' => '30px',
|
||||||
|
),
|
||||||
|
'h2' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#222222',
|
||||||
|
'fontFamily' => 'Arial',
|
||||||
|
'fontSize' => '24px',
|
||||||
|
),
|
||||||
|
'h3' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#333333',
|
||||||
|
'fontFamily' => 'Arial',
|
||||||
|
'fontSize' => '22px',
|
||||||
|
),
|
||||||
|
'link' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#dd2d2d',
|
||||||
|
'textDecoration' => 'underline',
|
||||||
|
),
|
||||||
|
'wrapper' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#ffffff',
|
||||||
|
),
|
||||||
|
'body' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#ffffff',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
1414
lib/Config/PopulatorData/Templates/Hotels.php
Normal file
1414
lib/Config/PopulatorData/Templates/Hotels.php
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,721 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace MailPoet\Config\PopulatorData\Templates;
|
|
||||||
|
|
||||||
class KickOff {
|
|
||||||
|
|
||||||
private $template_image_url;
|
|
||||||
private $social_icon_url;
|
|
||||||
|
|
||||||
function __construct($assets_url) {
|
|
||||||
$this->template_image_url = 'https://ps.w.org/mailpoet/assets/newsletter-templates/kick_off';
|
|
||||||
$this->social_icon_url = $assets_url . '/img/newsletter_editor/social-icons';
|
|
||||||
}
|
|
||||||
|
|
||||||
function get() {
|
|
||||||
return array(
|
|
||||||
'name' => __("Kick-Off", 'mailpoet'),
|
|
||||||
'categories' => json_encode(array('standard', 'sample')),
|
|
||||||
'readonly' => 1,
|
|
||||||
'thumbnail' => $this->getThumbnail(),
|
|
||||||
'body' => json_encode($this->getBody()),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
private function getBody() {
|
|
||||||
return array(
|
|
||||||
'content' => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'horizontal',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'image',
|
|
||||||
'link' => '',
|
|
||||||
'src' => $this->template_image_url . '/football-header.jpg',
|
|
||||||
'alt' => 'football-header',
|
|
||||||
'fullWidth' => true,
|
|
||||||
'width' => '1320px',
|
|
||||||
'height' => '540px',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '20px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
2 => array(
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => '<h1 style="text-align: center;"><strong>ALL THE LATEST MATCH RESULTS & NEWS FROM THE SUNDAYS CLUB</strong></h1>',
|
|
||||||
),
|
|
||||||
3 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '20px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'horizontal',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'image',
|
|
||||||
'link' => '',
|
|
||||||
'src' => $this->template_image_url . '/football-player-1.jpeg',
|
|
||||||
'alt' => 'football-player',
|
|
||||||
'fullWidth' => false,
|
|
||||||
'width' => '600px',
|
|
||||||
'height' => '840px',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => '<p><em>Nam convallis lorem tellus, eget sodales magna semper quis.</em></p>',
|
|
||||||
),
|
|
||||||
2 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '20px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => '<h2>North</h2>
|
|
||||||
<p>Nottington 0-1 East Lettersley</p>
|
|
||||||
<p>Little Bickburgh 2-1 Rockingham</p>
|
|
||||||
<p></p>
|
|
||||||
<h2>South</h2>
|
|
||||||
<p>Richmond West 1-0 Offington</p>
|
|
||||||
<p>Shorleton 5-2 Garphingham</p>
|
|
||||||
<p>Westwood 1-3 Chesham</p>
|
|
||||||
<p></p>
|
|
||||||
<h2>West</h2>
|
|
||||||
<p>Millham 4-2 Dunn Village</p>
|
|
||||||
<p>Emmington 1-1 Finham</p>
|
|
||||||
<p>Little Forest 0-2 Winton</p>
|
|
||||||
<p></p>
|
|
||||||
<h2>East</h2>
|
|
||||||
<p>Southfield 2-1 Fincham</p>
|
|
||||||
<p>High Ridlington 0-1 Benham</p>
|
|
||||||
<p>Tinton 4-6 Dortington</p>',
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '20px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
2 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'horizontal',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'divider',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'padding' => '25px',
|
|
||||||
'borderStyle' => 'ridge',
|
|
||||||
'borderWidth' => '5px',
|
|
||||||
'borderColor' => '#484747',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => '<h1 style="text-align: center;">MATCH REPORTS</h1>',
|
|
||||||
),
|
|
||||||
2 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '21px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
3 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'horizontal',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => '<h2>Branham United vs Finkley</h2>
|
|
||||||
<p>Vestibulum consectetur, quam sed tristique feugiat, elit sapien molestie mi, eu dapibus eros sapien ut risus. Nullam non scelerisque ligula.</p>
|
|
||||||
<p></p>
|
|
||||||
<p>Donec vitae nunc tempus, elementum magna et, ultrices velit. Sed eu consequat sapien, at dictum diam. Sed tristique egestas justo sit amet vulputate. Proin rhoncus sem eu odio ultricies ultrices.</p>',
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'button',
|
|
||||||
'text' => 'READ MORE',
|
|
||||||
'url' => 'http://www.google.co.uk',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => '#61cc5a',
|
|
||||||
'borderColor' => '#2f6a2c',
|
|
||||||
'borderWidth' => '3px',
|
|
||||||
'borderRadius' => '5px',
|
|
||||||
'borderStyle' => 'solid',
|
|
||||||
'width' => '180px',
|
|
||||||
'lineHeight' => '40px',
|
|
||||||
'fontColor' => '#252525',
|
|
||||||
'fontFamily' => 'Lucida',
|
|
||||||
'fontSize' => '14px',
|
|
||||||
'fontWeight' => 'bold',
|
|
||||||
'textAlign' => 'left',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
2 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '20px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => '<h2 style="text-align: center;">Champton Albion vs Swanhall</h2>
|
|
||||||
<p>Aenean a arcu egestas, tincidunt nisi ut, mollis arcu. Sed eget dapibus nisi. Quisque tortor mi, consequat ut erat et, porta imperdiet dui.</p>
|
|
||||||
<p></p>
|
|
||||||
<p>Mauris vestibulum tortor ut justo luctus blandit. Vestibulum mollis sollicitudin tempor. Duis gravida, dui quis eleifend scelerisque, libero orci semper metus, sed maximus odio tortor ac sem.</p>',
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'button',
|
|
||||||
'text' => 'READ MORE',
|
|
||||||
'url' => 'https://www.google.co.uk',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => '#61cc5a',
|
|
||||||
'borderColor' => '#2f6a2c',
|
|
||||||
'borderWidth' => '3px',
|
|
||||||
'borderRadius' => '5px',
|
|
||||||
'borderStyle' => 'solid',
|
|
||||||
'width' => '180px',
|
|
||||||
'lineHeight' => '40px',
|
|
||||||
'fontColor' => '#252525',
|
|
||||||
'fontFamily' => 'Lucida',
|
|
||||||
'fontSize' => '14px',
|
|
||||||
'fontWeight' => 'bold',
|
|
||||||
'textAlign' => 'left',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
2 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '20px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
4 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'horizontal',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => '#8aeb83',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '28px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => '<h1 style="text-align: center;"><strong><span style="color: #333333;">FROM OUR ONLINE STORE</span></strong></h1>',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
5 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'horizontal',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => '#8aeb83',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '20px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'image',
|
|
||||||
'link' => '',
|
|
||||||
'src' => $this->template_image_url . '/shoes.jpg',
|
|
||||||
'alt' => 'shoes',
|
|
||||||
'fullWidth' => false,
|
|
||||||
'width' => '400px',
|
|
||||||
'height' => '400px',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
2 => array(
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => '<h3 style="text-align: center;"><strong>Team Colours Laces</strong></h3><p style="text-align: center;"><span style="color: #333333;">Donec imperdiet<em><br /></em>Tortor tincidunt, luctus libero vel, dapibus quam</span></p>',
|
|
||||||
),
|
|
||||||
3 => array(
|
|
||||||
'type' => 'button',
|
|
||||||
'text' => 'SHOP',
|
|
||||||
'url' => '',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => '#61cc5a',
|
|
||||||
'borderColor' => '#2f6a2c',
|
|
||||||
'borderWidth' => '3px',
|
|
||||||
'borderRadius' => '5px',
|
|
||||||
'borderStyle' => 'solid',
|
|
||||||
'width' => '180px',
|
|
||||||
'lineHeight' => '40px',
|
|
||||||
'fontColor' => '#252525',
|
|
||||||
'fontFamily' => 'Lucida',
|
|
||||||
'fontSize' => '14px',
|
|
||||||
'fontWeight' => 'bold',
|
|
||||||
'textAlign' => 'left',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
4 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '20px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '20px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'image',
|
|
||||||
'link' => '',
|
|
||||||
'src' => $this->template_image_url . '/football.jpg',
|
|
||||||
'alt' => 'football',
|
|
||||||
'fullWidth' => false,
|
|
||||||
'width' => '400px',
|
|
||||||
'height' => '400px',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
2 => array(
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => '<h3 style="text-align: center;"><strong>Match Quality Balls</strong></h3><p style="text-align: center;"><span style="color: #333333;">Donec vulputate tempor auctor purus sit amet cursus ultricies</span></p>',
|
|
||||||
),
|
|
||||||
3 => array(
|
|
||||||
'type' => 'button',
|
|
||||||
'text' => 'SHOP',
|
|
||||||
'url' => '',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => '#61cc5a',
|
|
||||||
'borderColor' => '#2f6a2c',
|
|
||||||
'borderWidth' => '3px',
|
|
||||||
'borderRadius' => '5px',
|
|
||||||
'borderStyle' => 'solid',
|
|
||||||
'width' => '180px',
|
|
||||||
'lineHeight' => '40px',
|
|
||||||
'fontColor' => '#252525',
|
|
||||||
'fontFamily' => 'Lucida',
|
|
||||||
'fontSize' => '14px',
|
|
||||||
'fontWeight' => 'bold',
|
|
||||||
'textAlign' => 'left',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
2 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '20px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'image',
|
|
||||||
'link' => '',
|
|
||||||
'src' => $this->template_image_url . '/plant-pot.jpg',
|
|
||||||
'alt' => 'plant-pot',
|
|
||||||
'fullWidth' => false,
|
|
||||||
'width' => '400px',
|
|
||||||
'height' => '400px',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
2 => array(
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => '<h3 style="text-align: center;"><strong>Football Plant Pots</strong></h3><p style="text-align: center;"><span style="color: #333333;">Libero tortor aliquet metus eget efficitur est lorem sit amet purus</span></p>',
|
|
||||||
),
|
|
||||||
3 => array(
|
|
||||||
'type' => 'button',
|
|
||||||
'text' => 'SHOP',
|
|
||||||
'url' => '',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => '#61cc5a',
|
|
||||||
'borderColor' => '#2f6a2c',
|
|
||||||
'borderWidth' => '3px',
|
|
||||||
'borderRadius' => '5px',
|
|
||||||
'borderStyle' => 'solid',
|
|
||||||
'width' => '180px',
|
|
||||||
'lineHeight' => '40px',
|
|
||||||
'fontColor' => '#252525',
|
|
||||||
'fontFamily' => 'Lucida',
|
|
||||||
'fontSize' => '14px',
|
|
||||||
'fontWeight' => 'bold',
|
|
||||||
'textAlign' => 'left',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
6 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'horizontal',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '40px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'footer',
|
|
||||||
'text' => '<a href="[link:subscription_unsubscribe_url]">Unsubscribe</a> | <a href="[link:subscription_manage_url]">Manage subscription</a><br /><b>Add your postal address here!</b>',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
'text' => array(
|
|
||||||
'fontColor' => '#ffffff',
|
|
||||||
'fontFamily' => 'Lucida',
|
|
||||||
'fontSize' => '12px',
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
'link' => array(
|
|
||||||
'fontColor' => '#ffffff',
|
|
||||||
'textDecoration' => 'underline',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
2 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '23px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
3 => array(
|
|
||||||
'type' => 'social',
|
|
||||||
'iconSet' => 'full-symbol-grey',
|
|
||||||
'icons' => array(
|
|
||||||
0 => array(
|
|
||||||
'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 => array(
|
|
||||||
'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 => array(
|
|
||||||
'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 => array(
|
|
||||||
'type' => 'socialIcon',
|
|
||||||
'iconType' => 'email',
|
|
||||||
'link' => '',
|
|
||||||
'image' => $this->social_icon_url . '/08-full-symbol-grey/Email.png',
|
|
||||||
'height' => '32px',
|
|
||||||
'width' => '32px',
|
|
||||||
'text' => 'Email',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
4 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '20px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'globalStyles' => array(
|
|
||||||
'text' => array(
|
|
||||||
'fontColor' => '#ffffff',
|
|
||||||
'fontFamily' => 'Georgia',
|
|
||||||
'fontSize' => '16px',
|
|
||||||
),
|
|
||||||
'h1' => array(
|
|
||||||
'fontColor' => '#ffffff',
|
|
||||||
'fontFamily' => 'Lucida',
|
|
||||||
'fontSize' => '24px',
|
|
||||||
),
|
|
||||||
'h2' => array(
|
|
||||||
'fontColor' => '#61cc5a',
|
|
||||||
'fontFamily' => 'Lucida',
|
|
||||||
'fontSize' => '22px',
|
|
||||||
),
|
|
||||||
'h3' => array(
|
|
||||||
'fontColor' => '#333333',
|
|
||||||
'fontFamily' => 'Lucida',
|
|
||||||
'fontSize' => '20px',
|
|
||||||
),
|
|
||||||
'link' => array(
|
|
||||||
'fontColor' => '#21759B',
|
|
||||||
'textDecoration' => 'underline',
|
|
||||||
),
|
|
||||||
'wrapper' => array(
|
|
||||||
'backgroundColor' => '#252525',
|
|
||||||
),
|
|
||||||
'body' => array(
|
|
||||||
'backgroundColor' => '#eaeaea',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
private function getThumbnail() {
|
|
||||||
return $this->template_image_url . '/sports.jpg';
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
1693
lib/Config/PopulatorData/Templates/KidsClothing.php
Normal file
1693
lib/Config/PopulatorData/Templates/KidsClothing.php
Normal file
File diff suppressed because it is too large
Load Diff
1217
lib/Config/PopulatorData/Templates/Minimal.php
Normal file
1217
lib/Config/PopulatorData/Templates/Minimal.php
Normal file
File diff suppressed because it is too large
Load Diff
1416
lib/Config/PopulatorData/Templates/ModularStyleStories.php
Normal file
1416
lib/Config/PopulatorData/Templates/ModularStyleStories.php
Normal file
File diff suppressed because it is too large
Load Diff
1485
lib/Config/PopulatorData/Templates/Music.php
Normal file
1485
lib/Config/PopulatorData/Templates/Music.php
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
1049
lib/Config/PopulatorData/Templates/NotSoMedium.php
Normal file
1049
lib/Config/PopulatorData/Templates/NotSoMedium.php
Normal file
File diff suppressed because it is too large
Load Diff
778
lib/Config/PopulatorData/Templates/Phone.php
Normal file
778
lib/Config/PopulatorData/Templates/Phone.php
Normal file
@ -0,0 +1,778 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace MailPoet\Config\PopulatorData\Templates;
|
||||||
|
|
||||||
|
class Phone {
|
||||||
|
|
||||||
|
private $template_image_url;
|
||||||
|
private $social_icon_url;
|
||||||
|
|
||||||
|
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';
|
||||||
|
}
|
||||||
|
|
||||||
|
function get() {
|
||||||
|
return array(
|
||||||
|
'name' => __("New Phone Purchase", 'mailpoet'),
|
||||||
|
'categories' => json_encode(array('welcome', 'sample')),
|
||||||
|
'readonly' => 1,
|
||||||
|
'thumbnail' => $this->getThumbnail(),
|
||||||
|
'body' => json_encode($this->getBody()),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getThumbnail() {
|
||||||
|
return $this->template_image_url . '/phone.jpg';
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getBody() {
|
||||||
|
return array (
|
||||||
|
'content' =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'image' =>
|
||||||
|
array (
|
||||||
|
'src' => NULL,
|
||||||
|
'display' => 'scale',
|
||||||
|
),
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'horizontal',
|
||||||
|
'image' =>
|
||||||
|
array (
|
||||||
|
'src' => NULL,
|
||||||
|
'display' => 'scale',
|
||||||
|
),
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#1b1821',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'image' =>
|
||||||
|
array (
|
||||||
|
'src' => NULL,
|
||||||
|
'display' => 'scale',
|
||||||
|
),
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'spacer',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'height' => '40px',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'type' => 'image',
|
||||||
|
'link' => '',
|
||||||
|
'src' => $this->template_image_url . '/Phone-Logo.png',
|
||||||
|
'alt' => 'Phone-Logo',
|
||||||
|
'fullWidth' => true,
|
||||||
|
'width' => '122px',
|
||||||
|
'height' => '23px',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'textAlign' => 'center',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'horizontal',
|
||||||
|
'image' =>
|
||||||
|
array (
|
||||||
|
'src' => NULL,
|
||||||
|
'display' => 'scale',
|
||||||
|
),
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#1b1821',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'image' =>
|
||||||
|
array (
|
||||||
|
'src' => NULL,
|
||||||
|
'display' => 'scale',
|
||||||
|
),
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'image',
|
||||||
|
'link' => '',
|
||||||
|
'src' => $this->template_image_url . '/Phone-Title.png',
|
||||||
|
'alt' => 'Phone-Title',
|
||||||
|
'fullWidth' => true,
|
||||||
|
'width' => '1280px',
|
||||||
|
'height' => '215px',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'textAlign' => 'center',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'type' => 'image',
|
||||||
|
'link' => '',
|
||||||
|
'src' => $this->template_image_url . '/Phone-Header.jpg',
|
||||||
|
'alt' => 'Phone-Header',
|
||||||
|
'fullWidth' => true,
|
||||||
|
'width' => '1280px',
|
||||||
|
'height' => '920px',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'textAlign' => 'center',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
2 =>
|
||||||
|
array (
|
||||||
|
'type' => 'spacer',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'height' => '30px',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
3 =>
|
||||||
|
array (
|
||||||
|
'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 =>
|
||||||
|
array (
|
||||||
|
'type' => 'button',
|
||||||
|
'text' => 'Get Started',
|
||||||
|
'url' => '',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'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 =>
|
||||||
|
array (
|
||||||
|
'type' => 'divider',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'padding' => '13px',
|
||||||
|
'borderStyle' => 'dashed',
|
||||||
|
'borderWidth' => '2px',
|
||||||
|
'borderColor' => '#2c2c2c',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
6 =>
|
||||||
|
array (
|
||||||
|
'type' => 'spacer',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'height' => '30px',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
2 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'horizontal',
|
||||||
|
'image' =>
|
||||||
|
array (
|
||||||
|
'src' => NULL,
|
||||||
|
'display' => 'scale',
|
||||||
|
),
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'image' =>
|
||||||
|
array (
|
||||||
|
'src' => NULL,
|
||||||
|
'display' => 'scale',
|
||||||
|
),
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'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 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'image' =>
|
||||||
|
array (
|
||||||
|
'src' => NULL,
|
||||||
|
'display' => 'scale',
|
||||||
|
),
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'image',
|
||||||
|
'link' => '',
|
||||||
|
'src' => $this->template_image_url . '/Phone-Logo.png',
|
||||||
|
'alt' => 'Phone-Logo',
|
||||||
|
'fullWidth' => false,
|
||||||
|
'width' => '122px',
|
||||||
|
'height' => '23px',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'textAlign' => 'center',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'type' => 'social',
|
||||||
|
'iconSet' => 'full-symbol-grey',
|
||||||
|
'icons' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'socialIcon',
|
||||||
|
'iconType' => 'facebook',
|
||||||
|
'link' => 'http://www.facebook.com',
|
||||||
|
'image' => $this->social_icon_url . '/08-full-symbol-grey/Facebook.png?mailpoet_version=3.0.0-rc.2.0.0',
|
||||||
|
'height' => '32px',
|
||||||
|
'width' => '32px',
|
||||||
|
'text' => 'Facebook',
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'type' => 'socialIcon',
|
||||||
|
'iconType' => 'twitter',
|
||||||
|
'link' => 'http://www.twitter.com',
|
||||||
|
'image' => $this->social_icon_url . '/08-full-symbol-grey/Twitter.png?mailpoet_version=3.0.0-rc.2.0.0',
|
||||||
|
'height' => '32px',
|
||||||
|
'width' => '32px',
|
||||||
|
'text' => 'Twitter',
|
||||||
|
),
|
||||||
|
2 =>
|
||||||
|
array (
|
||||||
|
'type' => 'socialIcon',
|
||||||
|
'iconType' => 'pinterest',
|
||||||
|
'link' => 'http://www.pinterest.com',
|
||||||
|
'image' => $this->social_icon_url . '/08-full-symbol-grey/Pinterest.png?mailpoet_version=3.0.0-rc.2.0.0',
|
||||||
|
'height' => '32px',
|
||||||
|
'width' => '32px',
|
||||||
|
'text' => 'Pinterest',
|
||||||
|
),
|
||||||
|
3 =>
|
||||||
|
array (
|
||||||
|
'type' => 'socialIcon',
|
||||||
|
'iconType' => 'linkedin',
|
||||||
|
'link' => 'http://www.linkedin.com',
|
||||||
|
'image' => $this->social_icon_url . '/08-full-symbol-grey/LinkedIn.png?mailpoet_version=3.0.0-rc.2.0.0',
|
||||||
|
'height' => '32px',
|
||||||
|
'width' => '32px',
|
||||||
|
'text' => 'LinkedIn',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
2 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'image' =>
|
||||||
|
array (
|
||||||
|
'src' => NULL,
|
||||||
|
'display' => 'scale',
|
||||||
|
),
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'text',
|
||||||
|
'text' => '<p style="text-align: right; font-size: 11px;"><a href="[link:subscription_unsubscribe_url]">Unsubscribe</a></p>
|
||||||
|
<p style="text-align: right; font-size: 11px;"><a href="[link:subscription_manage_url]">Manage subscription</a></p>',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'globalStyles' =>
|
||||||
|
array (
|
||||||
|
'text' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#000000',
|
||||||
|
'fontFamily' => 'Arial',
|
||||||
|
'fontSize' => '15px',
|
||||||
|
),
|
||||||
|
'h1' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#111111',
|
||||||
|
'fontFamily' => 'Arial',
|
||||||
|
'fontSize' => '30px',
|
||||||
|
),
|
||||||
|
'h2' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#222222',
|
||||||
|
'fontFamily' => 'Arial',
|
||||||
|
'fontSize' => '24px',
|
||||||
|
),
|
||||||
|
'h3' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#333333',
|
||||||
|
'fontFamily' => 'Arial',
|
||||||
|
'fontSize' => '22px',
|
||||||
|
),
|
||||||
|
'link' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#8748d5',
|
||||||
|
'textDecoration' => 'underline',
|
||||||
|
),
|
||||||
|
'wrapper' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#1b1821',
|
||||||
|
),
|
||||||
|
'body' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#1b1821',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blockDefaults' =>
|
||||||
|
array (
|
||||||
|
'automatedLatestContent' =>
|
||||||
|
array (
|
||||||
|
'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' =>
|
||||||
|
array (
|
||||||
|
'text' => 'Read more',
|
||||||
|
'url' => '[postLink]',
|
||||||
|
'context' => 'automatedLatestContent.readMoreButton',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'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' =>
|
||||||
|
array (
|
||||||
|
'context' => 'automatedLatestContent.divider',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'padding' => '13px',
|
||||||
|
'borderStyle' => 'solid',
|
||||||
|
'borderWidth' => '3px',
|
||||||
|
'borderColor' => '#aaaaaa',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'backgroundColor' => '#ffffff',
|
||||||
|
'backgroundColorAlternate' => '#eeeeee',
|
||||||
|
),
|
||||||
|
'automatedLatestContentLayout' =>
|
||||||
|
array (
|
||||||
|
'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' =>
|
||||||
|
array (
|
||||||
|
'text' => 'Read more',
|
||||||
|
'url' => '[postLink]',
|
||||||
|
'context' => 'automatedLatestContentLayout.readMoreButton',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'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' =>
|
||||||
|
array (
|
||||||
|
'context' => 'automatedLatestContentLayout.divider',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'padding' => '13px',
|
||||||
|
'borderStyle' => 'solid',
|
||||||
|
'borderWidth' => '3px',
|
||||||
|
'borderColor' => '#aaaaaa',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'backgroundColor' => '#ffffff',
|
||||||
|
'backgroundColorAlternate' => '#eeeeee',
|
||||||
|
),
|
||||||
|
'button' =>
|
||||||
|
array (
|
||||||
|
'text' => 'Button',
|
||||||
|
'url' => '',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'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' =>
|
||||||
|
array (
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'padding' => '13px',
|
||||||
|
'borderStyle' => 'solid',
|
||||||
|
'borderWidth' => '3px',
|
||||||
|
'borderColor' => '#aaaaaa',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'footer' =>
|
||||||
|
array (
|
||||||
|
'text' => '<p><a href="[link:subscription_unsubscribe_url]">Unsubscribe</a> | <a href="[link:subscription_manage_url]">Manage subscription</a><br />Add your postal address here!</p>',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
'text' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#222222',
|
||||||
|
'fontFamily' => 'Arial',
|
||||||
|
'fontSize' => '12px',
|
||||||
|
'textAlign' => 'center',
|
||||||
|
),
|
||||||
|
'link' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#6cb7d4',
|
||||||
|
'textDecoration' => 'none',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'posts' =>
|
||||||
|
array (
|
||||||
|
'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' =>
|
||||||
|
array (
|
||||||
|
'text' => 'Read more',
|
||||||
|
'url' => '[postLink]',
|
||||||
|
'context' => 'posts.readMoreButton',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'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' =>
|
||||||
|
array (
|
||||||
|
'context' => 'posts.divider',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'padding' => '13px',
|
||||||
|
'borderStyle' => 'solid',
|
||||||
|
'borderWidth' => '3px',
|
||||||
|
'borderColor' => '#aaaaaa',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'backgroundColor' => '#ffffff',
|
||||||
|
'backgroundColorAlternate' => '#eeeeee',
|
||||||
|
),
|
||||||
|
'social' =>
|
||||||
|
array (
|
||||||
|
'iconSet' => 'default',
|
||||||
|
'icons' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'socialIcon',
|
||||||
|
'iconType' => 'facebook',
|
||||||
|
'link' => 'http://www.facebook.com',
|
||||||
|
'image' => $this->social_icon_url . '/01-social/Facebook.png?mailpoet_version=3.9.1',
|
||||||
|
'height' => '32px',
|
||||||
|
'width' => '32px',
|
||||||
|
'text' => 'Facebook',
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'type' => 'socialIcon',
|
||||||
|
'iconType' => 'twitter',
|
||||||
|
'link' => 'http://www.twitter.com',
|
||||||
|
'image' => $this->social_icon_url . '/01-social/Twitter.png?mailpoet_version=3.9.1',
|
||||||
|
'height' => '32px',
|
||||||
|
'width' => '32px',
|
||||||
|
'text' => 'Twitter',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'spacer' =>
|
||||||
|
array (
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'height' => '40px',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'header' =>
|
||||||
|
array (
|
||||||
|
'text' => 'Display problems? <a href="[link:newsletter_view_in_browser_url]">Open this email in your web browser.</a>',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
'text' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#222222',
|
||||||
|
'fontFamily' => 'Arial',
|
||||||
|
'fontSize' => '12px',
|
||||||
|
'textAlign' => 'center',
|
||||||
|
),
|
||||||
|
'link' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#6cb7d4',
|
||||||
|
'textDecoration' => 'underline',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
1117
lib/Config/PopulatorData/Templates/RealEstate.php
Normal file
1117
lib/Config/PopulatorData/Templates/RealEstate.php
Normal file
File diff suppressed because it is too large
Load Diff
1334
lib/Config/PopulatorData/Templates/Retro.php
Normal file
1334
lib/Config/PopulatorData/Templates/Retro.php
Normal file
File diff suppressed because it is too large
Load Diff
662
lib/Config/PopulatorData/Templates/RetroComputingMagazine.php
Normal file
662
lib/Config/PopulatorData/Templates/RetroComputingMagazine.php
Normal file
@ -0,0 +1,662 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace MailPoet\Config\PopulatorData\Templates;
|
||||||
|
|
||||||
|
class RetroComputingMagazine {
|
||||||
|
|
||||||
|
private $template_image_url;
|
||||||
|
private $social_icon_url;
|
||||||
|
|
||||||
|
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';
|
||||||
|
}
|
||||||
|
|
||||||
|
function get() {
|
||||||
|
return array(
|
||||||
|
'name' => __("Retro Computing Magazine", 'mailpoet'),
|
||||||
|
'categories' => json_encode(array('standard', 'sample')),
|
||||||
|
'readonly' => 1,
|
||||||
|
'thumbnail' => $this->getThumbnail(),
|
||||||
|
'body' => json_encode($this->getBody()),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getThumbnail() {
|
||||||
|
return $this->template_image_url . '/retro_computing_magazine.jpg';
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getBody() {
|
||||||
|
return array (
|
||||||
|
'content' =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'horizontal',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#4473a1',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'spacer',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#008282',
|
||||||
|
'height' => '40px',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'horizontal',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#f8f8f8',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'image',
|
||||||
|
'link' => '',
|
||||||
|
'src' => $this->template_image_url . '/Windows94-Header.png',
|
||||||
|
'alt' => 'Windows94-Header',
|
||||||
|
'fullWidth' => true,
|
||||||
|
'width' => '1280px',
|
||||||
|
'height' => '740px',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'textAlign' => 'center',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
2 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'horizontal',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#ffffff',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'header',
|
||||||
|
'text' => '<p><span style="color: #ffffff;">Display problems? <a href="[link:newsletter_view_in_browser_url]" style="color: #ffffff;">Open this email in your web browser.</a></span></p>',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#008282',
|
||||||
|
),
|
||||||
|
'text' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#222222',
|
||||||
|
'fontFamily' => 'Courier New',
|
||||||
|
'fontSize' => '12px',
|
||||||
|
'textAlign' => 'left',
|
||||||
|
),
|
||||||
|
'link' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#6cb7d4',
|
||||||
|
'textDecoration' => 'underline',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'type' => 'spacer',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'height' => '30px',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
2 =>
|
||||||
|
array (
|
||||||
|
'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 =>
|
||||||
|
array (
|
||||||
|
'type' => 'divider',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'padding' => '13px',
|
||||||
|
'borderStyle' => 'ridge',
|
||||||
|
'borderWidth' => '3px',
|
||||||
|
'borderColor' => '#aaaaaa',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
4 =>
|
||||||
|
array (
|
||||||
|
'type' => 'spacer',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'height' => '20px',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
5 =>
|
||||||
|
array (
|
||||||
|
'type' => 'text',
|
||||||
|
'text' => '<h1><strong>Latest News</strong></h1>',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
3 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'horizontal',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'text',
|
||||||
|
'text' => '<h3 style="text-align: left;" data-post-id="1987"><strong>What is it like to use a Windows 98 PC in 2017?</strong></h3>',
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'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 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'text',
|
||||||
|
'text' => '<h3 style="text-align: left;" data-post-id="1938"><strong>Windows 95 still finds life online</strong></h3>',
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'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 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'text',
|
||||||
|
'text' => '<h3 style="text-align: left;" data-post-id="1997"><strong>New Sinclair ZX Spectrum Fully Funded</strong></h3>',
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'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 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'horizontal',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'spacer',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'height' => '35px',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'type' => 'spacer',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#008282',
|
||||||
|
'height' => '50px',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
5 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'horizontal',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#008282',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'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 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'image',
|
||||||
|
'link' => '',
|
||||||
|
'src' => $this->template_image_url . '/Windows94-Today.png',
|
||||||
|
'alt' => 'Windows94-Today',
|
||||||
|
'fullWidth' => false,
|
||||||
|
'width' => '364px',
|
||||||
|
'height' => '291px',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'textAlign' => 'center',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
6 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'horizontal',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'spacer',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#008282',
|
||||||
|
'height' => '20px',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
7 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'horizontal',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#f8f8f8',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'spacer',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'height' => '20px',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'type' => 'text',
|
||||||
|
'text' => '<p style="text-align: center;"><strong>Let\'s get social!</strong></p>',
|
||||||
|
),
|
||||||
|
2 =>
|
||||||
|
array (
|
||||||
|
'type' => 'social',
|
||||||
|
'iconSet' => 'grey',
|
||||||
|
'icons' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'socialIcon',
|
||||||
|
'iconType' => 'facebook',
|
||||||
|
'link' => 'http://www.facebook.com',
|
||||||
|
'image' => $this->social_icon_url . '/02-grey/Facebook.png?mailpoet_version=3.0.0-rc.1.0.4',
|
||||||
|
'height' => '32px',
|
||||||
|
'width' => '32px',
|
||||||
|
'text' => 'Facebook',
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'type' => 'socialIcon',
|
||||||
|
'iconType' => 'twitter',
|
||||||
|
'link' => 'http://www.twitter.com',
|
||||||
|
'image' => $this->social_icon_url . '/02-grey/Twitter.png?mailpoet_version=3.0.0-rc.1.0.4',
|
||||||
|
'height' => '32px',
|
||||||
|
'width' => '32px',
|
||||||
|
'text' => 'Twitter',
|
||||||
|
),
|
||||||
|
2 =>
|
||||||
|
array (
|
||||||
|
'type' => 'socialIcon',
|
||||||
|
'iconType' => 'youtube',
|
||||||
|
'link' => 'http://www.youtube.com',
|
||||||
|
'image' => $this->social_icon_url . '/02-grey/Youtube.png?mailpoet_version=3.0.0-rc.1.0.4',
|
||||||
|
'height' => '32px',
|
||||||
|
'width' => '32px',
|
||||||
|
'text' => 'Youtube',
|
||||||
|
),
|
||||||
|
3 =>
|
||||||
|
array (
|
||||||
|
'type' => 'socialIcon',
|
||||||
|
'iconType' => 'email',
|
||||||
|
'link' => '',
|
||||||
|
'image' => $this->social_icon_url . '/02-grey/Email.png?mailpoet_version=3.0.0-rc.1.0.4',
|
||||||
|
'height' => '32px',
|
||||||
|
'width' => '32px',
|
||||||
|
'text' => 'Email',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
3 =>
|
||||||
|
array (
|
||||||
|
'type' => 'footer',
|
||||||
|
'text' => '<p><a href="[link:subscription_unsubscribe_url]">Unsubscribe</a> | <a href="[link:subscription_manage_url]">Manage your subscription</a><br />Add your postal address here!</p>',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
'text' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#222222',
|
||||||
|
'fontFamily' => 'Courier New',
|
||||||
|
'fontSize' => '12px',
|
||||||
|
'textAlign' => 'center',
|
||||||
|
),
|
||||||
|
'link' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#008282',
|
||||||
|
'textDecoration' => 'none',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'globalStyles' =>
|
||||||
|
array (
|
||||||
|
'text' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#000000',
|
||||||
|
'fontFamily' => 'Courier New',
|
||||||
|
'fontSize' => '14px',
|
||||||
|
),
|
||||||
|
'h1' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#111111',
|
||||||
|
'fontFamily' => 'Courier New',
|
||||||
|
'fontSize' => '30px',
|
||||||
|
),
|
||||||
|
'h2' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#222222',
|
||||||
|
'fontFamily' => 'Courier New',
|
||||||
|
'fontSize' => '24px',
|
||||||
|
),
|
||||||
|
'h3' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#333333',
|
||||||
|
'fontFamily' => 'Courier New',
|
||||||
|
'fontSize' => '18px',
|
||||||
|
),
|
||||||
|
'link' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#008282',
|
||||||
|
'textDecoration' => 'underline',
|
||||||
|
),
|
||||||
|
'wrapper' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#ffffff',
|
||||||
|
),
|
||||||
|
'body' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#008282',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
700
lib/Config/PopulatorData/Templates/RssSimpleNews.php
Normal file
700
lib/Config/PopulatorData/Templates/RssSimpleNews.php
Normal file
@ -0,0 +1,700 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace MailPoet\Config\PopulatorData\Templates;
|
||||||
|
|
||||||
|
class RssSimpleNews {
|
||||||
|
|
||||||
|
private $template_image_url;
|
||||||
|
private $social_icon_url;
|
||||||
|
|
||||||
|
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';
|
||||||
|
}
|
||||||
|
|
||||||
|
function get() {
|
||||||
|
return array(
|
||||||
|
'name' => __("Stripped RSS Style Layout", 'mailpoet'),
|
||||||
|
'categories' => json_encode(array('notification', 'sample')),
|
||||||
|
'readonly' => 1,
|
||||||
|
'thumbnail' => $this->getThumbnail(),
|
||||||
|
'body' => json_encode($this->getBody()),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getThumbnail() {
|
||||||
|
return $this->template_image_url . '/rss-simple-news.jpg';
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getBody() {
|
||||||
|
return array (
|
||||||
|
'content' =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'horizontal',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#f4f4f4',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'spacer',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'height' => '25px',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'horizontal',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'image',
|
||||||
|
'link' => '',
|
||||||
|
'src' => $this->template_image_url . '/RSS-Logo-2.png',
|
||||||
|
'alt' => 'RSS-Logo-2',
|
||||||
|
'fullWidth' => true,
|
||||||
|
'width' => '210px',
|
||||||
|
'height' => '90px',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'textAlign' => 'center',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'spacer',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'height' => '20px',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
2 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'spacer',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'height' => '24px',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'type' => 'social',
|
||||||
|
'iconSet' => 'full-symbol-color',
|
||||||
|
'icons' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'socialIcon',
|
||||||
|
'iconType' => 'facebook',
|
||||||
|
'link' => 'http://www.facebook.com',
|
||||||
|
'image' => $this->social_icon_url . '/06-full-symbol-color/Facebook.png?mailpoet_version=3.0.0-rc.2.0.0',
|
||||||
|
'height' => '32px',
|
||||||
|
'width' => '32px',
|
||||||
|
'text' => 'Facebook',
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'type' => 'socialIcon',
|
||||||
|
'iconType' => 'twitter',
|
||||||
|
'link' => 'http://www.twitter.com',
|
||||||
|
'image' => $this->social_icon_url . '/06-full-symbol-color/Twitter.png?mailpoet_version=3.0.0-rc.2.0.0',
|
||||||
|
'height' => '32px',
|
||||||
|
'width' => '32px',
|
||||||
|
'text' => 'Twitter',
|
||||||
|
),
|
||||||
|
2 =>
|
||||||
|
array (
|
||||||
|
'type' => 'socialIcon',
|
||||||
|
'iconType' => 'website',
|
||||||
|
'link' => '',
|
||||||
|
'image' => $this->social_icon_url . '/06-full-symbol-color/Website.png?mailpoet_version=3.0.0-rc.2.0.0',
|
||||||
|
'height' => '32px',
|
||||||
|
'width' => '32px',
|
||||||
|
'text' => 'Website',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
2 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'horizontal',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#ffffff',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'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 =>
|
||||||
|
array (
|
||||||
|
'type' => 'spacer',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'height' => '20px',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
2 =>
|
||||||
|
array (
|
||||||
|
'type' => 'automatedLatestContent',
|
||||||
|
'amount' => '3',
|
||||||
|
'contentType' => 'post',
|
||||||
|
'terms' =>
|
||||||
|
array (
|
||||||
|
),
|
||||||
|
'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' =>
|
||||||
|
array (
|
||||||
|
'type' => 'button',
|
||||||
|
'text' => 'Read more',
|
||||||
|
'url' => '[postLink]',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'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' => 'automatedLatestContent.readMoreButton',
|
||||||
|
),
|
||||||
|
'sortBy' => 'newest',
|
||||||
|
'showDivider' => true,
|
||||||
|
'divider' =>
|
||||||
|
array (
|
||||||
|
'type' => 'divider',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'padding' => '13px',
|
||||||
|
'borderStyle' => 'solid',
|
||||||
|
'borderWidth' => '1px',
|
||||||
|
'borderColor' => '#efe7f0',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'context' => 'automatedLatestContent.divider',
|
||||||
|
),
|
||||||
|
'backgroundColor' => '#ffffff',
|
||||||
|
'backgroundColorAlternate' => '#eeeeee',
|
||||||
|
),
|
||||||
|
3 =>
|
||||||
|
array (
|
||||||
|
'type' => 'spacer',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'height' => '20px',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
3 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'horizontal',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#f4f4f4',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'spacer',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'height' => '30px',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'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</a><span> | </span><a href="[link:subscription_manage_url]">Manage subscription</a></strong></span></p>
|
||||||
|
<p><span style="color: #808080; font-size: 11px;"><strong><span>Add your postal address here!</span></strong></span></p>',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'globalStyles' =>
|
||||||
|
array (
|
||||||
|
'text' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#000000',
|
||||||
|
'fontFamily' => 'Arial',
|
||||||
|
'fontSize' => '15px',
|
||||||
|
),
|
||||||
|
'h1' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#111111',
|
||||||
|
'fontFamily' => 'Arial',
|
||||||
|
'fontSize' => '30px',
|
||||||
|
),
|
||||||
|
'h2' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#222222',
|
||||||
|
'fontFamily' => 'Arial',
|
||||||
|
'fontSize' => '24px',
|
||||||
|
),
|
||||||
|
'h3' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#3478f5',
|
||||||
|
'fontFamily' => 'Arial',
|
||||||
|
'fontSize' => '20px',
|
||||||
|
),
|
||||||
|
'link' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#3478f5',
|
||||||
|
'textDecoration' => 'none',
|
||||||
|
),
|
||||||
|
'wrapper' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#ffffff',
|
||||||
|
),
|
||||||
|
'body' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#f4f4f4',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blockDefaults' =>
|
||||||
|
array (
|
||||||
|
'automatedLatestContent' =>
|
||||||
|
array (
|
||||||
|
'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' =>
|
||||||
|
array (
|
||||||
|
'text' => 'Read more',
|
||||||
|
'url' => '[postLink]',
|
||||||
|
'context' => 'automatedLatestContent.readMoreButton',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'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' =>
|
||||||
|
array (
|
||||||
|
'context' => 'automatedLatestContent.divider',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'padding' => '13px',
|
||||||
|
'borderStyle' => 'solid',
|
||||||
|
'borderWidth' => '1px',
|
||||||
|
'borderColor' => '#efe7f0',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'type' => 'divider',
|
||||||
|
),
|
||||||
|
'backgroundColor' => '#ffffff',
|
||||||
|
'backgroundColorAlternate' => '#eeeeee',
|
||||||
|
'type' => 'automatedLatestContent',
|
||||||
|
'terms' =>
|
||||||
|
array (
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'button' =>
|
||||||
|
array (
|
||||||
|
'text' => 'Read more',
|
||||||
|
'url' => '[postLink]',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'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',
|
||||||
|
),
|
||||||
|
'divider' =>
|
||||||
|
array (
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'padding' => '13px',
|
||||||
|
'borderStyle' => 'solid',
|
||||||
|
'borderWidth' => '3px',
|
||||||
|
'borderColor' => '#aaaaaa',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'footer' =>
|
||||||
|
array (
|
||||||
|
'text' => '<p><a href="[link:subscription_unsubscribe_url]">Unsubscribe</a> | <a href="[link:subscription_manage_url]">Manage subscription</a><br />Add your postal address here!</p>',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
'text' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#222222',
|
||||||
|
'fontFamily' => 'Arial',
|
||||||
|
'fontSize' => '12px',
|
||||||
|
'textAlign' => 'center',
|
||||||
|
),
|
||||||
|
'link' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#6cb7d4',
|
||||||
|
'textDecoration' => 'none',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'posts' =>
|
||||||
|
array (
|
||||||
|
'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' =>
|
||||||
|
array (
|
||||||
|
'text' => 'Read more',
|
||||||
|
'url' => '[postLink]',
|
||||||
|
'context' => 'posts.readMoreButton',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'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' =>
|
||||||
|
array (
|
||||||
|
'context' => 'posts.divider',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'padding' => '13px',
|
||||||
|
'borderStyle' => 'solid',
|
||||||
|
'borderWidth' => '3px',
|
||||||
|
'borderColor' => '#aaaaaa',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'backgroundColor' => '#ffffff',
|
||||||
|
'backgroundColorAlternate' => '#eeeeee',
|
||||||
|
),
|
||||||
|
'social' =>
|
||||||
|
array (
|
||||||
|
'iconSet' => 'default',
|
||||||
|
'icons' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'socialIcon',
|
||||||
|
'iconType' => 'facebook',
|
||||||
|
'link' => 'http://www.facebook.com',
|
||||||
|
'image' => $this->social_icon_url . '/01-social/Facebook.png?mailpoet_version=3.7.1',
|
||||||
|
'height' => '32px',
|
||||||
|
'width' => '32px',
|
||||||
|
'text' => 'Facebook',
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'type' => 'socialIcon',
|
||||||
|
'iconType' => 'twitter',
|
||||||
|
'link' => 'http://www.twitter.com',
|
||||||
|
'image' => $this->social_icon_url . '/01-social/Twitter.png?mailpoet_version=3.7.1',
|
||||||
|
'height' => '32px',
|
||||||
|
'width' => '32px',
|
||||||
|
'text' => 'Twitter',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'spacer' =>
|
||||||
|
array (
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'height' => '40px',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'header' =>
|
||||||
|
array (
|
||||||
|
'text' => 'Display problems? <a href="[link:newsletter_view_in_browser_url]">Open this email in your web browser.</a>',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
'text' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#222222',
|
||||||
|
'fontFamily' => 'Arial',
|
||||||
|
'fontSize' => '12px',
|
||||||
|
'textAlign' => 'center',
|
||||||
|
),
|
||||||
|
'link' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#6cb7d4',
|
||||||
|
'textDecoration' => 'underline',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
712
lib/Config/PopulatorData/Templates/Sunglasses.php
Normal file
712
lib/Config/PopulatorData/Templates/Sunglasses.php
Normal file
@ -0,0 +1,712 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace MailPoet\Config\PopulatorData\Templates;
|
||||||
|
|
||||||
|
|
||||||
|
class Sunglasses {
|
||||||
|
|
||||||
|
private $template_image_url;
|
||||||
|
private $social_icon_url;
|
||||||
|
|
||||||
|
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';
|
||||||
|
}
|
||||||
|
|
||||||
|
function get() {
|
||||||
|
return array(
|
||||||
|
'name' => __("Sunglasses", 'mailpoet'),
|
||||||
|
'categories' => json_encode(array('welcome', 'sample')),
|
||||||
|
'readonly' => 1,
|
||||||
|
'thumbnail' => $this->getThumbnail(),
|
||||||
|
'body' => json_encode($this->getBody()),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getThumbnail() {
|
||||||
|
return $this->template_image_url . '/sunglasses.jpg';
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getBody() {
|
||||||
|
return array (
|
||||||
|
'content' =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'horizontal',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'spacer',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'height' => '30px',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'type' => 'image',
|
||||||
|
'link' => '',
|
||||||
|
'src' => $this->template_image_url . '/Glasses-Logo.jpg',
|
||||||
|
'alt' => 'Glasses-Logo',
|
||||||
|
'fullWidth' => false,
|
||||||
|
'width' => '250px',
|
||||||
|
'height' => '66px',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'textAlign' => 'center',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
2 =>
|
||||||
|
array (
|
||||||
|
'type' => 'divider',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#ffffff',
|
||||||
|
'padding' => '17px',
|
||||||
|
'borderStyle' => 'solid',
|
||||||
|
'borderWidth' => '2px',
|
||||||
|
'borderColor' => '#f8b849',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
3 =>
|
||||||
|
array (
|
||||||
|
'type' => 'spacer',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'height' => '30px',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
4 =>
|
||||||
|
array (
|
||||||
|
'type' => 'image',
|
||||||
|
'link' => '',
|
||||||
|
'src' => $this->template_image_url . '/Glasses-Header-2.jpg',
|
||||||
|
'alt' => 'Glasses-Header-2',
|
||||||
|
'fullWidth' => true,
|
||||||
|
'width' => '1280px',
|
||||||
|
'height' => '116px',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'textAlign' => 'center',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
5 =>
|
||||||
|
array (
|
||||||
|
'type' => 'spacer',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'height' => '30px',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'horizontal',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'text',
|
||||||
|
'text' => '<h3 style="text-align: center;"><span style="color: #333333;"><strong>Here\'s what we sent you</strong></span></h3>',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
2 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'horizontal',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'image',
|
||||||
|
'link' => '',
|
||||||
|
'src' => $this->template_image_url . '/Glasses-Images-1.jpg',
|
||||||
|
'alt' => 'Glasses-Images-1',
|
||||||
|
'fullWidth' => true,
|
||||||
|
'width' => '1280px',
|
||||||
|
'height' => '650px',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'textAlign' => 'center',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'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 =>
|
||||||
|
array (
|
||||||
|
'type' => 'button',
|
||||||
|
'text' => 'Choose These Frames',
|
||||||
|
'url' => '',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'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 =>
|
||||||
|
array (
|
||||||
|
'type' => 'image',
|
||||||
|
'link' => '',
|
||||||
|
'src' => $this->template_image_url . '/Glasses-Images-2.jpg',
|
||||||
|
'alt' => 'Glasses-Images-2',
|
||||||
|
'fullWidth' => true,
|
||||||
|
'width' => '1280px',
|
||||||
|
'height' => '650px',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'textAlign' => 'center',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
4 =>
|
||||||
|
array (
|
||||||
|
'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 =>
|
||||||
|
array (
|
||||||
|
'type' => 'button',
|
||||||
|
'text' => 'Choose These Frames',
|
||||||
|
'url' => '',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'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 =>
|
||||||
|
array (
|
||||||
|
'type' => 'image',
|
||||||
|
'link' => '',
|
||||||
|
'src' => $this->template_image_url . '/Glasses-Images-3.jpg',
|
||||||
|
'alt' => 'Glasses-Images-3',
|
||||||
|
'fullWidth' => true,
|
||||||
|
'width' => '1280px',
|
||||||
|
'height' => '650px',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'textAlign' => 'center',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
7 =>
|
||||||
|
array (
|
||||||
|
'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 =>
|
||||||
|
array (
|
||||||
|
'type' => 'button',
|
||||||
|
'text' => 'Choose These Frames',
|
||||||
|
'url' => '',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'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 =>
|
||||||
|
array (
|
||||||
|
'type' => 'divider',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#ffffff',
|
||||||
|
'padding' => '34.5px',
|
||||||
|
'borderStyle' => 'solid',
|
||||||
|
'borderWidth' => '2px',
|
||||||
|
'borderColor' => '#f8b849',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
3 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'horizontal',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'image',
|
||||||
|
'link' => '',
|
||||||
|
'src' => $this->template_image_url . '/Glasses-Header.jpg',
|
||||||
|
'alt' => 'Glasses-Header',
|
||||||
|
'fullWidth' => true,
|
||||||
|
'width' => '640px',
|
||||||
|
'height' => '920px',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'textAlign' => 'center',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'spacer',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'height' => '60px',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'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 =>
|
||||||
|
array (
|
||||||
|
'type' => 'button',
|
||||||
|
'text' => 'Find Out More',
|
||||||
|
'url' => '',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'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 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'horizontal',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#ffffff',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'divider',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#ffffff',
|
||||||
|
'padding' => '34.5px',
|
||||||
|
'borderStyle' => 'solid',
|
||||||
|
'borderWidth' => '2px',
|
||||||
|
'borderColor' => '#f8b849',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
5 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'horizontal',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'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 =>
|
||||||
|
array (
|
||||||
|
'type' => 'divider',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#ffffff',
|
||||||
|
'padding' => '23.5px',
|
||||||
|
'borderStyle' => 'solid',
|
||||||
|
'borderWidth' => '2px',
|
||||||
|
'borderColor' => '#f8b849',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
6 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'horizontal',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#ffffff',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'social',
|
||||||
|
'iconSet' => 'full-symbol-black',
|
||||||
|
'icons' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'socialIcon',
|
||||||
|
'iconType' => 'facebook',
|
||||||
|
'link' => 'http://www.facebook.com',
|
||||||
|
'image' => $this->social_icon_url . '/07-full-symbol-black/Facebook.png?mailpoet_version=3.0.0-rc.2.0.0',
|
||||||
|
'height' => '32px',
|
||||||
|
'width' => '32px',
|
||||||
|
'text' => 'Facebook',
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'type' => 'socialIcon',
|
||||||
|
'iconType' => 'twitter',
|
||||||
|
'link' => 'http://www.twitter.com',
|
||||||
|
'image' => $this->social_icon_url . '/07-full-symbol-black/Twitter.png?mailpoet_version=3.0.0-rc.2.0.0',
|
||||||
|
'height' => '32px',
|
||||||
|
'width' => '32px',
|
||||||
|
'text' => 'Twitter',
|
||||||
|
),
|
||||||
|
2 =>
|
||||||
|
array (
|
||||||
|
'type' => 'socialIcon',
|
||||||
|
'iconType' => 'instagram',
|
||||||
|
'link' => 'http://instagram.com',
|
||||||
|
'image' => $this->social_icon_url . '/07-full-symbol-black/Instagram.png?mailpoet_version=3.0.0-rc.2.0.0',
|
||||||
|
'height' => '32px',
|
||||||
|
'width' => '32px',
|
||||||
|
'text' => 'Instagram',
|
||||||
|
),
|
||||||
|
3 =>
|
||||||
|
array (
|
||||||
|
'type' => 'socialIcon',
|
||||||
|
'iconType' => 'email',
|
||||||
|
'link' => '',
|
||||||
|
'image' => $this->social_icon_url . '/07-full-symbol-black/Email.png?mailpoet_version=3.0.0-rc.2.0.0',
|
||||||
|
'height' => '32px',
|
||||||
|
'width' => '32px',
|
||||||
|
'text' => 'Email',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'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</a> | <a href="[link:subscription_manage_url]" style="color: #808080;">Manage your subscription</a></span></strong><br /><span style="color: #808080;">Add your postal address here!</span></p>',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'globalStyles' =>
|
||||||
|
array (
|
||||||
|
'text' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#000000',
|
||||||
|
'fontFamily' => 'Arial',
|
||||||
|
'fontSize' => '15px',
|
||||||
|
),
|
||||||
|
'h1' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#111111',
|
||||||
|
'fontFamily' => 'Arial',
|
||||||
|
'fontSize' => '30px',
|
||||||
|
),
|
||||||
|
'h2' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#222222',
|
||||||
|
'fontFamily' => 'Arial',
|
||||||
|
'fontSize' => '24px',
|
||||||
|
),
|
||||||
|
'h3' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#333333',
|
||||||
|
'fontFamily' => 'Arial',
|
||||||
|
'fontSize' => '22px',
|
||||||
|
),
|
||||||
|
'link' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#21759B',
|
||||||
|
'textDecoration' => 'underline',
|
||||||
|
),
|
||||||
|
'wrapper' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#ffffff',
|
||||||
|
),
|
||||||
|
'body' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#ffffff',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -1,603 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace MailPoet\Config\PopulatorData\Templates;
|
|
||||||
|
|
||||||
class TravelNomads {
|
|
||||||
|
|
||||||
private $template_image_url;
|
|
||||||
private $social_icon_url;
|
|
||||||
|
|
||||||
function __construct($assets_url) {
|
|
||||||
$this->template_image_url = 'https://ps.w.org/mailpoet/assets/newsletter-templates/travel_nomads';
|
|
||||||
$this->social_icon_url = $assets_url . '/img/newsletter_editor/social-icons';
|
|
||||||
}
|
|
||||||
|
|
||||||
function get() {
|
|
||||||
return array(
|
|
||||||
'name' => __("Travel Nomads", 'mailpoet'),
|
|
||||||
'categories' => json_encode(array('standard', 'sample')),
|
|
||||||
'readonly' => 1,
|
|
||||||
'thumbnail' => $this->getThumbnail(),
|
|
||||||
'body' => json_encode($this->getBody()),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
private function getBody() {
|
|
||||||
return array(
|
|
||||||
'content' => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'horizontal',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'image',
|
|
||||||
'link' => 'http://example.org',
|
|
||||||
'src' => $this->template_image_url . '/header-1.png',
|
|
||||||
'alt' => 'Travelling Tales with Jane & Steven',
|
|
||||||
'fullWidth' => true,
|
|
||||||
'width' => '660px',
|
|
||||||
'height' => '165px',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '30px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
2 => array(
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => '<h1 style="text-align: center;">Hi [subscriber:firstname | default:reader]!</h1>
|
|
||||||
<p></p>
|
|
||||||
<p>Donec viverra arcu nec elit congue pellentesque. In ac dictum magna. Morbi sit amet accumsan augue. Cras cursus viverra nulla non tempus. Curabitur sed neque vel sapien feugiat mattis. Morbi ullamcorper tellus diam, sed rutrum nisi faucibus at.</p>',
|
|
||||||
),
|
|
||||||
3 => array(
|
|
||||||
'type' => 'social',
|
|
||||||
'iconSet' => 'circles',
|
|
||||||
'icons' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'socialIcon',
|
|
||||||
'iconType' => 'twitter',
|
|
||||||
'link' => 'http://example.com',
|
|
||||||
'image' => $this->social_icon_url . '/03-circles/Twitter.png',
|
|
||||||
'height' => '32px',
|
|
||||||
'width' => '32px',
|
|
||||||
'text' => 'Twitter',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
4 => array(
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => '<h1 style="text-align: center;"><strong>Photos from Rotarua</strong></h1>',
|
|
||||||
),
|
|
||||||
5 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '20px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'horizontal',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'image',
|
|
||||||
'link' => 'http://example.org',
|
|
||||||
'src' => $this->template_image_url . '/hot-thermals-1.jpg',
|
|
||||||
'alt' => 'hot thermals',
|
|
||||||
'fullWidth' => false,
|
|
||||||
'width' => '640px',
|
|
||||||
'height' => '425px',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '40px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'image',
|
|
||||||
'link' => 'http://example.org',
|
|
||||||
'src' => $this->template_image_url . '/5398660557_e5e338357e_z.jpg',
|
|
||||||
'alt' => 'The view from our campsite',
|
|
||||||
'fullWidth' => false,
|
|
||||||
'width' => '640px',
|
|
||||||
'height' => '425px',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '40px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
2 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'horizontal',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'image',
|
|
||||||
'link' => 'http://example.org',
|
|
||||||
'src' => $this->template_image_url . '/5399212952_b3fea8fffb_z.jpg',
|
|
||||||
'alt' => 'Red sky at night',
|
|
||||||
'fullWidth' => false,
|
|
||||||
'width' => '640px',
|
|
||||||
'height' => '425px',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'image',
|
|
||||||
'link' => 'http://example.org',
|
|
||||||
'src' => $this->template_image_url . '/5399283298_0d2cd66e9f_z.jpg',
|
|
||||||
'alt' => 'Don\'t go chasing waterfalls',
|
|
||||||
'fullWidth' => false,
|
|
||||||
'width' => '640px',
|
|
||||||
'height' => '425px',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
3 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'horizontal',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '20px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'button',
|
|
||||||
'text' => 'View NZ Photo Gallery',
|
|
||||||
'url' => 'http://example.org',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => '#f16161',
|
|
||||||
'borderColor' => '#ffffff',
|
|
||||||
'borderWidth' => '3px',
|
|
||||||
'borderRadius' => '5px',
|
|
||||||
'borderStyle' => 'solid',
|
|
||||||
'width' => '288px',
|
|
||||||
'lineHeight' => '48px',
|
|
||||||
'fontColor' => '#ffffff',
|
|
||||||
'fontFamily' => 'Verdana',
|
|
||||||
'fontSize' => '18px',
|
|
||||||
'fontWeight' => 'normal',
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
4 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'horizontal',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'divider',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'padding' => '23px',
|
|
||||||
'borderStyle' => 'double',
|
|
||||||
'borderWidth' => '3px',
|
|
||||||
'borderColor' => '#aaaaaa',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => '<h2><em>Here\'s our top recommendations in Rotarua</em></h2>',
|
|
||||||
),
|
|
||||||
2 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '20px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
5 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'horizontal',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'image',
|
|
||||||
'link' => 'http://example.org',
|
|
||||||
'src' => $this->template_image_url . '/glow-worms.jpg',
|
|
||||||
'alt' => 'Glow worms, Waitomo Caves',
|
|
||||||
'fullWidth' => true,
|
|
||||||
'width' => '640px',
|
|
||||||
'height' => '428px',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => '<p><em><a href="http://www.waitomo.com/Waitomo-Glowworm-Caves/Pages/default.aspx"><strong>Waitomo Glow Worm Caves</strong></a></em></p>',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'image',
|
|
||||||
'link' => 'http://example.org',
|
|
||||||
'src' => $this->template_image_url . '/luge.jpg',
|
|
||||||
'alt' => 'luge',
|
|
||||||
'fullWidth' => false,
|
|
||||||
'width' => '375px',
|
|
||||||
'height' => '500px',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => '<p><em><strong><a href="http://www.skyline.co.nz/rotorua/ssr_luge/">Luge!</a></strong></em></p>',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
2 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'image',
|
|
||||||
'link' => 'http://example.org',
|
|
||||||
'src' => $this->template_image_url . '/holiday-park.jpg',
|
|
||||||
'alt' => 'holiday-park',
|
|
||||||
'fullWidth' => true,
|
|
||||||
'width' => '640px',
|
|
||||||
'height' => '425px',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => '<p><em><strong><a href="http://rotoruathermal.co.nz/">Roturua Thermal Holiday Park</a></strong></em></p>',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
6 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'horizontal',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'spacer',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'height' => '21px',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => '<p>Morbi ex diam, venenatis a efficitur et, iaculis at nibh. Ut rhoncus, lacus vel fermentum aliquam, mi arcu pharetra metus, quis ullamcorper tortor ligula in diam. Fusce mi elit, finibus at lectus non, pulvinar fringilla risus. Integer porta vel quam et fringilla.</p>
|
|
||||||
<p></p>
|
|
||||||
<p>Morbi sit amet,</p>
|
|
||||||
<p>Jane & Steven</p>',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
7 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'horizontal',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'container',
|
|
||||||
'orientation' => 'vertical',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'blocks' => array(
|
|
||||||
0 => array(
|
|
||||||
'type' => 'divider',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'padding' => '13px',
|
|
||||||
'borderStyle' => 'dotted',
|
|
||||||
'borderWidth' => '2px',
|
|
||||||
'borderColor' => '#aaaaaa',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
1 => array(
|
|
||||||
'type' => 'header',
|
|
||||||
'text' => 'Display problems? <a href="[link:newsletter_view_in_browser_url]">Open this email in your web browser</a>',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
'text' => array(
|
|
||||||
'fontColor' => '#222222',
|
|
||||||
'fontFamily' => 'Courier New',
|
|
||||||
'fontSize' => '12px',
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
'link' => array(
|
|
||||||
'fontColor' => '#343434',
|
|
||||||
'textDecoration' => 'underline',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
2 => array(
|
|
||||||
'type' => 'footer',
|
|
||||||
'text' => '<p><a href="[link:subscription_unsubscribe_url]">Unsubscribe</a> | <a href="[link:subscription_manage_url]">Manage subscription</a></p>',
|
|
||||||
'styles' => array(
|
|
||||||
'block' => array(
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
),
|
|
||||||
'text' => array(
|
|
||||||
'fontColor' => '#343434',
|
|
||||||
'fontFamily' => 'Courier New',
|
|
||||||
'fontSize' => '12px',
|
|
||||||
'textAlign' => 'center',
|
|
||||||
),
|
|
||||||
'link' => array(
|
|
||||||
'fontColor' => '#343434',
|
|
||||||
'textDecoration' => 'underline',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'globalStyles' => array(
|
|
||||||
'text' => array(
|
|
||||||
'fontColor' => '#343434',
|
|
||||||
'fontFamily' => 'Courier New',
|
|
||||||
'fontSize' => '16px',
|
|
||||||
),
|
|
||||||
'h1' => array(
|
|
||||||
'fontColor' => '#180d6b',
|
|
||||||
'fontFamily' => 'Trebuchet MS',
|
|
||||||
'fontSize' => '26px',
|
|
||||||
),
|
|
||||||
'h2' => array(
|
|
||||||
'fontColor' => '#180d6b',
|
|
||||||
'fontFamily' => 'Trebuchet MS',
|
|
||||||
'fontSize' => '22px',
|
|
||||||
),
|
|
||||||
'h3' => array(
|
|
||||||
'fontColor' => '#343434',
|
|
||||||
'fontFamily' => 'Trebuchet MS',
|
|
||||||
'fontSize' => '18px',
|
|
||||||
),
|
|
||||||
'link' => array(
|
|
||||||
'fontColor' => '#f16161',
|
|
||||||
'textDecoration' => 'underline',
|
|
||||||
),
|
|
||||||
'wrapper' => array(
|
|
||||||
'backgroundColor' => '#daf3ff',
|
|
||||||
),
|
|
||||||
'body' => array(
|
|
||||||
'backgroundColor' => '#ffffff',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
private function getThumbnail() {
|
|
||||||
return $this->template_image_url . '/travel-nomads.jpg';
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
677
lib/Config/PopulatorData/Templates/WideStoryLayout.php
Normal file
677
lib/Config/PopulatorData/Templates/WideStoryLayout.php
Normal file
@ -0,0 +1,677 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace MailPoet\Config\PopulatorData\Templates;
|
||||||
|
|
||||||
|
class WideStoryLayout {
|
||||||
|
|
||||||
|
private $template_image_url;
|
||||||
|
private $social_icon_url;
|
||||||
|
|
||||||
|
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';
|
||||||
|
}
|
||||||
|
|
||||||
|
function get() {
|
||||||
|
return array(
|
||||||
|
'name' => __("Wide Story Layout", 'mailpoet'),
|
||||||
|
'categories' => json_encode(array('notification', 'sample')),
|
||||||
|
'readonly' => 1,
|
||||||
|
'thumbnail' => $this->getThumbnail(),
|
||||||
|
'body' => json_encode($this->getBody()),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getThumbnail() {
|
||||||
|
return $this->template_image_url . '/wide-story-layout.jpg';
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getBody() {
|
||||||
|
return array (
|
||||||
|
'content' =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'horizontal',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#f0f0f0',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'spacer',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'height' => '50px',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'type' => 'image',
|
||||||
|
'link' => '',
|
||||||
|
'src' => $this->template_image_url . '/Wide-Logo.png',
|
||||||
|
'alt' => 'Wide-Logo',
|
||||||
|
'fullWidth' => false,
|
||||||
|
'width' => '200px',
|
||||||
|
'height' => '37px',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'textAlign' => 'center',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
2 =>
|
||||||
|
array (
|
||||||
|
'type' => 'text',
|
||||||
|
'text' => '<h3 style="text-align: center;"><span style="color: #808080;">Our Latest Posts</span></h3>',
|
||||||
|
),
|
||||||
|
3 =>
|
||||||
|
array (
|
||||||
|
'type' => 'spacer',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'height' => '20px',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'horizontal',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'image',
|
||||||
|
'link' => 'http://mailpoet.info/cutting-through-the-smog-what-to-do-to-fight-air-pollution/',
|
||||||
|
'src' => $this->template_image_url . '/5_what_to_do_p352m1141746-800x533.jpg',
|
||||||
|
'alt' => 'Cutting through the smog: What to do to fight air pollution',
|
||||||
|
'fullWidth' => true,
|
||||||
|
'width' => 660,
|
||||||
|
'height' => 440,
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'textAlign' => 'center',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'type' => 'spacer',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'height' => '30px',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
2 =>
|
||||||
|
array (
|
||||||
|
'type' => 'text',
|
||||||
|
'text' => '<h3 style="text-align: center;" data-post-id="1997">Cutting through the smog: What to do to fight air pollution</h3>
|
||||||
|
<p class="mailpoet_wp_post" style="text-align: center;">Tackling our air problems starts with traffic control, but individual action to reduce energy use and intensive farming would also help clean our air.</p>',
|
||||||
|
),
|
||||||
|
3 =>
|
||||||
|
array (
|
||||||
|
'type' => 'button',
|
||||||
|
'text' => 'Read The Post',
|
||||||
|
'url' => 'http://mailpoet.info/cutting-through-the-smog-what-to-do-to-fight-air-pollution/',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#5ecd39',
|
||||||
|
'borderColor' => '#000000',
|
||||||
|
'borderWidth' => '0px',
|
||||||
|
'borderRadius' => '5px',
|
||||||
|
'borderStyle' => 'solid',
|
||||||
|
'width' => '288px',
|
||||||
|
'lineHeight' => '36px',
|
||||||
|
'fontColor' => '#ffffff',
|
||||||
|
'fontFamily' => 'Lucida',
|
||||||
|
'fontSize' => '16px',
|
||||||
|
'fontWeight' => 'normal',
|
||||||
|
'textAlign' => 'center',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
4 =>
|
||||||
|
array (
|
||||||
|
'type' => 'spacer',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'height' => '20px',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
2 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'horizontal',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'spacer',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#f0f0f0',
|
||||||
|
'height' => '40px',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'type' => 'image',
|
||||||
|
'link' => 'http://mailpoet.info/cutting-through-the-smog-what-to-do-to-fight-air-pollution/',
|
||||||
|
'src' => $this->template_image_url . '/gettyimages-578313682-800x533.jpg',
|
||||||
|
'alt' => 'gettyimages-578313682-800x533',
|
||||||
|
'fullWidth' => true,
|
||||||
|
'width' => '800px',
|
||||||
|
'height' => '533px',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'textAlign' => 'center',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
2 =>
|
||||||
|
array (
|
||||||
|
'type' => 'spacer',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'height' => '30px',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
3 =>
|
||||||
|
array (
|
||||||
|
'type' => 'text',
|
||||||
|
'text' => '<h3 style="text-align: center;" data-post-id="1997">Ladybird’s transparent shell reveals how it folds its wings</h3>
|
||||||
|
<p class="mailpoet_wp_post" style="text-align: center;">They certainly know how to fold. A see-through artificial wing case has been used to watch for the first time as ladybirds put away their wings after flight.</p>',
|
||||||
|
),
|
||||||
|
4 =>
|
||||||
|
array (
|
||||||
|
'type' => 'button',
|
||||||
|
'text' => 'Read The Post',
|
||||||
|
'url' => '',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#5ecd39',
|
||||||
|
'borderColor' => '#000000',
|
||||||
|
'borderWidth' => '0px',
|
||||||
|
'borderRadius' => '5px',
|
||||||
|
'borderStyle' => 'solid',
|
||||||
|
'width' => '288px',
|
||||||
|
'lineHeight' => '36px',
|
||||||
|
'fontColor' => '#ffffff',
|
||||||
|
'fontFamily' => 'Lucida',
|
||||||
|
'fontSize' => '16px',
|
||||||
|
'fontWeight' => 'normal',
|
||||||
|
'textAlign' => 'center',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
5 =>
|
||||||
|
array (
|
||||||
|
'type' => 'spacer',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'height' => '20px',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
6 =>
|
||||||
|
array (
|
||||||
|
'type' => 'spacer',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#f0f0f0',
|
||||||
|
'height' => '40px',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
3 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'horizontal',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'image',
|
||||||
|
'link' => 'http://mailpoet.info/cutting-through-the-smog-what-to-do-to-fight-air-pollution/',
|
||||||
|
'src' => $this->template_image_url . '/plasma-stingray111-800x533.jpg',
|
||||||
|
'alt' => 'plasma-stingray111-800x533',
|
||||||
|
'fullWidth' => true,
|
||||||
|
'width' => '800px',
|
||||||
|
'height' => '533px',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'textAlign' => 'center',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'type' => 'spacer',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'height' => '30px',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
2 =>
|
||||||
|
array (
|
||||||
|
'type' => 'text',
|
||||||
|
'text' => '<h3 style="text-align: center;" data-post-id="1997">Plasma jet engines that could take you from the ground to space</h3>
|
||||||
|
<p class="mailpoet_wp_post" style="text-align: center;">Forget fuel-powered jet engines. We’re on the verge of having aircraft that can fly from the ground up to the edge of space using air and electricity alone.</p>',
|
||||||
|
),
|
||||||
|
3 =>
|
||||||
|
array (
|
||||||
|
'type' => 'button',
|
||||||
|
'text' => 'Read The Post',
|
||||||
|
'url' => '',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#5ecd39',
|
||||||
|
'borderColor' => '#000000',
|
||||||
|
'borderWidth' => '0px',
|
||||||
|
'borderRadius' => '5px',
|
||||||
|
'borderStyle' => 'solid',
|
||||||
|
'width' => '288px',
|
||||||
|
'lineHeight' => '36px',
|
||||||
|
'fontColor' => '#ffffff',
|
||||||
|
'fontFamily' => 'Lucida',
|
||||||
|
'fontSize' => '16px',
|
||||||
|
'fontWeight' => 'normal',
|
||||||
|
'textAlign' => 'center',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
4 =>
|
||||||
|
array (
|
||||||
|
'type' => 'spacer',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'height' => '20px',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
5 =>
|
||||||
|
array (
|
||||||
|
'type' => 'spacer',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#f0f0f0',
|
||||||
|
'height' => '40px',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
4 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'horizontal',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'image',
|
||||||
|
'link' => '',
|
||||||
|
'src' => $this->template_image_url . '/Wide-Footer.jpg',
|
||||||
|
'alt' => 'Wide-Footer',
|
||||||
|
'fullWidth' => true,
|
||||||
|
'width' => '1280px',
|
||||||
|
'height' => '721px',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'textAlign' => 'center',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
5 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'horizontal',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#5ecd39',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'spacer',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'height' => '21px',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'type' => 'social',
|
||||||
|
'iconSet' => 'full-symbol-grey',
|
||||||
|
'icons' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'socialIcon',
|
||||||
|
'iconType' => 'facebook',
|
||||||
|
'link' => 'http://www.facebook.com',
|
||||||
|
'image' => $this->social_icon_url . '/08-full-symbol-grey/Facebook.png?mailpoet_version=3.0.0-rc.2.0.0',
|
||||||
|
'height' => '32px',
|
||||||
|
'width' => '32px',
|
||||||
|
'text' => 'Facebook',
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'type' => 'socialIcon',
|
||||||
|
'iconType' => 'twitter',
|
||||||
|
'link' => 'http://www.twitter.com',
|
||||||
|
'image' => $this->social_icon_url . '/08-full-symbol-grey/Twitter.png?mailpoet_version=3.0.0-rc.2.0.0',
|
||||||
|
'height' => '32px',
|
||||||
|
'width' => '32px',
|
||||||
|
'text' => 'Twitter',
|
||||||
|
),
|
||||||
|
2 =>
|
||||||
|
array (
|
||||||
|
'type' => 'socialIcon',
|
||||||
|
'iconType' => 'website',
|
||||||
|
'link' => '',
|
||||||
|
'image' => $this->social_icon_url . '/08-full-symbol-grey/Website.png?mailpoet_version=3.0.0-rc.2.0.0',
|
||||||
|
'height' => '32px',
|
||||||
|
'width' => '32px',
|
||||||
|
'text' => 'Website',
|
||||||
|
),
|
||||||
|
3 =>
|
||||||
|
array (
|
||||||
|
'type' => 'socialIcon',
|
||||||
|
'iconType' => 'instagram',
|
||||||
|
'link' => 'http://instagram.com',
|
||||||
|
'image' => $this->social_icon_url . '/08-full-symbol-grey/Instagram.png?mailpoet_version=3.0.0-rc.2.0.0',
|
||||||
|
'height' => '32px',
|
||||||
|
'width' => '32px',
|
||||||
|
'text' => 'Instagram',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
2 =>
|
||||||
|
array (
|
||||||
|
'type' => 'footer',
|
||||||
|
'text' => '<p><span style="color: #ffffff;"><a href="[link:subscription_unsubscribe_url]" style="color: #ffffff;">Unsubscribe</a> | <a href="[link:subscription_manage_url]" style="color: #ffffff;">Manage subscription</a></span><br /><span style="color: #ffffff;">Add your postal address here!</span></p>',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
'text' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#222222',
|
||||||
|
'fontFamily' => 'Arial',
|
||||||
|
'fontSize' => '12px',
|
||||||
|
'textAlign' => 'center',
|
||||||
|
),
|
||||||
|
'link' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#6cb7d4',
|
||||||
|
'textDecoration' => 'none',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
3 =>
|
||||||
|
array (
|
||||||
|
'type' => 'spacer',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'height' => '40px',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'globalStyles' =>
|
||||||
|
array (
|
||||||
|
'text' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#000000',
|
||||||
|
'fontFamily' => 'Arial',
|
||||||
|
'fontSize' => '15px',
|
||||||
|
),
|
||||||
|
'h1' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#111111',
|
||||||
|
'fontFamily' => 'Lucida',
|
||||||
|
'fontSize' => '30px',
|
||||||
|
),
|
||||||
|
'h2' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#222222',
|
||||||
|
'fontFamily' => 'Lucida',
|
||||||
|
'fontSize' => '24px',
|
||||||
|
),
|
||||||
|
'h3' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#333333',
|
||||||
|
'fontFamily' => 'Lucida',
|
||||||
|
'fontSize' => '18px',
|
||||||
|
),
|
||||||
|
'link' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#5ecd39',
|
||||||
|
'textDecoration' => 'underline',
|
||||||
|
),
|
||||||
|
'wrapper' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#ffffff',
|
||||||
|
),
|
||||||
|
'body' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#f0f0f0',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
961
lib/Config/PopulatorData/Templates/WineCity.php
Normal file
961
lib/Config/PopulatorData/Templates/WineCity.php
Normal file
@ -0,0 +1,961 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace MailPoet\Config\PopulatorData\Templates;
|
||||||
|
|
||||||
|
class WineCity {
|
||||||
|
|
||||||
|
private $template_image_url;
|
||||||
|
private $social_icon_url;
|
||||||
|
|
||||||
|
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';
|
||||||
|
}
|
||||||
|
|
||||||
|
function get() {
|
||||||
|
return array(
|
||||||
|
'name' => __("Wine City", 'mailpoet'),
|
||||||
|
'categories' => json_encode(array('woocommerce', 'sample')),
|
||||||
|
'readonly' => 1,
|
||||||
|
'thumbnail' => $this->getThumbnail(),
|
||||||
|
'body' => json_encode($this->getBody()),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getThumbnail() {
|
||||||
|
return $this->template_image_url . '/wine-city.jpg';
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getBody() {
|
||||||
|
return array (
|
||||||
|
'content' =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'image' =>
|
||||||
|
array (
|
||||||
|
'src' => NULL,
|
||||||
|
'display' => 'scale',
|
||||||
|
),
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'horizontal',
|
||||||
|
'image' =>
|
||||||
|
array (
|
||||||
|
'src' => NULL,
|
||||||
|
'display' => 'scale',
|
||||||
|
),
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'image' =>
|
||||||
|
array (
|
||||||
|
'src' => NULL,
|
||||||
|
'display' => 'scale',
|
||||||
|
),
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'spacer',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'height' => '37px',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'type' => 'image',
|
||||||
|
'link' => '',
|
||||||
|
'src' => $this->template_image_url . '/Wine-Logo.png',
|
||||||
|
'alt' => 'Wine-Logo',
|
||||||
|
'fullWidth' => false,
|
||||||
|
'width' => '136px',
|
||||||
|
'height' => '67px',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'textAlign' => 'left',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'image' =>
|
||||||
|
array (
|
||||||
|
'src' => NULL,
|
||||||
|
'display' => 'scale',
|
||||||
|
),
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'spacer',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'height' => '31px',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'type' => 'social',
|
||||||
|
'iconSet' => 'circles',
|
||||||
|
'icons' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'socialIcon',
|
||||||
|
'iconType' => 'facebook',
|
||||||
|
'link' => 'http://www.facebook.com',
|
||||||
|
'image' => $this->social_icon_url . '/03-circles/Facebook.png?mailpoet_version=3.7.3',
|
||||||
|
'height' => '32px',
|
||||||
|
'width' => '32px',
|
||||||
|
'text' => 'Facebook',
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'type' => 'socialIcon',
|
||||||
|
'iconType' => 'twitter',
|
||||||
|
'link' => 'http://www.twitter.com',
|
||||||
|
'image' => $this->social_icon_url . '/03-circles/Twitter.png?mailpoet_version=3.7.3',
|
||||||
|
'height' => '32px',
|
||||||
|
'width' => '32px',
|
||||||
|
'text' => 'Twitter',
|
||||||
|
),
|
||||||
|
2 =>
|
||||||
|
array (
|
||||||
|
'type' => 'socialIcon',
|
||||||
|
'iconType' => 'instagram',
|
||||||
|
'link' => 'http://instagram.com',
|
||||||
|
'image' => $this->social_icon_url . '/03-circles/Instagram.png?mailpoet_version=3.7.3',
|
||||||
|
'height' => '32px',
|
||||||
|
'width' => '32px',
|
||||||
|
'text' => 'Instagram',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'horizontal',
|
||||||
|
'image' =>
|
||||||
|
array (
|
||||||
|
'src' => NULL,
|
||||||
|
'display' => 'scale',
|
||||||
|
),
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'image' =>
|
||||||
|
array (
|
||||||
|
'src' => NULL,
|
||||||
|
'display' => 'scale',
|
||||||
|
),
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'divider',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'padding' => '13px',
|
||||||
|
'borderStyle' => 'solid',
|
||||||
|
'borderWidth' => '1px',
|
||||||
|
'borderColor' => '#aaaaaa',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
2 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'horizontal',
|
||||||
|
'image' =>
|
||||||
|
array (
|
||||||
|
'src' => NULL,
|
||||||
|
'display' => 'scale',
|
||||||
|
),
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'image' =>
|
||||||
|
array (
|
||||||
|
'src' => NULL,
|
||||||
|
'display' => 'scale',
|
||||||
|
),
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'text',
|
||||||
|
'text' => '<p style="text-align: left;"><span style="color: #6d6d6d;"><strong>Red Wine</strong></span></p>',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'image' =>
|
||||||
|
array (
|
||||||
|
'src' => NULL,
|
||||||
|
'display' => 'scale',
|
||||||
|
),
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'text',
|
||||||
|
'text' => '<p style="text-align: left;"><span style="color: #6d6d6d;"><strong>White Wine</strong></span></p>',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
2 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'image' =>
|
||||||
|
array (
|
||||||
|
'src' => NULL,
|
||||||
|
'display' => 'scale',
|
||||||
|
),
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'text',
|
||||||
|
'text' => '<p style="text-align: left;"><span style="color: #6d6d6d;"><strong>Rose Wine</strong></span></p>',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
3 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'horizontal',
|
||||||
|
'image' =>
|
||||||
|
array (
|
||||||
|
'src' => $this->template_image_url . '/Wine-Header-1.jpg',
|
||||||
|
'display' => 'scale',
|
||||||
|
),
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'image' =>
|
||||||
|
array (
|
||||||
|
'src' => NULL,
|
||||||
|
'display' => 'scale',
|
||||||
|
),
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'spacer',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'height' => '20px',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'type' => 'text',
|
||||||
|
'text' => '<h1 style="text-align: center;"><span style="color: #ffffff;"><strong>Have a drink on us</strong></span></h1>',
|
||||||
|
),
|
||||||
|
2 =>
|
||||||
|
array (
|
||||||
|
'type' => 'spacer',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'height' => '231px',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
4 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'horizontal',
|
||||||
|
'image' =>
|
||||||
|
array (
|
||||||
|
'src' => NULL,
|
||||||
|
'display' => 'scale',
|
||||||
|
),
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#ffffff',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'image' =>
|
||||||
|
array (
|
||||||
|
'src' => NULL,
|
||||||
|
'display' => 'scale',
|
||||||
|
),
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'spacer',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'height' => '34px',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'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 =>
|
||||||
|
array (
|
||||||
|
'type' => 'button',
|
||||||
|
'text' => 'CoUponCoDE',
|
||||||
|
'url' => '',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'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',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
3 =>
|
||||||
|
array (
|
||||||
|
'type' => 'divider',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'padding' => '17px',
|
||||||
|
'borderStyle' => 'solid',
|
||||||
|
'borderWidth' => '1px',
|
||||||
|
'borderColor' => '#aaaaaa',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
4 =>
|
||||||
|
array (
|
||||||
|
'type' => 'footer',
|
||||||
|
'text' => '<p><strong><span style="color: #6d6d6d;"><a href="[link:subscription_unsubscribe_url]" style="color: #6d6d6d;">Unsubscribe</a> | <a href="[link:subscription_manage_url]" style="color: #6d6d6d;">Manage your subscription</a></span></strong><br /><span style="color: #6d6d6d;">Add your postal address here!</span></p>',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
'text' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#222222',
|
||||||
|
'fontFamily' => 'Arial',
|
||||||
|
'fontSize' => '12px',
|
||||||
|
'textAlign' => 'center',
|
||||||
|
),
|
||||||
|
'link' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#6cb7d4',
|
||||||
|
'textDecoration' => 'none',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
5 =>
|
||||||
|
array (
|
||||||
|
'type' => 'spacer',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'height' => '20px',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
5 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'horizontal',
|
||||||
|
'image' =>
|
||||||
|
array (
|
||||||
|
'src' => NULL,
|
||||||
|
'display' => 'scale',
|
||||||
|
),
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#eeeeee',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'container',
|
||||||
|
'orientation' => 'vertical',
|
||||||
|
'image' =>
|
||||||
|
array (
|
||||||
|
'src' => NULL,
|
||||||
|
'display' => 'scale',
|
||||||
|
),
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blocks' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'spacer',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'height' => '20px',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'globalStyles' =>
|
||||||
|
array (
|
||||||
|
'text' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#000000',
|
||||||
|
'fontFamily' => 'Arial',
|
||||||
|
'fontSize' => '14px',
|
||||||
|
),
|
||||||
|
'h1' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#111111',
|
||||||
|
'fontFamily' => 'Arial',
|
||||||
|
'fontSize' => '40px',
|
||||||
|
),
|
||||||
|
'h2' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#222222',
|
||||||
|
'fontFamily' => 'Arial',
|
||||||
|
'fontSize' => '24px',
|
||||||
|
),
|
||||||
|
'h3' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#333333',
|
||||||
|
'fontFamily' => 'Arial',
|
||||||
|
'fontSize' => '22px',
|
||||||
|
),
|
||||||
|
'link' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#21759B',
|
||||||
|
'textDecoration' => 'underline',
|
||||||
|
),
|
||||||
|
'wrapper' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#ffffff',
|
||||||
|
),
|
||||||
|
'body' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => '#eeeeee',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'blockDefaults' =>
|
||||||
|
array (
|
||||||
|
'automatedLatestContent' =>
|
||||||
|
array (
|
||||||
|
'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' =>
|
||||||
|
array (
|
||||||
|
'text' => 'Read more',
|
||||||
|
'url' => '[postLink]',
|
||||||
|
'context' => 'automatedLatestContent.readMoreButton',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'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' =>
|
||||||
|
array (
|
||||||
|
'context' => 'automatedLatestContent.divider',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'padding' => '13px',
|
||||||
|
'borderStyle' => 'solid',
|
||||||
|
'borderWidth' => '3px',
|
||||||
|
'borderColor' => '#aaaaaa',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'backgroundColor' => '#ffffff',
|
||||||
|
'backgroundColorAlternate' => '#eeeeee',
|
||||||
|
),
|
||||||
|
'automatedLatestContentLayout' =>
|
||||||
|
array (
|
||||||
|
'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' =>
|
||||||
|
array (
|
||||||
|
'text' => 'Read more',
|
||||||
|
'url' => '[postLink]',
|
||||||
|
'context' => 'automatedLatestContentLayout.readMoreButton',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'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' =>
|
||||||
|
array (
|
||||||
|
'context' => 'automatedLatestContentLayout.divider',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'padding' => '13px',
|
||||||
|
'borderStyle' => 'solid',
|
||||||
|
'borderWidth' => '3px',
|
||||||
|
'borderColor' => '#aaaaaa',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'backgroundColor' => '#ffffff',
|
||||||
|
'backgroundColorAlternate' => '#eeeeee',
|
||||||
|
),
|
||||||
|
'button' =>
|
||||||
|
array (
|
||||||
|
'text' => 'CoUponCoDE',
|
||||||
|
'url' => '',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'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',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'type' => 'button',
|
||||||
|
),
|
||||||
|
'divider' =>
|
||||||
|
array (
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'padding' => '17px',
|
||||||
|
'borderStyle' => 'solid',
|
||||||
|
'borderWidth' => '1px',
|
||||||
|
'borderColor' => '#aaaaaa',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'type' => 'divider',
|
||||||
|
),
|
||||||
|
'footer' =>
|
||||||
|
array (
|
||||||
|
'text' => '<p><a href="[link:subscription_unsubscribe_url]">Unsubscribe</a> | <a href="[link:subscription_manage_url]">Manage subscription</a><br />Add your postal address here!</p>',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
'text' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#222222',
|
||||||
|
'fontFamily' => 'Arial',
|
||||||
|
'fontSize' => '12px',
|
||||||
|
'textAlign' => 'center',
|
||||||
|
),
|
||||||
|
'link' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#6cb7d4',
|
||||||
|
'textDecoration' => 'none',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'type' => 'footer',
|
||||||
|
),
|
||||||
|
'posts' =>
|
||||||
|
array (
|
||||||
|
'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' =>
|
||||||
|
array (
|
||||||
|
'text' => 'Read more',
|
||||||
|
'url' => '[postLink]',
|
||||||
|
'context' => 'posts.readMoreButton',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'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' =>
|
||||||
|
array (
|
||||||
|
'context' => 'posts.divider',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'padding' => '13px',
|
||||||
|
'borderStyle' => 'solid',
|
||||||
|
'borderWidth' => '3px',
|
||||||
|
'borderColor' => '#aaaaaa',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'backgroundColor' => '#ffffff',
|
||||||
|
'backgroundColorAlternate' => '#eeeeee',
|
||||||
|
),
|
||||||
|
'social' =>
|
||||||
|
array (
|
||||||
|
'iconSet' => 'circles',
|
||||||
|
'icons' =>
|
||||||
|
array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
'type' => 'socialIcon',
|
||||||
|
'iconType' => 'facebook',
|
||||||
|
'link' => 'http://www.facebook.com',
|
||||||
|
'image' => $this->social_icon_url . '/03-circles/Facebook.png?mailpoet_version=3.7.3',
|
||||||
|
'height' => '32px',
|
||||||
|
'width' => '32px',
|
||||||
|
'text' => 'Facebook',
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
'type' => 'socialIcon',
|
||||||
|
'iconType' => 'twitter',
|
||||||
|
'link' => 'http://www.twitter.com',
|
||||||
|
'image' => $this->social_icon_url . '/03-circles/Twitter.png?mailpoet_version=3.7.3',
|
||||||
|
'height' => '32px',
|
||||||
|
'width' => '32px',
|
||||||
|
'text' => 'Twitter',
|
||||||
|
),
|
||||||
|
2 =>
|
||||||
|
array (
|
||||||
|
'type' => 'socialIcon',
|
||||||
|
'iconType' => 'instagram',
|
||||||
|
'link' => 'http://instagram.com',
|
||||||
|
'image' => $this->social_icon_url . '/03-circles/Instagram.png?mailpoet_version=3.7.3',
|
||||||
|
'height' => '32px',
|
||||||
|
'width' => '32px',
|
||||||
|
'text' => 'Instagram',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'type' => 'social',
|
||||||
|
),
|
||||||
|
'spacer' =>
|
||||||
|
array (
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'height' => '231px',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'type' => 'spacer',
|
||||||
|
),
|
||||||
|
'header' =>
|
||||||
|
array (
|
||||||
|
'text' => 'Display problems? <a href="[link:newsletter_view_in_browser_url]">Open this email in your web browser.</a>',
|
||||||
|
'styles' =>
|
||||||
|
array (
|
||||||
|
'block' =>
|
||||||
|
array (
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
),
|
||||||
|
'text' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#222222',
|
||||||
|
'fontFamily' => 'Arial',
|
||||||
|
'fontSize' => '12px',
|
||||||
|
'textAlign' => 'center',
|
||||||
|
),
|
||||||
|
'link' =>
|
||||||
|
array (
|
||||||
|
'fontColor' => '#6cb7d4',
|
||||||
|
'textDecoration' => 'underline',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -128,4 +128,4 @@ class Renderer {
|
|||||||
$this->assets_manifest_css[$asset] :
|
$this->assets_manifest_css[$asset] :
|
||||||
$asset;
|
$asset;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -83,12 +83,12 @@ class CronHelper {
|
|||||||
$result = self::queryCronUrl($url);
|
$result = self::queryCronUrl($url);
|
||||||
if(is_wp_error($result)) return $result->get_error_message();
|
if(is_wp_error($result)) return $result->get_error_message();
|
||||||
$response = WPFunctions::wpRemoteRetrieveBody($result);
|
$response = WPFunctions::wpRemoteRetrieveBody($result);
|
||||||
$response = substr(trim($response), -strlen(Daemon::PING_SUCCESS_RESPONSE)) === Daemon::PING_SUCCESS_RESPONSE ?
|
$response = substr(trim($response), -strlen(DaemonHttpRunner::PING_SUCCESS_RESPONSE)) === DaemonHttpRunner::PING_SUCCESS_RESPONSE ?
|
||||||
Daemon::PING_SUCCESS_RESPONSE :
|
DaemonHttpRunner::PING_SUCCESS_RESPONSE :
|
||||||
$response;
|
$response;
|
||||||
return (!$validate_response) ?
|
return (!$validate_response) ?
|
||||||
$response :
|
$response :
|
||||||
$response === Daemon::PING_SUCCESS_RESPONSE;
|
$response === DaemonHttpRunner::PING_SUCCESS_RESPONSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static function accessDaemon($token) {
|
static function accessDaemon($token) {
|
||||||
|
@ -10,6 +10,7 @@ class CronTrigger {
|
|||||||
public static $available_methods = array(
|
public static $available_methods = array(
|
||||||
'mailpoet' => 'MailPoet',
|
'mailpoet' => 'MailPoet',
|
||||||
'wordpress' => 'WordPress',
|
'wordpress' => 'WordPress',
|
||||||
|
'linux_cron' => 'Linux Cron',
|
||||||
'none' => 'Disabled'
|
'none' => 'Disabled'
|
||||||
);
|
);
|
||||||
const DEFAULT_METHOD = 'WordPress';
|
const DEFAULT_METHOD = 'WordPress';
|
||||||
@ -37,4 +38,4 @@ class CronTrigger {
|
|||||||
static function getCurrentMethod() {
|
static function getCurrentMethod() {
|
||||||
return Setting::getValue(self::SETTING_NAME . '.method');
|
return Setting::getValue(self::SETTING_NAME . '.method');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
namespace MailPoet\Cron;
|
namespace MailPoet\Cron;
|
||||||
use MailPoet\Cron\Workers\Scheduler as SchedulerWorker;
|
use MailPoet\Cron\Workers\Scheduler as SchedulerWorker;
|
||||||
use MailPoet\Cron\Workers\SendingQueue\Migration as MigrationWorker;
|
use MailPoet\Cron\Workers\SendingQueue\Migration as MigrationWorker;
|
||||||
|
use MailPoet\Cron\Workers\SendingQueue\SendingErrorHandler;
|
||||||
use MailPoet\Cron\Workers\SendingQueue\SendingQueue as SendingQueueWorker;
|
use MailPoet\Cron\Workers\SendingQueue\SendingQueue as SendingQueueWorker;
|
||||||
use MailPoet\Cron\Workers\Bounce as BounceWorker;
|
use MailPoet\Cron\Workers\Bounce as BounceWorker;
|
||||||
use MailPoet\Cron\Workers\KeyCheck\PremiumKeyCheck as PremiumKeyCheckWorker;
|
use MailPoet\Cron\Workers\KeyCheck\PremiumKeyCheck as PremiumKeyCheckWorker;
|
||||||
@ -11,50 +12,15 @@ if(!defined('ABSPATH')) exit;
|
|||||||
require_once(ABSPATH . 'wp-includes/pluggable.php');
|
require_once(ABSPATH . 'wp-includes/pluggable.php');
|
||||||
|
|
||||||
class Daemon {
|
class Daemon {
|
||||||
public $daemon;
|
|
||||||
public $request_data;
|
|
||||||
public $timer;
|
public $timer;
|
||||||
|
|
||||||
const PING_SUCCESS_RESPONSE = 'pong';
|
function __construct() {
|
||||||
|
|
||||||
function __construct($request_data = false) {
|
|
||||||
$this->request_data = $request_data;
|
|
||||||
$this->daemon = CronHelper::getDaemon();
|
|
||||||
$this->token = CronHelper::createToken();
|
|
||||||
$this->timer = microtime(true);
|
$this->timer = microtime(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
function ping() {
|
function run($settings_daemon_data) {
|
||||||
$this->addCacheHeaders();
|
$settings_daemon_data['run_started_at'] = time();
|
||||||
$this->terminateRequest(self::PING_SUCCESS_RESPONSE);
|
CronHelper::saveDaemon($settings_daemon_data);
|
||||||
}
|
|
||||||
|
|
||||||
function run() {
|
|
||||||
ignore_user_abort(true);
|
|
||||||
if(strpos(@ini_get('disable_functions'), 'set_time_limit') === false) {
|
|
||||||
set_time_limit(0);
|
|
||||||
}
|
|
||||||
$this->addCacheHeaders();
|
|
||||||
if(!$this->request_data) {
|
|
||||||
$error = __('Invalid or missing request data.', 'mailpoet');
|
|
||||||
} else {
|
|
||||||
if(!$this->daemon) {
|
|
||||||
$error = __('Daemon does not exist.', 'mailpoet');
|
|
||||||
} else {
|
|
||||||
if(!isset($this->request_data['token']) ||
|
|
||||||
$this->request_data['token'] !== $this->daemon['token']
|
|
||||||
) {
|
|
||||||
$error = 'Invalid or missing token.';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(!empty($error)) {
|
|
||||||
return $this->abortWithError($error);
|
|
||||||
}
|
|
||||||
$daemon = $this->daemon;
|
|
||||||
$daemon['token'] = $this->token;
|
|
||||||
$daemon['run_started_at'] = time();
|
|
||||||
CronHelper::saveDaemon($daemon);
|
|
||||||
try {
|
try {
|
||||||
$this->executeMigrationWorker();
|
$this->executeMigrationWorker();
|
||||||
$this->executeScheduleWorker();
|
$this->executeScheduleWorker();
|
||||||
@ -67,22 +33,6 @@ class Daemon {
|
|||||||
}
|
}
|
||||||
// Log successful execution
|
// Log successful execution
|
||||||
CronHelper::saveDaemonRunCompleted(time());
|
CronHelper::saveDaemonRunCompleted(time());
|
||||||
// if workers took less time to execute than the daemon execution limit,
|
|
||||||
// pause daemon execution to ensure that daemon runs only once every X seconds
|
|
||||||
$elapsed_time = microtime(true) - $this->timer;
|
|
||||||
if($elapsed_time < CronHelper::DAEMON_EXECUTION_LIMIT) {
|
|
||||||
$this->pauseExecution(CronHelper::DAEMON_EXECUTION_LIMIT - $elapsed_time);
|
|
||||||
}
|
|
||||||
// after each execution, re-read daemon data in case it changed
|
|
||||||
$daemon = CronHelper::getDaemon();
|
|
||||||
if($this->shouldTerminateExecution($daemon)) {
|
|
||||||
return $this->terminateRequest();
|
|
||||||
}
|
|
||||||
return $this->callSelf();
|
|
||||||
}
|
|
||||||
|
|
||||||
function pauseExecution($pause_time) {
|
|
||||||
return sleep($pause_time);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function executeScheduleWorker() {
|
function executeScheduleWorker() {
|
||||||
@ -91,7 +41,7 @@ class Daemon {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function executeQueueWorker() {
|
function executeQueueWorker() {
|
||||||
$queue = new SendingQueueWorker($this->timer);
|
$queue = new SendingQueueWorker(new SendingErrorHandler(), $this->timer);
|
||||||
return $queue->process();
|
return $queue->process();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -115,38 +65,4 @@ class Daemon {
|
|||||||
return $migration->process();
|
return $migration->process();
|
||||||
}
|
}
|
||||||
|
|
||||||
function callSelf() {
|
|
||||||
CronHelper::accessDaemon($this->token);
|
|
||||||
return $this->terminateRequest();
|
|
||||||
}
|
|
||||||
|
|
||||||
function abortWithError($message) {
|
|
||||||
status_header(404, $message);
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
function terminateRequest($message = false) {
|
|
||||||
die($message);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return boolean
|
|
||||||
*/
|
|
||||||
private function shouldTerminateExecution(array $daemon = null) {
|
|
||||||
return !$daemon ||
|
|
||||||
$daemon['token'] !== $this->token ||
|
|
||||||
(isset($daemon['status']) && $daemon['status'] !== CronHelper::DAEMON_STATUS_ACTIVE);
|
|
||||||
}
|
|
||||||
|
|
||||||
private function addCacheHeaders() {
|
|
||||||
if(headers_sent()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// Common Cache Control header. Should be respected by cache proxies and CDNs.
|
|
||||||
header('Cache-Control: no-cache');
|
|
||||||
// Mark as blacklisted for SG Optimizer for sites hosted on SiteGround.
|
|
||||||
header('X-Cache-Enabled: False');
|
|
||||||
// Set caching header for LiteSpeed server.
|
|
||||||
header('X-LiteSpeed-Cache-Control: no-cache');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
112
lib/Cron/DaemonHttpRunner.php
Normal file
112
lib/Cron/DaemonHttpRunner.php
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
<?php
|
||||||
|
namespace MailPoet\Cron;
|
||||||
|
|
||||||
|
if(!defined('ABSPATH')) exit;
|
||||||
|
require_once(ABSPATH . 'wp-includes/pluggable.php');
|
||||||
|
|
||||||
|
class DaemonHttpRunner {
|
||||||
|
public $settings_daemon_data;
|
||||||
|
public $request_data;
|
||||||
|
public $timer;
|
||||||
|
public $token;
|
||||||
|
|
||||||
|
/** @var Daemon */
|
||||||
|
private $daemon;
|
||||||
|
|
||||||
|
const PING_SUCCESS_RESPONSE = 'pong';
|
||||||
|
|
||||||
|
function __construct($request_data = false, $daemon = null) {
|
||||||
|
$this->request_data = $request_data;
|
||||||
|
$this->settings_daemon_data = CronHelper::getDaemon();
|
||||||
|
$this->token = CronHelper::createToken();
|
||||||
|
$this->timer = microtime(true);
|
||||||
|
$this->daemon = $daemon;
|
||||||
|
if(!$daemon) {
|
||||||
|
$this->daemon = new Daemon($this->settings_daemon_data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function ping() {
|
||||||
|
$this->addCacheHeaders();
|
||||||
|
$this->terminateRequest(self::PING_SUCCESS_RESPONSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
function run() {
|
||||||
|
ignore_user_abort(true);
|
||||||
|
if(strpos(@ini_get('disable_functions'), 'set_time_limit') === false) {
|
||||||
|
set_time_limit(0);
|
||||||
|
}
|
||||||
|
$this->addCacheHeaders();
|
||||||
|
if(!$this->request_data) {
|
||||||
|
$error = __('Invalid or missing request data.', 'mailpoet');
|
||||||
|
} else {
|
||||||
|
if(!$this->settings_daemon_data) {
|
||||||
|
$error = __('Daemon does not exist.', 'mailpoet');
|
||||||
|
} else {
|
||||||
|
if(!isset($this->request_data['token']) ||
|
||||||
|
$this->request_data['token'] !== $this->settings_daemon_data['token']
|
||||||
|
) {
|
||||||
|
$error = 'Invalid or missing token.';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!empty($error)) {
|
||||||
|
return $this->abortWithError($error);
|
||||||
|
}
|
||||||
|
$this->settings_daemon_data['token'] = $this->token;
|
||||||
|
$this->daemon->run($this->settings_daemon_data);
|
||||||
|
// if workers took less time to execute than the daemon execution limit,
|
||||||
|
// pause daemon execution to ensure that daemon runs only once every X seconds
|
||||||
|
$elapsed_time = microtime(true) - $this->timer;
|
||||||
|
if($elapsed_time < CronHelper::DAEMON_EXECUTION_LIMIT) {
|
||||||
|
$this->pauseExecution(CronHelper::DAEMON_EXECUTION_LIMIT - $elapsed_time);
|
||||||
|
}
|
||||||
|
// after each execution, re-read daemon data in case it changed
|
||||||
|
$settings_daemon_data = CronHelper::getDaemon();
|
||||||
|
if($this->shouldTerminateExecution($settings_daemon_data)) {
|
||||||
|
return $this->terminateRequest();
|
||||||
|
}
|
||||||
|
return $this->callSelf();
|
||||||
|
}
|
||||||
|
|
||||||
|
function pauseExecution($pause_time) {
|
||||||
|
return sleep($pause_time);
|
||||||
|
}
|
||||||
|
|
||||||
|
function callSelf() {
|
||||||
|
CronHelper::accessDaemon($this->token);
|
||||||
|
$this->terminateRequest();
|
||||||
|
}
|
||||||
|
|
||||||
|
function abortWithError($message) {
|
||||||
|
status_header(404, $message);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
function terminateRequest($message = false) {
|
||||||
|
die($message);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param array|null $settings_daemon_data
|
||||||
|
*
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
private function shouldTerminateExecution(array $settings_daemon_data = null) {
|
||||||
|
return !$settings_daemon_data ||
|
||||||
|
$settings_daemon_data['token'] !== $this->token ||
|
||||||
|
(isset($settings_daemon_data['status']) && $settings_daemon_data['status'] !== CronHelper::DAEMON_STATUS_ACTIVE);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function addCacheHeaders() {
|
||||||
|
if(headers_sent()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Common Cache Control header. Should be respected by cache proxies and CDNs.
|
||||||
|
header('Cache-Control: no-cache');
|
||||||
|
// Mark as blacklisted for SG Optimizer for sites hosted on SiteGround.
|
||||||
|
header('X-Cache-Enabled: False');
|
||||||
|
// Set caching header for LiteSpeed server.
|
||||||
|
header('X-LiteSpeed-Cache-Control: no-cache');
|
||||||
|
}
|
||||||
|
}
|
@ -39,4 +39,4 @@ class Supervisor {
|
|||||||
}
|
}
|
||||||
return $daemon;
|
return $daemon;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,4 +10,4 @@ class MailPoet {
|
|||||||
$supervisor = new Supervisor();
|
$supervisor = new Supervisor();
|
||||||
return $supervisor->checkDaemon();
|
return $supervisor->checkDaemon();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ namespace MailPoet\Cron\Workers;
|
|||||||
|
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use MailPoet\Cron\CronHelper;
|
use MailPoet\Cron\CronHelper;
|
||||||
|
use MailPoet\Logging\Logger;
|
||||||
use MailPoet\Models\Newsletter;
|
use MailPoet\Models\Newsletter;
|
||||||
use MailPoet\Models\ScheduledTask;
|
use MailPoet\Models\ScheduledTask;
|
||||||
use MailPoet\Models\Segment;
|
use MailPoet\Models\Segment;
|
||||||
@ -75,9 +76,17 @@ class Scheduler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function processPostNotificationNewsletter($newsletter, $queue) {
|
function processPostNotificationNewsletter($newsletter, $queue) {
|
||||||
|
Logger::getLogger('post-notifications')->addInfo(
|
||||||
|
'process post notification in scheduler',
|
||||||
|
['newsletter_id' => $newsletter->id, 'task_id' => $queue->task_id]
|
||||||
|
);
|
||||||
// ensure that segments exist
|
// ensure that segments exist
|
||||||
$segments = $newsletter->segments()->findArray();
|
$segments = $newsletter->segments()->findArray();
|
||||||
if(empty($segments)) {
|
if(empty($segments)) {
|
||||||
|
Logger::getLogger('post-notifications')->addInfo(
|
||||||
|
'post notification no segments',
|
||||||
|
['newsletter_id' => $newsletter->id, 'task_id' => $queue->task_id]
|
||||||
|
);
|
||||||
return $this->deleteQueueOrUpdateNextRunDate($queue, $newsletter);
|
return $this->deleteQueueOrUpdateNextRunDate($queue, $newsletter);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,6 +96,10 @@ class Scheduler {
|
|||||||
$subscribers_count = $finder->addSubscribersToTaskFromSegments($queue->task(), $segments);
|
$subscribers_count = $finder->addSubscribersToTaskFromSegments($queue->task(), $segments);
|
||||||
|
|
||||||
if(empty($subscribers_count)) {
|
if(empty($subscribers_count)) {
|
||||||
|
Logger::getLogger('post-notifications')->addInfo(
|
||||||
|
'post notification no subscribers',
|
||||||
|
['newsletter_id' => $newsletter->id, 'task_id' => $queue->task_id]
|
||||||
|
);
|
||||||
return $this->deleteQueueOrUpdateNextRunDate($queue, $newsletter);
|
return $this->deleteQueueOrUpdateNextRunDate($queue, $newsletter);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -100,6 +113,10 @@ class Scheduler {
|
|||||||
$queue->save();
|
$queue->save();
|
||||||
// update notification status
|
// update notification status
|
||||||
$notification_history->setStatus(Newsletter::STATUS_SENDING);
|
$notification_history->setStatus(Newsletter::STATUS_SENDING);
|
||||||
|
Logger::getLogger('post-notifications')->addInfo(
|
||||||
|
'post notification set status to sending',
|
||||||
|
['newsletter_id' => $newsletter->id, 'task_id' => $queue->task_id]
|
||||||
|
);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
36
lib/Cron/Workers/SendingQueue/SendingErrorHandler.php
Normal file
36
lib/Cron/Workers/SendingQueue/SendingErrorHandler.php
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
namespace MailPoet\Cron\Workers\SendingQueue;
|
||||||
|
|
||||||
|
use MailPoet\Mailer\MailerError;
|
||||||
|
use MailPoet\Mailer\MailerLog;
|
||||||
|
use MailPoet\Tasks\Sending as SendingTask;
|
||||||
|
|
||||||
|
class SendingErrorHandler {
|
||||||
|
function processError(
|
||||||
|
MailerError $error,
|
||||||
|
SendingTask $sending_task,
|
||||||
|
array $prepared_subscribers_ids,
|
||||||
|
array $prepared_subscribers
|
||||||
|
) {
|
||||||
|
if($error->getLevel() === MailerError::LEVEL_HARD) {
|
||||||
|
return $this->processHardError($error);
|
||||||
|
}
|
||||||
|
$this->processSoftError($error, $sending_task, $prepared_subscribers_ids, $prepared_subscribers);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function processHardError(MailerError $error) {
|
||||||
|
if($error->getRetryInterval() !== null) {
|
||||||
|
MailerLog::processNonBlockingError($error->getOperation(), $error->getMessageWithFailedSubscribers(), $error->getRetryInterval());
|
||||||
|
} else {
|
||||||
|
MailerLog::processError($error->getOperation(), $error->getMessageWithFailedSubscribers());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function processSoftError(MailerError $error, SendingTask $sending_task, $prepared_subscribers_ids, $prepared_subscribers) {
|
||||||
|
foreach($error->getSubscriberErrors() as $subscriber_error) {
|
||||||
|
$subscriber_id_index = array_search($subscriber_error->getEmail(), $prepared_subscribers);
|
||||||
|
$message = $subscriber_error->getMessage() ?: $error->getMessage();
|
||||||
|
$sending_task->saveSubscriberError($prepared_subscribers_ids[$subscriber_id_index], $message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -5,6 +5,8 @@ use MailPoet\Cron\CronHelper;
|
|||||||
use MailPoet\Cron\Workers\SendingQueue\Tasks\Links;
|
use MailPoet\Cron\Workers\SendingQueue\Tasks\Links;
|
||||||
use MailPoet\Cron\Workers\SendingQueue\Tasks\Mailer as MailerTask;
|
use MailPoet\Cron\Workers\SendingQueue\Tasks\Mailer as MailerTask;
|
||||||
use MailPoet\Cron\Workers\SendingQueue\Tasks\Newsletter as NewsletterTask;
|
use MailPoet\Cron\Workers\SendingQueue\Tasks\Newsletter as NewsletterTask;
|
||||||
|
use MailPoet\Logging\Logger;
|
||||||
|
use MailPoet\Mailer\MailerError;
|
||||||
use MailPoet\Mailer\MailerLog;
|
use MailPoet\Mailer\MailerLog;
|
||||||
use MailPoet\Models\ScheduledTask as ScheduledTaskModel;
|
use MailPoet\Models\ScheduledTask as ScheduledTaskModel;
|
||||||
use MailPoet\Models\StatisticsNewsletters as StatisticsNewslettersModel;
|
use MailPoet\Models\StatisticsNewsletters as StatisticsNewslettersModel;
|
||||||
@ -23,7 +25,11 @@ class SendingQueue {
|
|||||||
const BATCH_SIZE = 20;
|
const BATCH_SIZE = 20;
|
||||||
const TASK_BATCH_SIZE = 5;
|
const TASK_BATCH_SIZE = 5;
|
||||||
|
|
||||||
function __construct($timer = false, $mailer_task = false, $newsletter_task = false) {
|
/** @var SendingErrorHandler */
|
||||||
|
private $error_handler;
|
||||||
|
|
||||||
|
function __construct(SendingErrorHandler $error_handler, $timer = false, $mailer_task = false, $newsletter_task = false) {
|
||||||
|
$this->error_handler = $error_handler;
|
||||||
$this->mailer_task = ($mailer_task) ? $mailer_task : new MailerTask();
|
$this->mailer_task = ($mailer_task) ? $mailer_task : new MailerTask();
|
||||||
$this->newsletter_task = ($newsletter_task) ? $newsletter_task : new NewsletterTask();
|
$this->newsletter_task = ($newsletter_task) ? $newsletter_task : new NewsletterTask();
|
||||||
$this->timer = ($timer) ? $timer : microtime(true);
|
$this->timer = ($timer) ? $timer : microtime(true);
|
||||||
@ -43,6 +49,10 @@ class SendingQueue {
|
|||||||
// pre-process newsletter (render, replace shortcodes/links, etc.)
|
// pre-process newsletter (render, replace shortcodes/links, etc.)
|
||||||
$newsletter = $this->newsletter_task->preProcessNewsletter($newsletter, $queue);
|
$newsletter = $this->newsletter_task->preProcessNewsletter($newsletter, $queue);
|
||||||
if(!$newsletter) {
|
if(!$newsletter) {
|
||||||
|
Logger::getLogger('newsletters')->addInfo(
|
||||||
|
'delete task in sending queue',
|
||||||
|
['newsletter_id' => $newsletter->id(), 'task_id' => $queue->task_id]
|
||||||
|
);
|
||||||
$queue->delete();
|
$queue->delete();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -124,12 +134,12 @@ class SendingQueue {
|
|||||||
'queue_id' => $queue->id
|
'queue_id' => $queue->id
|
||||||
);
|
);
|
||||||
if($processing_method === 'individual') {
|
if($processing_method === 'individual') {
|
||||||
$queue = $this->sendNewsletters(
|
$queue = $this->sendNewsletter(
|
||||||
$queue,
|
$queue,
|
||||||
$prepared_subscribers_ids,
|
$prepared_subscribers_ids[0],
|
||||||
$prepared_newsletters[0],
|
$prepared_newsletters[0],
|
||||||
$prepared_subscribers[0],
|
$prepared_subscribers[0],
|
||||||
$statistics,
|
$statistics[0],
|
||||||
array('unsubscribe_url' => $unsubscribe_urls[0])
|
array('unsubscribe_url' => $unsubscribe_urls[0])
|
||||||
);
|
);
|
||||||
$prepared_newsletters = array();
|
$prepared_newsletters = array();
|
||||||
@ -152,29 +162,64 @@ class SendingQueue {
|
|||||||
return $queue;
|
return $queue;
|
||||||
}
|
}
|
||||||
|
|
||||||
function sendNewsletters(
|
function sendNewsletter(
|
||||||
$queue, $prepared_subscribers_ids, $prepared_newsletters,
|
SendingTask $sending_task, $prepared_subscriber_id, $prepared_newsletter,
|
||||||
$prepared_subscribers, $statistics, $extra_params = array()
|
$prepared_subscriber, $statistics, $extra_params = array()
|
||||||
) {
|
) {
|
||||||
// send newsletter
|
// send newsletter
|
||||||
$send_result = $this->mailer_task->send(
|
$send_result = $this->mailer_task->send(
|
||||||
|
$prepared_newsletter,
|
||||||
|
$prepared_subscriber,
|
||||||
|
$extra_params
|
||||||
|
);
|
||||||
|
return $this->processSendResult(
|
||||||
|
$sending_task,
|
||||||
|
$send_result,
|
||||||
|
[$prepared_subscriber],
|
||||||
|
[$prepared_subscriber_id],
|
||||||
|
[$statistics]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function sendNewsletters(
|
||||||
|
SendingTask $sending_task, $prepared_subscribers_ids, $prepared_newsletters,
|
||||||
|
$prepared_subscribers, $statistics, $extra_params = array()
|
||||||
|
) {
|
||||||
|
// send newsletters
|
||||||
|
$send_result = $this->mailer_task->sendBulk(
|
||||||
$prepared_newsletters,
|
$prepared_newsletters,
|
||||||
$prepared_subscribers,
|
$prepared_subscribers,
|
||||||
$extra_params
|
$extra_params
|
||||||
);
|
);
|
||||||
|
return $this->processSendResult(
|
||||||
|
$sending_task,
|
||||||
|
$send_result,
|
||||||
|
$prepared_subscribers,
|
||||||
|
$prepared_subscribers_ids,
|
||||||
|
$statistics
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function processSendResult(
|
||||||
|
SendingTask $sending_task,
|
||||||
|
$send_result,
|
||||||
|
array $prepared_subscribers,
|
||||||
|
array $prepared_subscribers_ids,
|
||||||
|
array $statistics
|
||||||
|
) {
|
||||||
// log error message and schedule retry/pause sending
|
// log error message and schedule retry/pause sending
|
||||||
if($send_result['response'] === false) {
|
if($send_result['response'] === false) {
|
||||||
if(isset($send_result['retry_interval'])) {
|
$error = $send_result['error'];
|
||||||
MailerLog::processNonBlockingError($send_result['operation'], $send_result['error_message'], $send_result['retry_interval']);
|
assert($error instanceof MailerError);
|
||||||
} else {
|
// Always switch error level to hard until we implement UI for individual subscriber errors
|
||||||
MailerLog::processError($send_result['operation'], $send_result['error_message']);
|
$error->switchLevelToHard();
|
||||||
}
|
$this->error_handler->processError($error, $sending_task, $prepared_subscribers_ids, $prepared_subscribers);
|
||||||
}
|
}
|
||||||
// update processed/to process list
|
// update processed/to process list
|
||||||
if(!$queue->updateProcessedSubscribers($prepared_subscribers_ids)) {
|
if(!$sending_task->updateProcessedSubscribers($prepared_subscribers_ids)) {
|
||||||
MailerLog::processError(
|
MailerLog::processError(
|
||||||
'processed_list_update',
|
'processed_list_update',
|
||||||
sprintf('QUEUE-%d-PROCESSED-LIST-UPDATE', $queue->id),
|
sprintf('QUEUE-%d-PROCESSED-LIST-UPDATE', $sending_task->id),
|
||||||
null,
|
null,
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
@ -184,10 +229,10 @@ class SendingQueue {
|
|||||||
// update the sent count
|
// update the sent count
|
||||||
$this->mailer_task->updateSentCount();
|
$this->mailer_task->updateSentCount();
|
||||||
// enforce execution limits if queue is still being processed
|
// enforce execution limits if queue is still being processed
|
||||||
if($queue->status !== ScheduledTaskModel::STATUS_COMPLETED) {
|
if($sending_task->status !== ScheduledTaskModel::STATUS_COMPLETED) {
|
||||||
$this->enforceSendingAndExecutionLimits();
|
$this->enforceSendingAndExecutionLimits();
|
||||||
}
|
}
|
||||||
return $queue;
|
return $sending_task;
|
||||||
}
|
}
|
||||||
|
|
||||||
function enforceSendingAndExecutionLimits() {
|
function enforceSendingAndExecutionLimits() {
|
||||||
|
@ -54,11 +54,25 @@ class Mailer {
|
|||||||
return $this->mailer->formatSubscriberNameAndEmailAddress($subscriber);
|
return $this->mailer->formatSubscriberNameAndEmailAddress($subscriber);
|
||||||
}
|
}
|
||||||
|
|
||||||
function send($prepared_newsletters, $prepared_subscribers, $extra_params = array()) {
|
function sendBulk($prepared_newsletters, $prepared_subscribers, $extra_params = array()) {
|
||||||
|
if($this->getProcessingMethod() === 'individual') {
|
||||||
|
throw new \LogicException('Trying to send a batch with individual processing method');
|
||||||
|
}
|
||||||
return $this->mailer->mailer_instance->send(
|
return $this->mailer->mailer_instance->send(
|
||||||
$prepared_newsletters,
|
$prepared_newsletters,
|
||||||
$prepared_subscribers,
|
$prepared_subscribers,
|
||||||
$extra_params
|
$extra_params
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function send($prepared_newsletter, $prepared_subscriber, $extra_params = array()) {
|
||||||
|
if($this->getProcessingMethod() === 'bulk') {
|
||||||
|
throw new \LogicException('Trying to send an individual email with a bulk processing method');
|
||||||
|
}
|
||||||
|
return $this->mailer->mailer_instance->send(
|
||||||
|
$prepared_newsletter,
|
||||||
|
$prepared_subscriber,
|
||||||
|
$extra_params
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ class Newsletter {
|
|||||||
return $newsletter;
|
return $newsletter;
|
||||||
}
|
}
|
||||||
|
|
||||||
function preProcessNewsletter($newsletter, $queue) {
|
function preProcessNewsletter(\MailPoet\Models\Newsletter $newsletter, $queue) {
|
||||||
// return the newsletter if it was previously rendered
|
// return the newsletter if it was previously rendered
|
||||||
if(!is_null($queue->getNewsletterRenderedBody())) {
|
if(!is_null($queue->getNewsletterRenderedBody())) {
|
||||||
return (!$queue->validate()) ?
|
return (!$queue->validate()) ?
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace MailPoet\Mailer;
|
namespace MailPoet\Mailer;
|
||||||
|
|
||||||
|
use MailPoet\Mailer\Methods\ErrorMappers\AmazonSESMapper;
|
||||||
|
use MailPoet\Mailer\Methods\ErrorMappers\MailPoetMapper;
|
||||||
|
use MailPoet\Mailer\Methods\ErrorMappers\PHPMailMapper;
|
||||||
|
use MailPoet\Mailer\Methods\ErrorMappers\SendGridMapper;
|
||||||
|
use MailPoet\Mailer\Methods\ErrorMappers\SMTPMapper;
|
||||||
use MailPoet\Models\Setting;
|
use MailPoet\Models\Setting;
|
||||||
|
|
||||||
if(!defined('ABSPATH')) exit;
|
if(!defined('ABSPATH')) exit;
|
||||||
@ -42,28 +47,32 @@ class Mailer {
|
|||||||
$this->mailer_config['secret_key'],
|
$this->mailer_config['secret_key'],
|
||||||
$this->sender,
|
$this->sender,
|
||||||
$this->reply_to,
|
$this->reply_to,
|
||||||
$this->return_path
|
$this->return_path,
|
||||||
|
new AmazonSESMapper()
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case self::METHOD_MAILPOET:
|
case self::METHOD_MAILPOET:
|
||||||
$mailer_instance = new $this->mailer_config['class'](
|
$mailer_instance = new $this->mailer_config['class'](
|
||||||
$this->mailer_config['mailpoet_api_key'],
|
$this->mailer_config['mailpoet_api_key'],
|
||||||
$this->sender,
|
$this->sender,
|
||||||
$this->reply_to
|
$this->reply_to,
|
||||||
|
new MailPoetMapper()
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case self::METHOD_SENDGRID:
|
case self::METHOD_SENDGRID:
|
||||||
$mailer_instance = new $this->mailer_config['class'](
|
$mailer_instance = new $this->mailer_config['class'](
|
||||||
$this->mailer_config['api_key'],
|
$this->mailer_config['api_key'],
|
||||||
$this->sender,
|
$this->sender,
|
||||||
$this->reply_to
|
$this->reply_to,
|
||||||
|
new SendGridMapper()
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case self::METHOD_PHPMAIL:
|
case self::METHOD_PHPMAIL:
|
||||||
$mailer_instance = new $this->mailer_config['class'](
|
$mailer_instance = new $this->mailer_config['class'](
|
||||||
$this->sender,
|
$this->sender,
|
||||||
$this->reply_to,
|
$this->reply_to,
|
||||||
$this->return_path
|
$this->return_path,
|
||||||
|
new PHPMailMapper()
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case self::METHOD_SMTP:
|
case self::METHOD_SMTP:
|
||||||
@ -76,7 +85,8 @@ class Mailer {
|
|||||||
$this->mailer_config['encryption'],
|
$this->mailer_config['encryption'],
|
||||||
$this->sender,
|
$this->sender,
|
||||||
$this->reply_to,
|
$this->reply_to,
|
||||||
$this->return_path
|
$this->return_path,
|
||||||
|
new SMTPMapper()
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -166,25 +176,16 @@ class Mailer {
|
|||||||
return sprintf('=?utf-8?B?%s?=', base64_encode($name));
|
return sprintf('=?utf-8?B?%s?=', base64_encode($name));
|
||||||
}
|
}
|
||||||
|
|
||||||
static function formatMailerConnectionErrorResult($error_message) {
|
static function formatMailerErrorResult(MailerError $error) {
|
||||||
return array(
|
return [
|
||||||
'response' => false,
|
'response' => false,
|
||||||
'operation' => 'connect',
|
'error' => $error,
|
||||||
'error_message' => $error_message
|
];
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
static function formatMailerSendErrorResult($error_message) {
|
|
||||||
return array(
|
|
||||||
'response' => false,
|
|
||||||
'operation' => 'send',
|
|
||||||
'error_message' => $error_message
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static function formatMailerSendSuccessResult() {
|
static function formatMailerSendSuccessResult() {
|
||||||
return array(
|
return [
|
||||||
'response' => true
|
'response' => true
|
||||||
);
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
105
lib/Mailer/MailerError.php
Normal file
105
lib/Mailer/MailerError.php
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
<?php
|
||||||
|
namespace MailPoet\Mailer;
|
||||||
|
|
||||||
|
class MailerError {
|
||||||
|
const OPERATION_CONNECT = 'connect';
|
||||||
|
const OPERATION_SEND = 'send';
|
||||||
|
|
||||||
|
const LEVEL_HARD = 'hard';
|
||||||
|
const LEVEL_SOFT = 'soft';
|
||||||
|
|
||||||
|
/** @var string */
|
||||||
|
private $operation;
|
||||||
|
|
||||||
|
/** @var string */
|
||||||
|
private $level;
|
||||||
|
|
||||||
|
/** @var string|null */
|
||||||
|
private $message;
|
||||||
|
|
||||||
|
/** @var int|null */
|
||||||
|
private $retry_interval;
|
||||||
|
|
||||||
|
/** @var array */
|
||||||
|
private $subscribers_errors = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $operation
|
||||||
|
* @param string $level
|
||||||
|
* @param null|string $message
|
||||||
|
* @param int|null $retry_interval
|
||||||
|
* @param array $subscribers_errors
|
||||||
|
*/
|
||||||
|
function __construct($operation, $level, $message = null, $retry_interval = null, array $subscribers_errors = []) {
|
||||||
|
$this->operation = $operation;
|
||||||
|
$this->level = $level;
|
||||||
|
$this->message = $message;
|
||||||
|
$this->retry_interval = $retry_interval;
|
||||||
|
$this->subscribers_errors = $subscribers_errors;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function getOperation() {
|
||||||
|
return $this->operation;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function getLevel() {
|
||||||
|
return $this->level;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return null|string
|
||||||
|
*/
|
||||||
|
function getMessage() {
|
||||||
|
return $this->message;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return int|null
|
||||||
|
*/
|
||||||
|
function getRetryInterval() {
|
||||||
|
return $this->retry_interval;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return SubscriberError[]
|
||||||
|
*/
|
||||||
|
function getSubscriberErrors() {
|
||||||
|
return $this->subscribers_errors;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Temporary method until we implement UI for subscriber errors
|
||||||
|
*/
|
||||||
|
function switchLevelToHard() {
|
||||||
|
$this->level = self::LEVEL_HARD;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getMessageWithFailedSubscribers() {
|
||||||
|
$message = $this->message ?: '';
|
||||||
|
if(!$this->subscribers_errors) {
|
||||||
|
return $message;
|
||||||
|
}
|
||||||
|
|
||||||
|
$message .= $this->message ? ' ' : '';
|
||||||
|
|
||||||
|
if(count($this->subscribers_errors) === 1) {
|
||||||
|
$message .= __('Unprocessed subscriber:', 'mailpoet') . ' ';
|
||||||
|
} else {
|
||||||
|
$message .= __('Unprocessed subscribers:', 'mailpoet') . ' ';
|
||||||
|
}
|
||||||
|
|
||||||
|
$message .= implode(
|
||||||
|
', ',
|
||||||
|
array_map(function (SubscriberError $subscriber_error) {
|
||||||
|
return "($subscriber_error)";
|
||||||
|
}, $this->subscribers_errors)
|
||||||
|
);
|
||||||
|
return $message;
|
||||||
|
}
|
||||||
|
}
|
@ -2,6 +2,7 @@
|
|||||||
namespace MailPoet\Mailer\Methods;
|
namespace MailPoet\Mailer\Methods;
|
||||||
|
|
||||||
use MailPoet\Mailer\Mailer;
|
use MailPoet\Mailer\Mailer;
|
||||||
|
use MailPoet\Mailer\Methods\ErrorMappers\AmazonSESMapper;
|
||||||
use MailPoet\WP\Functions as WPFunctions;
|
use MailPoet\WP\Functions as WPFunctions;
|
||||||
|
|
||||||
if(!defined('ABSPATH')) exit;
|
if(!defined('ABSPATH')) exit;
|
||||||
@ -28,7 +29,18 @@ class AmazonSES {
|
|||||||
'EU (Ireland)' => 'eu-west-1'
|
'EU (Ireland)' => 'eu-west-1'
|
||||||
);
|
);
|
||||||
|
|
||||||
function __construct($region, $access_key, $secret_key, $sender, $reply_to, $return_path) {
|
/** @var AmazonSESMapper */
|
||||||
|
private $error_mapper;
|
||||||
|
|
||||||
|
function __construct(
|
||||||
|
$region,
|
||||||
|
$access_key,
|
||||||
|
$secret_key,
|
||||||
|
$sender,
|
||||||
|
$reply_to,
|
||||||
|
$return_path,
|
||||||
|
AmazonSESMapper $error_mapper
|
||||||
|
) {
|
||||||
$this->aws_access_key = $access_key;
|
$this->aws_access_key = $access_key;
|
||||||
$this->aws_secret_key = $secret_key;
|
$this->aws_secret_key = $secret_key;
|
||||||
$this->aws_region = (in_array($region, $this->available_regions)) ? $region : false;
|
$this->aws_region = (in_array($region, $this->available_regions)) ? $region : false;
|
||||||
@ -48,6 +60,7 @@ class AmazonSES {
|
|||||||
$this->sender['from_email'];
|
$this->sender['from_email'];
|
||||||
$this->date = gmdate('Ymd\THis\Z');
|
$this->date = gmdate('Ymd\THis\Z');
|
||||||
$this->date_without_time = gmdate('Ymd');
|
$this->date_without_time = gmdate('Ymd');
|
||||||
|
$this->error_mapper = $error_mapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
function send($newsletter, $subscriber, $extra_params = array()) {
|
function send($newsletter, $subscriber, $extra_params = array()) {
|
||||||
@ -57,20 +70,17 @@ class AmazonSES {
|
|||||||
$this->request($newsletter, $subscriber, $extra_params)
|
$this->request($newsletter, $subscriber, $extra_params)
|
||||||
);
|
);
|
||||||
} catch(\Exception $e) {
|
} catch(\Exception $e) {
|
||||||
return Mailer::formatMailerSendErrorResult($e->getMessage());
|
$error = $this->error_mapper->getErrorFromException($e, $subscriber);
|
||||||
|
return Mailer::formatMailerErrorResult($error);
|
||||||
}
|
}
|
||||||
if(is_wp_error($result)) {
|
if(is_wp_error($result)) {
|
||||||
return Mailer::formatMailerConnectionErrorResult($result->get_error_message());
|
$error = $this->error_mapper->getConnectionError($result->get_error_message());
|
||||||
|
return Mailer::formatMailerErrorResult($error);
|
||||||
}
|
}
|
||||||
if(WPFunctions::wpRemoteRetrieveResponseCode($result) !== 200) {
|
if(WPFunctions::wpRemoteRetrieveResponseCode($result) !== 200) {
|
||||||
$response = simplexml_load_string(WPFunctions::wpRemoteRetrieveBody($result));
|
$response = simplexml_load_string(WPFunctions::wpRemoteRetrieveBody($result));
|
||||||
$response = ($response) ?
|
$error = $this->error_mapper->getErrorFromResponse($response, $subscriber);
|
||||||
$response->Error->Message->__toString() :
|
return Mailer::formatMailerErrorResult($error);
|
||||||
sprintf(__('%s has returned an unknown error.', 'mailpoet'), Mailer::METHOD_AMAZONSES);
|
|
||||||
if(empty($extra_params['test_email'])) {
|
|
||||||
$response .= sprintf(' %s: %s', __('Unprocessed subscriber', 'mailpoet'), $subscriber);
|
|
||||||
}
|
|
||||||
return Mailer::formatMailerSendErrorResult($response);
|
|
||||||
}
|
}
|
||||||
return Mailer::formatMailerSendSuccessResult();
|
return Mailer::formatMailerSendSuccessResult();
|
||||||
}
|
}
|
||||||
|
36
lib/Mailer/Methods/ErrorMappers/AmazonSESMapper.php
Normal file
36
lib/Mailer/Methods/ErrorMappers/AmazonSESMapper.php
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
namespace MailPoet\Mailer\Methods\ErrorMappers;
|
||||||
|
|
||||||
|
use MailPoet\Mailer\MailerError;
|
||||||
|
use MailPoet\Mailer\Mailer;
|
||||||
|
use MailPoet\Mailer\SubscriberError;
|
||||||
|
|
||||||
|
class AmazonSESMapper {
|
||||||
|
use ConnectionErrorMapperTrait;
|
||||||
|
|
||||||
|
function getErrorFromException(\Exception $e, $subscriber) {
|
||||||
|
$level = MailerError::LEVEL_HARD;
|
||||||
|
if($e instanceof \Swift_RfcComplianceException) {
|
||||||
|
$level = MailerError::LEVEL_SOFT;
|
||||||
|
}
|
||||||
|
$subscriber_errors = [new SubscriberError($subscriber, null)];
|
||||||
|
return new MailerError(MailerError::OPERATION_SEND, $level, $e->getMessage(), null, $subscriber_errors);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see https://docs.aws.amazon.com/ses/latest/DeveloperGuide/api-error-codes.html
|
||||||
|
* @return MailerError
|
||||||
|
*/
|
||||||
|
function getErrorFromResponse($response, $subscriber) {
|
||||||
|
$message = ($response) ?
|
||||||
|
$response->Error->Message->__toString() :
|
||||||
|
sprintf(__('%s has returned an unknown error.', 'mailpoet'), Mailer::METHOD_AMAZONSES);
|
||||||
|
|
||||||
|
$level = MailerError::LEVEL_HARD;
|
||||||
|
if($response && $response->Error->Code->__toString() === 'MessageRejected') {
|
||||||
|
$level = MailerError::LEVEL_SOFT;
|
||||||
|
}
|
||||||
|
$subscriber_errors = [new SubscriberError($subscriber, null)];
|
||||||
|
return new MailerError(MailerError::OPERATION_SEND, $level, $message, null, $subscriber_errors);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
<?php
|
||||||
|
namespace MailPoet\Mailer\Methods\ErrorMappers;
|
||||||
|
|
||||||
|
use MailPoet\Mailer\MailerError;
|
||||||
|
|
||||||
|
trait ConnectionErrorMapperTrait {
|
||||||
|
function getConnectionError($message) {
|
||||||
|
return new MailerError(
|
||||||
|
MailerError::OPERATION_CONNECT,
|
||||||
|
MailerError::LEVEL_HARD,
|
||||||
|
$message
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
77
lib/Mailer/Methods/ErrorMappers/MailPoetMapper.php
Normal file
77
lib/Mailer/Methods/ErrorMappers/MailPoetMapper.php
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
<?php
|
||||||
|
namespace MailPoet\Mailer\Methods\ErrorMappers;
|
||||||
|
|
||||||
|
use MailPoet\Mailer\MailerError;
|
||||||
|
use MailPoet\Mailer\SubscriberError;
|
||||||
|
use MailPoet\Services\Bridge\API;
|
||||||
|
use InvalidArgumentException;
|
||||||
|
|
||||||
|
if(!defined('ABSPATH')) exit;
|
||||||
|
|
||||||
|
class MailPoetMapper {
|
||||||
|
use ConnectionErrorMapperTrait;
|
||||||
|
|
||||||
|
const TEMPORARY_UNAVAILABLE_RETRY_INTERVAL = 300; // seconds
|
||||||
|
|
||||||
|
function getInvalidApiKeyError() {
|
||||||
|
return new MailerError(
|
||||||
|
MailerError::OPERATION_SEND,
|
||||||
|
MailerError::LEVEL_HARD,
|
||||||
|
__('MailPoet API key is invalid!', 'mailpoet')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getErrorForResult(array $result, $subscribers) {
|
||||||
|
$level = MailerError::LEVEL_HARD;
|
||||||
|
$retry_interval = null;
|
||||||
|
$subscribers_errors = [];
|
||||||
|
$result_code = !empty($result['code']) ? $result['code'] : null;
|
||||||
|
|
||||||
|
switch($result_code) {
|
||||||
|
case API::RESPONSE_CODE_NOT_ARRAY:
|
||||||
|
$message = __('JSON input is not an array', 'mailpoet');
|
||||||
|
break;
|
||||||
|
case API::RESPONSE_CODE_PAYLOAD_ERROR:
|
||||||
|
$result_parsed = json_decode($result['message'], true);
|
||||||
|
$message = __('Error while sending.', 'mailpoet');
|
||||||
|
if(!is_array($result_parsed)) {
|
||||||
|
$message .= ' ' . $result['message'];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
$subscribers_errors = $this->getSubscribersErrors($result_parsed, $subscribers);
|
||||||
|
$level = MailerError::LEVEL_SOFT;
|
||||||
|
} catch (InvalidArgumentException $e) {
|
||||||
|
$message .= ' ' . $e->getMessage();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case API::RESPONSE_CODE_TEMPORARY_UNAVAILABLE:
|
||||||
|
$message = __('Email service is temporarily not available, please try again in a few minutes.', 'mailpoet');
|
||||||
|
$retry_interval = self::TEMPORARY_UNAVAILABLE_RETRY_INTERVAL;
|
||||||
|
break;
|
||||||
|
case API::RESPONSE_CODE_KEY_INVALID:
|
||||||
|
case API::RESPONSE_CODE_PAYLOAD_TOO_BIG:
|
||||||
|
default:
|
||||||
|
$message = $result['message'];
|
||||||
|
}
|
||||||
|
return new MailerError(MailerError::OPERATION_SEND, $level, $message, $retry_interval, $subscribers_errors);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getSubscribersErrors($result_parsed, $subscribers) {
|
||||||
|
$errors = [];
|
||||||
|
foreach($result_parsed as $result_error) {
|
||||||
|
if(!is_array($result_error) || !isset($result_error['index']) || !isset($subscribers[$result_error['index']])) {
|
||||||
|
throw new InvalidArgumentException( __('Invalid MSS response format.', 'mailpoet'));
|
||||||
|
}
|
||||||
|
$subscriber_errors = [];
|
||||||
|
if(isset($result_error['errors']) && is_array($result_error['errors'])) {
|
||||||
|
array_walk_recursive($result_error['errors'], function($item) use (&$subscriber_errors) {
|
||||||
|
$subscriber_errors[] = $item;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
$message = join(', ', $subscriber_errors);
|
||||||
|
$errors[] = new SubscriberError($subscribers[$result_error['index']], $message);
|
||||||
|
}
|
||||||
|
return $errors;
|
||||||
|
}
|
||||||
|
}
|
26
lib/Mailer/Methods/ErrorMappers/PHPMailMapper.php
Normal file
26
lib/Mailer/Methods/ErrorMappers/PHPMailMapper.php
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
namespace MailPoet\Mailer\Methods\ErrorMappers;
|
||||||
|
|
||||||
|
use MailPoet\Mailer\MailerError;
|
||||||
|
use MailPoet\Mailer\Mailer;
|
||||||
|
use MailPoet\Mailer\SubscriberError;
|
||||||
|
|
||||||
|
class PHPMailMapper {
|
||||||
|
use ConnectionErrorMapperTrait;
|
||||||
|
|
||||||
|
function getErrorFromException(\Exception $e, $subscriber) {
|
||||||
|
$level = MailerError::LEVEL_HARD;
|
||||||
|
if(strpos($e->getMessage(), 'Invalid address') === 0) {
|
||||||
|
$level = MailerError::LEVEL_SOFT;
|
||||||
|
}
|
||||||
|
|
||||||
|
$subscriber_errors = [new SubscriberError($subscriber, null)];
|
||||||
|
return new MailerError(MailerError::OPERATION_SEND, $level, $e->getMessage(), null, $subscriber_errors);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getErrorForSubscriber($subscriber) {
|
||||||
|
$message = sprintf(__('%s has returned an unknown error.', 'mailpoet'), Mailer::METHOD_PHPMAIL);
|
||||||
|
$subscriber_errors = [new SubscriberError($subscriber, null)];
|
||||||
|
return new MailerError(MailerError::OPERATION_SEND, MailerError::LEVEL_HARD, $message, null, $subscriber_errors);
|
||||||
|
}
|
||||||
|
}
|
40
lib/Mailer/Methods/ErrorMappers/SMTPMapper.php
Normal file
40
lib/Mailer/Methods/ErrorMappers/SMTPMapper.php
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
<?php
|
||||||
|
namespace MailPoet\Mailer\Methods\ErrorMappers;
|
||||||
|
|
||||||
|
use MailPoet\Mailer\MailerError;
|
||||||
|
use MailPoet\Mailer\Mailer;
|
||||||
|
use MailPoet\Mailer\SubscriberError;
|
||||||
|
|
||||||
|
class SMTPMapper {
|
||||||
|
use ConnectionErrorMapperTrait;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see https://swiftmailer.symfony.com/docs/sending.html
|
||||||
|
* @return MailerError
|
||||||
|
*/
|
||||||
|
function getErrorFromException(\Exception $e, $subscriber) {
|
||||||
|
// remove redundant information appended by Swift logger to exception messages
|
||||||
|
$message = explode(PHP_EOL, $e->getMessage());
|
||||||
|
|
||||||
|
$level = MailerError::LEVEL_HARD;
|
||||||
|
if($e instanceof \Swift_RfcComplianceException) {
|
||||||
|
$level = MailerError::LEVEL_SOFT;
|
||||||
|
}
|
||||||
|
$subscriber_errors = [new SubscriberError($subscriber, null)];
|
||||||
|
return new MailerError(MailerError::OPERATION_SEND, $level, $message[0], null, $subscriber_errors);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getErrorFromLog($log, $subscriber) {
|
||||||
|
// extract error message from log
|
||||||
|
preg_match('/!! (.*?)>>/ism', $log, $message);
|
||||||
|
if(!empty($message[1])) {
|
||||||
|
$message = $message[1];
|
||||||
|
// remove line breaks from the message due to how logger's dump() method works
|
||||||
|
$message = preg_replace('/\r|\n/', '', $message);
|
||||||
|
} else {
|
||||||
|
$message = sprintf(__('%s has returned an unknown error.', 'mailpoet'), Mailer::METHOD_SMTP);
|
||||||
|
}
|
||||||
|
$subscriber_errors = [new SubscriberError($subscriber, null)];
|
||||||
|
return new MailerError(MailerError::OPERATION_SEND, MailerError::LEVEL_HARD, $message, null, $subscriber_errors);
|
||||||
|
}
|
||||||
|
}
|
23
lib/Mailer/Methods/ErrorMappers/SendGridMapper.php
Normal file
23
lib/Mailer/Methods/ErrorMappers/SendGridMapper.php
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
namespace MailPoet\Mailer\Methods\ErrorMappers;
|
||||||
|
|
||||||
|
use MailPoet\Mailer\MailerError;
|
||||||
|
use MailPoet\Mailer\Mailer;
|
||||||
|
use MailPoet\Mailer\SubscriberError;
|
||||||
|
|
||||||
|
class SendGridMapper {
|
||||||
|
use ConnectionErrorMapperTrait;
|
||||||
|
|
||||||
|
function getErrorFromResponse($response, $subscriber) {
|
||||||
|
$response = (!empty($response['errors'][0])) ?
|
||||||
|
$response['errors'][0] :
|
||||||
|
sprintf(__('%s has returned an unknown error.', 'mailpoet'), Mailer::METHOD_SENDGRID);
|
||||||
|
|
||||||
|
$level = MailerError::LEVEL_HARD;
|
||||||
|
if(strpos($response, 'Invalid email address') === 0) {
|
||||||
|
$level = MailerError::LEVEL_SOFT;
|
||||||
|
}
|
||||||
|
$subscriber_errors = [new SubscriberError($subscriber, null)];
|
||||||
|
return new MailerError(MailerError::OPERATION_SEND, $level, $response, null, $subscriber_errors);
|
||||||
|
}
|
||||||
|
}
|
@ -3,31 +3,32 @@ namespace MailPoet\Mailer\Methods;
|
|||||||
|
|
||||||
use MailPoet\Mailer\Mailer;
|
use MailPoet\Mailer\Mailer;
|
||||||
use MailPoet\Config\ServicesChecker;
|
use MailPoet\Config\ServicesChecker;
|
||||||
|
use MailPoet\Mailer\Methods\ErrorMappers\MailPoetMapper;
|
||||||
use MailPoet\Services\Bridge;
|
use MailPoet\Services\Bridge;
|
||||||
use MailPoet\Services\Bridge\API;
|
use MailPoet\Services\Bridge\API;
|
||||||
|
|
||||||
if(!defined('ABSPATH')) exit;
|
if(!defined('ABSPATH')) exit;
|
||||||
|
|
||||||
class MailPoet {
|
class MailPoet {
|
||||||
|
|
||||||
const TEMPORARY_UNAVAILABLE_RETRY_INTERVAL = 300; // seconds
|
|
||||||
|
|
||||||
public $api;
|
public $api;
|
||||||
public $sender;
|
public $sender;
|
||||||
public $reply_to;
|
public $reply_to;
|
||||||
public $services_checker;
|
public $services_checker;
|
||||||
|
|
||||||
function __construct($api_key, $sender, $reply_to) {
|
/** @var MailPoetMapper */
|
||||||
|
private $error_mapper;
|
||||||
|
|
||||||
|
function __construct($api_key, $sender, $reply_to, MailPoetMapper $error_mapper) {
|
||||||
$this->api = new API($api_key);
|
$this->api = new API($api_key);
|
||||||
$this->sender = $sender;
|
$this->sender = $sender;
|
||||||
$this->reply_to = $reply_to;
|
$this->reply_to = $reply_to;
|
||||||
$this->services_checker = new ServicesChecker(false);
|
$this->services_checker = new ServicesChecker();
|
||||||
|
$this->error_mapper = $error_mapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
function send($newsletter, $subscriber, $extra_params = array()) {
|
function send($newsletter, $subscriber, $extra_params = array()) {
|
||||||
if($this->services_checker->isMailPoetAPIKeyValid() === false) {
|
if($this->services_checker->isMailPoetAPIKeyValid() === false) {
|
||||||
$response = __('MailPoet API key is invalid!', 'mailpoet');
|
return Mailer::formatMailerErrorResult($this->error_mapper->getInvalidApiKeyError());
|
||||||
return Mailer::formatMailerSendErrorResult($response);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$message_body = $this->getBody($newsletter, $subscriber, $extra_params);
|
$message_body = $this->getBody($newsletter, $subscriber, $extra_params);
|
||||||
@ -35,9 +36,11 @@ class MailPoet {
|
|||||||
|
|
||||||
switch($result['status']) {
|
switch($result['status']) {
|
||||||
case API::SENDING_STATUS_CONNECTION_ERROR:
|
case API::SENDING_STATUS_CONNECTION_ERROR:
|
||||||
return Mailer::formatMailerConnectionErrorResult($result['message']);
|
$error = $this->error_mapper->getConnectionError($result['message']);
|
||||||
|
return Mailer::formatMailerErrorResult($error);
|
||||||
case API::SENDING_STATUS_SEND_ERROR:
|
case API::SENDING_STATUS_SEND_ERROR:
|
||||||
return $this->processSendError($result, $subscriber);
|
$error = $this->processSendError($result, $subscriber);
|
||||||
|
return Mailer::formatMailerErrorResult($error);
|
||||||
case API::SENDING_STATUS_OK:
|
case API::SENDING_STATUS_OK:
|
||||||
default:
|
default:
|
||||||
return Mailer::formatMailerSendSuccessResult();
|
return Mailer::formatMailerSendSuccessResult();
|
||||||
@ -45,27 +48,10 @@ class MailPoet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function processSendError($result, $subscriber) {
|
function processSendError($result, $subscriber) {
|
||||||
if(!empty($result['code'])) {
|
if(!empty($result['code']) && $result['code'] === API::RESPONSE_CODE_KEY_INVALID) {
|
||||||
switch($result['code']) {
|
Bridge::invalidateKey();
|
||||||
case API::RESPONSE_CODE_NOT_ARRAY:
|
|
||||||
return Mailer::formatMailerSendErrorResult(__('JSON input is not an array', 'mailpoet'));
|
|
||||||
case API::RESPONSE_CODE_PAYLOAD_TOO_BIG:
|
|
||||||
return Mailer::formatMailerSendErrorResult($result['message']);
|
|
||||||
case API::RESPONSE_CODE_PAYLOAD_ERROR:
|
|
||||||
$error = $this->parseErrorResponse($result['message'], $subscriber);
|
|
||||||
return Mailer::formatMailerSendErrorResult($error);
|
|
||||||
case API::RESPONSE_CODE_TEMPORARY_UNAVAILABLE:
|
|
||||||
$error = Mailer::formatMailerSendErrorResult(__('Email service is temporarily not available, please try again in a few minutes.', 'mailpoet'));
|
|
||||||
$error['retry_interval'] = self::TEMPORARY_UNAVAILABLE_RETRY_INTERVAL;
|
|
||||||
return $error;
|
|
||||||
case API::RESPONSE_CODE_KEY_INVALID:
|
|
||||||
Bridge::invalidateKey();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return Mailer::formatMailerSendErrorResult($result['message']);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return Mailer::formatMailerSendErrorResult($result['message']);
|
return $this->error_mapper->getErrorForResult($result, $subscriber);
|
||||||
}
|
}
|
||||||
|
|
||||||
function processSubscriber($subscriber) {
|
function processSubscriber($subscriber) {
|
||||||
@ -128,37 +114,4 @@ class MailPoet {
|
|||||||
}
|
}
|
||||||
return $body;
|
return $body;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function parseErrorResponse($result, $subscriber) {
|
|
||||||
$result_parsed = json_decode($result, true);
|
|
||||||
$errors = [];
|
|
||||||
if(is_array($result_parsed)) {
|
|
||||||
foreach($result_parsed as $result_error) {
|
|
||||||
$errors[] = $this->processSingleSubscriberError($result_error, $subscriber);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(!empty($errors)) {
|
|
||||||
return __('Error while sending: ', 'mailpoet') . join(', ', $errors);
|
|
||||||
} else {
|
|
||||||
return __('Error while sending newsletters. ', 'mailpoet') . $result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private function processSingleSubscriberError($result_error, $subscriber) {
|
|
||||||
$error = '';
|
|
||||||
if(is_array($result_error)) {
|
|
||||||
$subscriber_errors = [];
|
|
||||||
if(isset($result_error['errors']) && is_array($result_error['errors'])) {
|
|
||||||
array_walk_recursive($result_error['errors'], function($item) use (&$subscriber_errors) {
|
|
||||||
$subscriber_errors[] = $item;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
$error .= join(', ', $subscriber_errors);
|
|
||||||
|
|
||||||
if(isset($result_error['index']) && isset($subscriber[$result_error['index']])) {
|
|
||||||
$error = '(' . $subscriber[$result_error['index']] . ': ' . $error . ')';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $error;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
namespace MailPoet\Mailer\Methods;
|
namespace MailPoet\Mailer\Methods;
|
||||||
|
|
||||||
use MailPoet\Mailer\Mailer;
|
use MailPoet\Mailer\Mailer;
|
||||||
|
use MailPoet\Mailer\Methods\ErrorMappers\PHPMailMapper;
|
||||||
|
|
||||||
if(!defined('ABSPATH')) exit;
|
if(!defined('ABSPATH')) exit;
|
||||||
|
|
||||||
@ -14,13 +15,17 @@ class PHPMail {
|
|||||||
public $return_path;
|
public $return_path;
|
||||||
public $mailer;
|
public $mailer;
|
||||||
|
|
||||||
function __construct($sender, $reply_to, $return_path) {
|
/** @var PHPMailMapper */
|
||||||
|
private $error_mapper;
|
||||||
|
|
||||||
|
function __construct($sender, $reply_to, $return_path, PHPMailMapper $error_mapper) {
|
||||||
$this->sender = $sender;
|
$this->sender = $sender;
|
||||||
$this->reply_to = $reply_to;
|
$this->reply_to = $reply_to;
|
||||||
$this->return_path = ($return_path) ?
|
$this->return_path = ($return_path) ?
|
||||||
$return_path :
|
$return_path :
|
||||||
$this->sender['from_email'];
|
$this->sender['from_email'];
|
||||||
$this->mailer = $this->buildMailer();
|
$this->mailer = $this->buildMailer();
|
||||||
|
$this->error_mapper = $error_mapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
function send($newsletter, $subscriber, $extra_params = array()) {
|
function send($newsletter, $subscriber, $extra_params = array()) {
|
||||||
@ -28,16 +33,13 @@ class PHPMail {
|
|||||||
$mailer = $this->configureMailerWithMessage($newsletter, $subscriber, $extra_params);
|
$mailer = $this->configureMailerWithMessage($newsletter, $subscriber, $extra_params);
|
||||||
$result = $mailer->send();
|
$result = $mailer->send();
|
||||||
} catch(\Exception $e) {
|
} catch(\Exception $e) {
|
||||||
return Mailer::formatMailerSendErrorResult($e->getMessage());
|
return Mailer::formatMailerErrorResult($this->error_mapper->getErrorFromException($e, $subscriber));
|
||||||
}
|
}
|
||||||
if($result === true) {
|
if($result === true) {
|
||||||
return Mailer::formatMailerSendSuccessResult();
|
return Mailer::formatMailerSendSuccessResult();
|
||||||
} else {
|
} else {
|
||||||
$result = sprintf(__('%s has returned an unknown error.', 'mailpoet'), Mailer::METHOD_PHPMAIL);
|
$error = $this->error_mapper->getErrorForSubscriber($subscriber);
|
||||||
if(empty($extra_params['test_email'])) {
|
return Mailer::formatMailerErrorResult($error);
|
||||||
$result .= sprintf(' %s: %s', __('Unprocessed subscriber', 'mailpoet'), $subscriber);
|
|
||||||
}
|
|
||||||
return Mailer::formatMailerSendErrorResult($result);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,4 +82,4 @@ class PHPMail {
|
|||||||
'name' => (isset($subscriber_data['name'])) ? $subscriber_data['name'] : ''
|
'name' => (isset($subscriber_data['name'])) ? $subscriber_data['name'] : ''
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
namespace MailPoet\Mailer\Methods;
|
namespace MailPoet\Mailer\Methods;
|
||||||
|
|
||||||
use MailPoet\Mailer\Mailer;
|
use MailPoet\Mailer\Mailer;
|
||||||
|
use MailPoet\Mailer\Methods\ErrorMappers\SMTPMapper;
|
||||||
use MailPoet\WP\Hooks;
|
use MailPoet\WP\Hooks;
|
||||||
|
|
||||||
if(!defined('ABSPATH')) exit;
|
if(!defined('ABSPATH')) exit;
|
||||||
@ -19,9 +20,12 @@ class SMTP {
|
|||||||
public $mailer;
|
public $mailer;
|
||||||
const SMTP_CONNECTION_TIMEOUT = 15; // seconds
|
const SMTP_CONNECTION_TIMEOUT = 15; // seconds
|
||||||
|
|
||||||
|
/** @var SMTPMapper */
|
||||||
|
private $error_mapper;
|
||||||
|
|
||||||
function __construct(
|
function __construct(
|
||||||
$host, $port, $authentication, $login = null, $password = null, $encryption,
|
$host, $port, $authentication, $login = null, $password = null, $encryption,
|
||||||
$sender, $reply_to, $return_path) {
|
$sender, $reply_to, $return_path, SMTPMapper $error_mapper) {
|
||||||
$this->host = $host;
|
$this->host = $host;
|
||||||
$this->port = $port;
|
$this->port = $port;
|
||||||
$this->authentication = $authentication;
|
$this->authentication = $authentication;
|
||||||
@ -36,6 +40,7 @@ class SMTP {
|
|||||||
$this->mailer = $this->buildMailer();
|
$this->mailer = $this->buildMailer();
|
||||||
$this->mailer_logger = new \Swift_Plugins_Loggers_ArrayLogger();
|
$this->mailer_logger = new \Swift_Plugins_Loggers_ArrayLogger();
|
||||||
$this->mailer->registerPlugin(new \Swift_Plugins_LoggerPlugin($this->mailer_logger));
|
$this->mailer->registerPlugin(new \Swift_Plugins_LoggerPlugin($this->mailer_logger));
|
||||||
|
$this->error_mapper = $error_mapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
function send($newsletter, $subscriber, $extra_params = array()) {
|
function send($newsletter, $subscriber, $extra_params = array()) {
|
||||||
@ -43,13 +48,16 @@ class SMTP {
|
|||||||
$message = $this->createMessage($newsletter, $subscriber, $extra_params);
|
$message = $this->createMessage($newsletter, $subscriber, $extra_params);
|
||||||
$result = $this->mailer->send($message);
|
$result = $this->mailer->send($message);
|
||||||
} catch(\Exception $e) {
|
} catch(\Exception $e) {
|
||||||
return Mailer::formatMailerSendErrorResult(
|
return Mailer::formatMailerErrorResult(
|
||||||
$this->processExceptionMessage($e->getMessage())
|
$this->error_mapper->getErrorFromException($e, $subscriber)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return ($result === 1) ?
|
if($result === 1) {
|
||||||
Mailer::formatMailerSendSuccessResult() :
|
return Mailer::formatMailerSendSuccessResult();
|
||||||
Mailer::formatMailerSendErrorResult($this->processLogMessage($subscriber, $extra_params));
|
} else {
|
||||||
|
$error = $this->error_mapper->getErrorFromLog($this->mailer_logger->dump(), $subscriber);
|
||||||
|
return Mailer::formatMailerErrorResult($error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildMailer() {
|
function buildMailer() {
|
||||||
@ -107,27 +115,4 @@ class SMTP {
|
|||||||
(isset($subscriber_data['name'])) ? $subscriber_data['name'] : ''
|
(isset($subscriber_data['name'])) ? $subscriber_data['name'] : ''
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function processLogMessage($subscriber, $extra_params = array(), $log = false) {
|
|
||||||
$log = ($log) ? $log : $this->mailer_logger->dump();
|
|
||||||
// extract error message from log
|
|
||||||
preg_match('/!! (.*?)>>/ism', $log, $message);
|
|
||||||
if(!empty($message[1])) {
|
|
||||||
$message = $message[1];
|
|
||||||
// remove line breaks from the message due to how logger's dump() method works
|
|
||||||
$message = preg_replace('/\r|\n/', '', $message);
|
|
||||||
} else {
|
|
||||||
$message = sprintf(__('%s has returned an unknown error.', 'mailpoet'), Mailer::METHOD_SMTP);
|
|
||||||
}
|
|
||||||
if(empty($extra_params['test_email'])) {
|
|
||||||
$message .= sprintf(' %s: %s', __('Unprocessed subscriber', 'mailpoet'), $subscriber);
|
|
||||||
}
|
|
||||||
return $message;
|
|
||||||
}
|
|
||||||
|
|
||||||
function processExceptionMessage($message) {
|
|
||||||
// remove redundant information appended by Swift logger to exception messages
|
|
||||||
$message = explode(PHP_EOL, $message);
|
|
||||||
return $message[0];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
namespace MailPoet\Mailer\Methods;
|
namespace MailPoet\Mailer\Methods;
|
||||||
|
|
||||||
use MailPoet\Mailer\Mailer;
|
use MailPoet\Mailer\Mailer;
|
||||||
|
use MailPoet\Mailer\Methods\ErrorMappers\SendGridMapper;
|
||||||
use MailPoet\WP\Functions as WPFunctions;
|
use MailPoet\WP\Functions as WPFunctions;
|
||||||
|
|
||||||
if(!defined('ABSPATH')) exit;
|
if(!defined('ABSPATH')) exit;
|
||||||
@ -13,10 +14,14 @@ class SendGrid {
|
|||||||
public $sender;
|
public $sender;
|
||||||
public $reply_to;
|
public $reply_to;
|
||||||
|
|
||||||
function __construct($api_key, $sender, $reply_to) {
|
/** @var SendGridMapper */
|
||||||
|
private $error_mapper;
|
||||||
|
|
||||||
|
function __construct($api_key, $sender, $reply_to, SendGridMapper $error_mapper) {
|
||||||
$this->api_key = $api_key;
|
$this->api_key = $api_key;
|
||||||
$this->sender = $sender;
|
$this->sender = $sender;
|
||||||
$this->reply_to = $reply_to;
|
$this->reply_to = $reply_to;
|
||||||
|
$this->error_mapper = $error_mapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
function send($newsletter, $subscriber, $extra_params = array()) {
|
function send($newsletter, $subscriber, $extra_params = array()) {
|
||||||
@ -25,17 +30,13 @@ class SendGrid {
|
|||||||
$this->request($newsletter, $subscriber, $extra_params)
|
$this->request($newsletter, $subscriber, $extra_params)
|
||||||
);
|
);
|
||||||
if(is_wp_error($result)) {
|
if(is_wp_error($result)) {
|
||||||
return Mailer::formatMailerConnectionErrorResult($result->get_error_message());
|
$error = $this->error_mapper->getConnectionError($result->get_error_message());
|
||||||
|
return Mailer::formatMailerErrorResult($error);
|
||||||
}
|
}
|
||||||
if(WPFunctions::wpRemoteRetrieveResponseCode($result) !== 200) {
|
if(WPFunctions::wpRemoteRetrieveResponseCode($result) !== 200) {
|
||||||
$response = json_decode($result['body'], true);
|
$response = json_decode($result['body'], true);
|
||||||
$response = (!empty($response['errors'][0])) ?
|
$error = $this->error_mapper->getErrorFromResponse($response, $subscriber);
|
||||||
$response['errors'][0] :
|
return Mailer::formatMailerErrorResult($error);
|
||||||
sprintf(__('%s has returned an unknown error.', 'mailpoet'), Mailer::METHOD_SENDGRID);
|
|
||||||
if(empty($extra_params['test_email'])) {
|
|
||||||
$response .= sprintf(' %s: %s', __('Unprocessed subscriber', 'mailpoet'), $subscriber);
|
|
||||||
}
|
|
||||||
return Mailer::formatMailerSendErrorResult($response);
|
|
||||||
}
|
}
|
||||||
return Mailer::formatMailerSendSuccessResult();
|
return Mailer::formatMailerSendSuccessResult();
|
||||||
}
|
}
|
||||||
@ -80,4 +81,4 @@ class SendGrid {
|
|||||||
'body' => http_build_query($body, null, '&')
|
'body' => http_build_query($body, null, '&')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
38
lib/Mailer/SubscriberError.php
Normal file
38
lib/Mailer/SubscriberError.php
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
<?php
|
||||||
|
namespace MailPoet\Mailer;
|
||||||
|
|
||||||
|
class SubscriberError {
|
||||||
|
|
||||||
|
/** @var string */
|
||||||
|
private $email;
|
||||||
|
|
||||||
|
/** @var string|null */
|
||||||
|
private $message;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $email
|
||||||
|
* @param string $message|null
|
||||||
|
*/
|
||||||
|
function __construct($email, $message = null) {
|
||||||
|
$this->email = $email;
|
||||||
|
$this->message = $message;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function getEmail() {
|
||||||
|
return $this->email;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return null|string
|
||||||
|
*/
|
||||||
|
function getMessage() {
|
||||||
|
return $this->message;
|
||||||
|
}
|
||||||
|
|
||||||
|
function __toString() {
|
||||||
|
return $this->message ? $this->email . ': ' . $this->message : $this->email;
|
||||||
|
}
|
||||||
|
}
|
@ -556,6 +556,19 @@ class Newsletter extends Model {
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function wasScheduledForSubscriber($subscriber_id) {
|
||||||
|
$count = (int)SendingQueue::rawQuery(
|
||||||
|
"SELECT COUNT(*) as count
|
||||||
|
FROM `" . SendingQueue::$_table . "`
|
||||||
|
JOIN `" . ScheduledTask::$_table . "` ON " . SendingQueue::$_table . ".task_id = " . ScheduledTask::$_table . ".id
|
||||||
|
JOIN `" . ScheduledTaskSubscriber::$_table . "` ON " . ScheduledTask::$_table . ".id = " . ScheduledTaskSubscriber::$_table . ".task_id
|
||||||
|
WHERE " . ScheduledTaskSubscriber::$_table . ".subscriber_id = " . $subscriber_id . "
|
||||||
|
AND " . SendingQueue::$_table . ".newsletter_id = " . $this->id
|
||||||
|
)->findOne()->count;
|
||||||
|
|
||||||
|
return $count > 0;
|
||||||
|
}
|
||||||
|
|
||||||
static function getAnalytics() {
|
static function getAnalytics() {
|
||||||
$welcome_newsletters_count = Newsletter::getPublished()
|
$welcome_newsletters_count = Newsletter::getPublished()
|
||||||
->filter('filterType', self::TYPE_WELCOME)
|
->filter('filterType', self::TYPE_WELCOME)
|
||||||
|
@ -76,6 +76,18 @@ class ScheduledTask extends Model {
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function delete() {
|
||||||
|
try {
|
||||||
|
\ORM::get_db()->beginTransaction();
|
||||||
|
ScheduledTaskSubscriber::where('task_id', $this->id)->deleteMany();
|
||||||
|
parent::delete();
|
||||||
|
\ORM::get_db()->commit();
|
||||||
|
} catch(\Exception $error) {
|
||||||
|
\ORM::get_db()->rollBack();
|
||||||
|
throw $error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static function touchAllByIds(array $ids) {
|
static function touchAllByIds(array $ids) {
|
||||||
ScheduledTask::rawExecute(
|
ScheduledTask::rawExecute(
|
||||||
'UPDATE `' . ScheduledTask::$_table . '`' .
|
'UPDATE `' . ScheduledTask::$_table . '`' .
|
||||||
|
@ -7,6 +7,9 @@ class ScheduledTaskSubscriber extends Model {
|
|||||||
const STATUS_UNPROCESSED = 0;
|
const STATUS_UNPROCESSED = 0;
|
||||||
const STATUS_PROCESSED = 1;
|
const STATUS_PROCESSED = 1;
|
||||||
|
|
||||||
|
const FAIL_STATUS_OK = 0;
|
||||||
|
const FAIL_STATUS_FAILED = 1;
|
||||||
|
|
||||||
public static $_table = MP_SCHEDULED_TASK_SUBSCRIBERS_TABLE;
|
public static $_table = MP_SCHEDULED_TASK_SUBSCRIBERS_TABLE;
|
||||||
public static $_id_column = array('task_id', 'subscriber_id');
|
public static $_id_column = array('task_id', 'subscriber_id');
|
||||||
|
|
||||||
@ -19,6 +22,7 @@ class ScheduledTaskSubscriber extends Model {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$data['processed'] = !empty($data['processed']) ? self::STATUS_PROCESSED : self::STATUS_UNPROCESSED;
|
$data['processed'] = !empty($data['processed']) ? self::STATUS_PROCESSED : self::STATUS_UNPROCESSED;
|
||||||
|
$data['failed'] = !empty($data['failed']) ? self::FAIL_STATUS_FAILED : self::FAIL_STATUS_OK;
|
||||||
return parent::_createOrUpdate($data, array(
|
return parent::_createOrUpdate($data, array(
|
||||||
'subscriber_id' => $data['subscriber_id'],
|
'subscriber_id' => $data['subscriber_id'],
|
||||||
'task_id' => $data['task_id']
|
'task_id' => $data['task_id']
|
||||||
|
@ -53,7 +53,10 @@ class Setting extends Model {
|
|||||||
),
|
),
|
||||||
'analytics' => array(
|
'analytics' => array(
|
||||||
'enabled' => false,
|
'enabled' => false,
|
||||||
)
|
),
|
||||||
|
'in_app_announcements' => [
|
||||||
|
'displayed' => []
|
||||||
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace MailPoet\Newsletter;
|
namespace MailPoet\Newsletter;
|
||||||
|
|
||||||
|
use MailPoet\Logging\Logger;
|
||||||
use MailPoet\Newsletter\Editor\Transformer;
|
use MailPoet\Newsletter\Editor\Transformer;
|
||||||
|
|
||||||
if(!defined('ABSPATH')) exit;
|
if(!defined('ABSPATH')) exit;
|
||||||
@ -29,6 +30,10 @@ class AutomatedLatestContent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getPosts($args, $posts_to_exclude = array()) {
|
function getPosts($args, $posts_to_exclude = array()) {
|
||||||
|
Logger::getLogger('post-notifications')->addInfo(
|
||||||
|
'loading automated latest content',
|
||||||
|
['args' => $args, 'posts_to_exclude' => $posts_to_exclude, 'newsletter_id' => $this->newsletter_id, 'newer_than_timestamp' => $this->newer_than_timestamp]
|
||||||
|
);
|
||||||
$posts_per_page = (!empty($args['amount']) && (int)$args['amount'] > 0)
|
$posts_per_page = (!empty($args['amount']) && (int)$args['amount'] > 0)
|
||||||
? (int)$args['amount']
|
? (int)$args['amount']
|
||||||
: self::DEFAULT_POSTS_PER_PAGE;
|
: self::DEFAULT_POSTS_PER_PAGE;
|
||||||
@ -70,7 +75,14 @@ class AutomatedLatestContent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->_attachSentPostsFilter();
|
$this->_attachSentPostsFilter();
|
||||||
|
|
||||||
|
Logger::getLogger('post-notifications')->addInfo(
|
||||||
|
'getting automated latest content',
|
||||||
|
['parameters' => $parameters]
|
||||||
|
);
|
||||||
$posts = get_posts($parameters);
|
$posts = get_posts($parameters);
|
||||||
|
$this->logPosts($posts);
|
||||||
|
|
||||||
$this->_detachSentPostsFilter();
|
$this->_detachSentPostsFilter();
|
||||||
return $posts;
|
return $posts;
|
||||||
}
|
}
|
||||||
@ -126,4 +138,18 @@ class AutomatedLatestContent {
|
|||||||
remove_action('posts_where', array($this, 'filterOutSentPosts'));
|
remove_action('posts_where', array($this, 'filterOutSentPosts'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function logPosts(array $posts) {
|
||||||
|
$posts_to_log = [];
|
||||||
|
foreach($posts as $post) {
|
||||||
|
$posts_to_log[] = [
|
||||||
|
'id' => $post->ID,
|
||||||
|
'post_date' => $post->post_date,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
Logger::getLogger('post-notifications')->addInfo(
|
||||||
|
'automated latest content loaded posts',
|
||||||
|
['posts' => $posts_to_log]
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
namespace MailPoet\Newsletter\Scheduler;
|
namespace MailPoet\Newsletter\Scheduler;
|
||||||
|
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
|
use MailPoet\Logging\Logger;
|
||||||
use MailPoet\Models\Newsletter;
|
use MailPoet\Models\Newsletter;
|
||||||
use MailPoet\Models\NewsletterOption;
|
use MailPoet\Models\NewsletterOption;
|
||||||
use MailPoet\Models\NewsletterOptionField;
|
use MailPoet\Models\NewsletterOptionField;
|
||||||
@ -23,6 +24,10 @@ class Scheduler {
|
|||||||
const INTERVAL_NTHWEEKDAY = 'nthWeekDay';
|
const INTERVAL_NTHWEEKDAY = 'nthWeekDay';
|
||||||
|
|
||||||
static function schedulePostNotification($post_id) {
|
static function schedulePostNotification($post_id) {
|
||||||
|
Logger::getLogger('post-notifications')->addInfo(
|
||||||
|
'schedule post notification hook',
|
||||||
|
['post_id' => $post_id]
|
||||||
|
);
|
||||||
$newsletters = self::getNewsletters(Newsletter::TYPE_NOTIFICATION);
|
$newsletters = self::getNewsletters(Newsletter::TYPE_NOTIFICATION);
|
||||||
if(!count($newsletters)) return false;
|
if(!count($newsletters)) return false;
|
||||||
foreach($newsletters as $newsletter) {
|
foreach($newsletters as $newsletter) {
|
||||||
@ -143,6 +148,10 @@ class Scheduler {
|
|||||||
$sending_task->status = SendingQueue::STATUS_SCHEDULED;
|
$sending_task->status = SendingQueue::STATUS_SCHEDULED;
|
||||||
$sending_task->scheduled_at = $next_run_date;
|
$sending_task->scheduled_at = $next_run_date;
|
||||||
$sending_task->save();
|
$sending_task->save();
|
||||||
|
Logger::getLogger('post-notifications')->addInfo(
|
||||||
|
'schedule post notification',
|
||||||
|
['sending_task' => $sending_task->id(), 'scheduled_at' => $next_run_date]
|
||||||
|
);
|
||||||
return $sending_task;
|
return $sending_task;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ namespace MailPoet\Router\Endpoints;
|
|||||||
|
|
||||||
use MailPoet\Config\AccessControl;
|
use MailPoet\Config\AccessControl;
|
||||||
use MailPoet\Cron\CronHelper;
|
use MailPoet\Cron\CronHelper;
|
||||||
use MailPoet\Cron\Daemon;
|
use MailPoet\Cron\DaemonHttpRunner;
|
||||||
|
|
||||||
if(!defined('ABSPATH')) exit;
|
if(!defined('ABSPATH')) exit;
|
||||||
|
|
||||||
@ -28,7 +28,7 @@ class CronDaemon {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function run() {
|
function run() {
|
||||||
$queue = new Daemon($this->data);
|
$queue = new DaemonHttpRunner($this->data);
|
||||||
$queue->run();
|
$queue->run();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ class CronDaemon {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function pingResponse() {
|
function pingResponse() {
|
||||||
$queue = new Daemon();
|
$queue = new DaemonHttpRunner();
|
||||||
$queue->ping();
|
$queue->ping();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ class NewsletterClicksExporter {
|
|||||||
'value' => $row['created_at'],
|
'value' => $row['created_at'],
|
||||||
);
|
);
|
||||||
$newsletter_data[] = array(
|
$newsletter_data[] = array(
|
||||||
'name' => __('Url', 'mailpoet'),
|
'name' => __('URL', 'mailpoet'),
|
||||||
'value' => $row['url'],
|
'value' => $row['url'],
|
||||||
);
|
);
|
||||||
return array(
|
return array(
|
||||||
@ -56,4 +56,4 @@ class NewsletterClicksExporter {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -166,6 +166,11 @@ class Sending {
|
|||||||
return $this->updateCount()->getErrors() === false;
|
return $this->updateCount()->getErrors() === false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function saveSubscriberError($subcriber_id, $error_message) {
|
||||||
|
$this->task_subscribers->saveSubscriberError($subcriber_id, $error_message);
|
||||||
|
return $this->updateCount()->getErrors() === false;
|
||||||
|
}
|
||||||
|
|
||||||
function updateCount() {
|
function updateCount() {
|
||||||
$this->queue->count_processed = ScheduledTaskSubscriber::getProcessedCount($this->task->id);
|
$this->queue->count_processed = ScheduledTaskSubscriber::getProcessedCount($this->task->id);
|
||||||
$this->queue->count_to_process = ScheduledTaskSubscriber::getUnprocessedCount($this->task->id);
|
$this->queue->count_to_process = ScheduledTaskSubscriber::getUnprocessedCount($this->task->id);
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user