Compare commits

..

78 Commits

Author SHA1 Message Date
fe8452711f Bump up release version to 3.0.0-beta.36.2.0 2017-07-04 18:14:04 +03:00
f7cb53de2c Fix composer.lock (remove AspectMock from prod dependencies) 2017-07-04 18:13:17 +03:00
b1425198b6 Merge pull request #967 from mailpoet/subscription_form_unit_test
Adds test for subscription form submission class [MAILPOET-961]
2017-07-04 14:46:26 +03:00
00a45f3214 Make Codeception report all errors (incl. E_STRICT and E_DEPRECATED) when running tests [MAILPOET-961] 2017-07-04 14:30:15 +03:00
8e46451337 Fixes non static methods called statically (good practice + PHP 7
compatibility)
2017-07-03 19:39:11 -04:00
b0d0cc09c8 Programmatically sets input width after Select2 initialization
[MAILPOET-973]
2017-07-03 17:05:06 +01:00
af559a6fac Merge pull request #971 from mailpoet/tests_qa
Add a copy of MailPoet PHP coding standard for tests [MAILPOET-981]
2017-07-03 18:03:43 +03:00
67acceb968 Merge pull request #965 from mailpoet/posts_dynamic_loading
Add dynamic post loading in Posts widget settings [MAILPOET-971]
2017-07-03 17:18:12 +03:00
703ee7ff71 Fix line breaks in tests [MAILPOET-981] 2017-07-03 16:29:21 +03:00
29491dfd3e Fix active coding standard rule violations in tests [MAILPOET-981] 2017-07-03 16:20:44 +03:00
a49a230983 Disable a few failing rules for further fixing [MAILPOET-981] 2017-07-03 14:57:48 +03:00
b8d285a1d9 Add a copy of MailPoet PHP coding standard for tests [MAILPOET-981] 2017-07-03 14:54:04 +03:00
d5227a9f2c Add tests for PDO exceptions rethrowing [MAILPOET-966] 2017-07-03 10:59:38 +01:00
693117eb40 Merge pull request #964 from mailpoet/add-help
Add help [MAILPOET-949]
2017-07-03 12:06:51 +03:00
f3aab6095e Standardizes helper string look (https://goo.gl/r3jqJ8) 2017-07-03 09:35:01 +01:00
d70587a550 Adds helper text to the bottom of forms view 2017-07-03 09:35:01 +01:00
82226f2c36 Updates existing code that replaces links with the new "replaceLink"
filter
2017-07-03 09:35:01 +01:00
2774101380 Adds Twig filter to replace [link] tags inside strings
Adds unit tests
2017-07-03 09:35:01 +01:00
ee0e3ff95e Move <h1> from react
Wordpress moves admin notices bellow the first heading. If we re-render
our heading inside react router we remove those notices. This way the
admin notice stays in the page.

[MAILPOET-949]
2017-07-03 09:08:30 +01:00
17584dde43 Fix help rendering
[MAILPOET-949]
2017-07-03 08:39:02 +01:00
3ac416de56 Allows passing request data to form submission class
Adds unit tests
2017-07-01 11:17:04 -04:00
1e4c00169f Adds AspectMock library to mock static methods/etc. 2017-07-01 11:15:15 -04:00
11bbf54aad Merge pull request #963 from mailpoet/new-templates
New templates [MAILPOET-922]
2017-06-30 11:37:29 -04:00
688e78560e Add minor corrections [MAILPOET-949] 2017-06-30 12:47:47 +03:00
5ca577a718 Fix lint errors [MAILPOET-966] 2017-06-30 09:29:48 +01:00
605df7dff1 Don't open a second (actually, third) DB connection [MAILPOET-966] 2017-06-30 09:29:48 +01:00
fb1a3a80ff Catch a DB connection exception earlier [MAILPOET-966] 2017-06-30 09:29:48 +01:00
d3db755489 Handle exceptions during initialization better [MAILPOET-966] 2017-06-30 09:29:48 +01:00
a4282b6a3e Don't leak connection data in PDO exceptions [MAILPOET-966] 2017-06-30 09:29:48 +01:00
bc17984030 Fix coffee shop template
[MAILPOET-922]
2017-06-30 09:19:26 +01:00
b823991867 Fix lint errors [MAILPOET-971] 2017-06-29 16:45:12 +03:00
04e238634d Add unit tests [MAILPOET-971] 2017-06-29 15:34:26 +03:00
eba482cc67 Add dynamic post loading in Posts widget settings [MAILPOET-971] 2017-06-29 13:13:36 +03:00
e6663f0f3e Hide a horizontal scrollbar in Posts widget listing [MAILPOET-971] 2017-06-29 13:13:23 +03:00
7fa94a67c9 Add data to system info help page
[MAILPOET-949]
2017-06-29 09:34:28 +01:00
b4be9e1d28 Add notice to system info
[MAILPOET-949]
2017-06-28 16:50:31 +01:00
a7504136a2 Add knowledge base page content
[MAILPOET-949]
2017-06-28 15:36:51 +01:00
43fa12ec08 Add help without any content
[MAILPOET-949]
2017-06-28 15:00:53 +01:00
6723a563ed Add yoga studio thumb
[MAILPOET-922]
2017-06-28 11:27:33 +01:00
15e3e93c99 Add Foodbox thumb
[MAILPOET-922]
2017-06-28 10:57:16 +01:00
cbce789ac8 Add thumbnails to templates
[MAILPOET-922]
2017-06-28 10:57:16 +01:00
97607993fb Add newsletter assets to plugin folder
[MAILPOET-922]
2017-06-28 10:57:16 +01:00
334b119bb3 Add News Day template
[MAILPOET-922]
2017-06-28 10:57:15 +01:00
ed0b2e6231 Add Coffee Shop template
[MAILPOET-922]
2017-06-28 10:57:15 +01:00
ad7ad05ec7 Add Travel Nomads template
[MAILPOET-922]
2017-06-28 10:57:15 +01:00
bfba6d459c Add Faith template
[MAILPOET-922]
2017-06-28 10:57:15 +01:00
344eecbf11 Add Chocolate Store template
[MAILPOET-922]
2017-06-28 10:57:15 +01:00
14dc022d2d Add Science Weekly template
[MAILPOET-922]
2017-06-28 10:57:15 +01:00
eff75cce94 Add Piece Of Cake template
[MAILPOET-922]
2017-06-28 10:57:15 +01:00
51084fc57d Add Piece Of Cake template
[MAILPOET-922]
2017-06-28 10:57:15 +01:00
298270f86c Add Festival Event template
[MAILPOET-922]
2017-06-28 10:57:15 +01:00
fe6d5d1523 Add Take a Hike template
[MAILPOET-922]
2017-06-28 10:57:15 +01:00
3cceb32ec1 Add Kick-Off template
[MAILPOET-922]
2017-06-28 10:57:15 +01:00
c8251a3bcd Add Discount template
[MAILPOET-922]
2017-06-28 10:57:15 +01:00
58888505b5 Add Food box template
[MAILPOET-922]
2017-06-28 10:57:15 +01:00
558c493dd7 Add World Cup template
[MAILPOET-922]
2017-06-28 10:57:15 +01:00
8cdb7d77f6 Add App Welcome template
[MAILPOET-922]
2017-06-28 10:57:15 +01:00
539e6d3ee1 Add Burger Joint template
[MAILPOET-922]
2017-06-28 10:57:15 +01:00
c9a0939ddd Remove old templates
[MAILPOET-922]
2017-06-28 10:57:15 +01:00
2add301b9f Bumps up version to 3.0.0-beta.36.1.0 and updates changelog 2017-06-27 16:23:22 -04:00
2d217e416a Merge pull request #960 from mailpoet/fix-build-find
Make build script work on Mac os [MAILPOET-969]
2017-06-27 12:21:25 +03:00
77e0ace951 Merge pull request #961 from mailpoet/post_notification_unit_test_update
Updates the way we test for next run date in newsletter scheduler [MAILPOET-967]
2017-06-27 11:42:30 +03:00
933749f8f0 Merge pull request #941 from mailpoet/mp2tomp3migration
Mp2tomp3migration phase 2
2017-06-26 18:47:58 +03:00
7b13babf3f Merge pull request #958 from mailpoet/improve-ajax-errors
Improve ajax errors [MAILPOET-929]
2017-06-26 17:31:15 +03:00
8c673f78d7 Make build script work on Mac os
[MAILPOET-969]
2017-06-26 15:00:48 +01:00
2285c08c01 Revert "Revert "Improve ajax errors [MAILPOET-929]""
This reverts commit 81c3e2facf.
2017-06-26 13:51:53 +01:00
836b7179e9 Improve ajax errors on form submission
[MAILPOET-929]
2017-06-26 13:43:32 +01:00
f89a728c38 Uses predetermined timestamps from which next run date is calculated 2017-06-24 15:59:28 -04:00
58f2c32362 Allows passing custom time value to calculate the next run date from 2017-06-24 15:59:17 -04:00
5bd6c6533a Fixed: Skip button is vanishinig by itself in seconds 2017-06-21 19:24:07 +02:00
f539860922 Remove trailing spaces 2017-06-21 19:24:06 +02:00
536267c8f5 Fixed: Form fields were not inactive when used 2017-06-21 19:24:05 +02:00
5b905a60e8 Fixed: Unit test testReplaceMP2Shortcodes 2017-06-21 19:24:05 +02:00
5e152ebaa1 Fixed: Wrong date format on front-end 2017-06-21 19:24:04 +02:00
2c35c7061e Fixed: Display "Invalid e-mail" on the front-end whereas the e-mail is correct 2017-06-21 19:24:03 +02:00
2515dcf4ce Fixed: Wrong HTML encoding of the text fields 2017-06-21 19:24:02 +02:00
9458bf7418 Add Unit tests for MP2 to MP3 migration phase 2 2017-06-21 19:24:01 +02:00
44bf4b98b8 MP2 to MP3 migration phase 2: Forms migration 2017-06-21 19:24:01 +02:00
212 changed files with 14072 additions and 3843 deletions

View File

@ -235,14 +235,23 @@ class RoboFile extends \Robo\Tasks {
} else {
$severityFlag = '-n';
}
return $this->_exec(
'./vendor/bin/phpcs '.
'--standard=./tasks/code_sniffer/MailPoet '.
'--ignore=./lib/Util/Sudzy/*,./lib/Util/CSS.php,./lib/Util/XLSXWriter.php,'.
'./lib/Util/pQuery/*,./lib/Config/PopulatorData/Templates/* '.
'lib/ '.
$severityFlag
);
return $this->collectionBuilder()
->taskExec(
'./vendor/bin/phpcs '.
'--standard=./tasks/code_sniffer/MailPoet '.
'--ignore=./lib/Util/Sudzy/*,./lib/Util/CSS.php,./lib/Util/XLSXWriter.php,'.
'./lib/Util/pQuery/*,./lib/Config/PopulatorData/Templates/* '.
'lib/ '.
$severityFlag
)
->taskExec(
'./vendor/bin/phpcs '.
'--standard=./tasks/code_sniffer/MailPoetTests '.
'--ignore=./tests/unit/_bootstrap.php '.
'tests/unit/ '.
$severityFlag
)
->run();
}
function svnCheckout() {

View File

@ -18,6 +18,7 @@
.mailpoet_settings_posts_display_options
.mailpoet_settings_posts_selection
animation-slide-open-downwards()
overflow-x: hidden
.mailpoet_settings_posts_show_display_options,
.mailpoet_settings_posts_show_post_selection
@ -26,7 +27,12 @@
.mailpoet_post_selection_container
margin-top: 20px
margin-bottom: 20px
margin-bottom: 0
.mailpoet_post_scroll_container
overflow-y: scroll
overflow-x: hidden
max-height: 400px
.mailpoet_settings_posts_single_post
border-radius(1px)
@ -45,3 +51,6 @@
.mailpoet_select_post_checkbox
margin-left: 10px
margin-right: 8px
.mailpoet_post_selection_loading
color: #999

Binary file not shown.

Before

Width:  |  Height:  |  Size: 143 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 262 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 276 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 441 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

View File

@ -1,74 +1,85 @@
define('ajax', ['mailpoet', 'jquery', 'underscore'], function(MailPoet, jQuery, _) {
'use strict';
MailPoet.Ajax = {
version: 0.5,
options: {},
defaults: {
url: null,
api_version: null,
endpoint: null,
action: null,
token: null,
data: {}
},
post: function(options) {
return this.request('post', options);
},
init: function(options) {
// merge options
this.options = jQuery.extend({}, this.defaults, options);
// set default url
if(this.options.url === null) {
this.options.url = ajaxurl;
}
// set default token
if(this.options.token === null) {
this.options.token = window.mailpoet_token;
}
},
getParams: function() {
return {
action: 'mailpoet',
api_version: this.options.api_version,
token: this.options.token,
endpoint: this.options.endpoint,
method: this.options.action,
data: this.options.data || {}
}
},
request: function(method, options) {
// set options
this.init(options);
// set request params
var params = this.getParams();
var deferred = jQuery.Deferred();
// remove null values from the data object
if (_.isObject(params.data)) {
params.data = _.pick(params.data, function(value) {
return (value !== null)
})
}
// ajax request
deferred = jQuery.post(
this.options.url,
params,
null,
'json'
).then(function(data) {
return data;
}, function(xhr) {
return xhr.responseJSON;
});
// clear options
this.options = {};
return deferred;
}
};
});
function requestFailed(errorMessage, xhr) {
if (xhr.responseJSON) {
return xhr.responseJSON;
}
var message = errorMessage.replace("%d", xhr.status);
return {
errors: [
{
message: message
}
]
}
}
define('ajax', ['mailpoet', 'jquery', 'underscore'], function(MailPoet, jQuery, _) {
MailPoet.Ajax = {
version: 0.5,
options: {},
defaults: {
url: null,
api_version: null,
endpoint: null,
action: null,
token: null,
data: {}
},
post: function(options) {
return this.request('post', options);
},
init: function(options) {
// merge options
this.options = jQuery.extend({}, this.defaults, options);
// set default url
if(this.options.url === null) {
this.options.url = ajaxurl;
}
// set default token
if(this.options.token === null) {
this.options.token = window.mailpoet_token;
}
},
getParams: function() {
return {
action: 'mailpoet',
api_version: this.options.api_version,
token: this.options.token,
endpoint: this.options.endpoint,
method: this.options.action,
data: this.options.data || {}
}
},
request: function(method, options) {
// set options
this.init(options);
// set request params
var params = this.getParams();
// remove null values from the data object
if (_.isObject(params.data)) {
params.data = _.pick(params.data, function(value) {
return (value !== null)
})
}
// ajax request
var deferred = jQuery.post(
this.options.url,
params,
null,
'json'
).then(function(data) {
return data;
}, _.partial(requestFailed, MailPoet.I18n.t('ajaxFailedErrorMessage')));
// clear options
this.options = {};
return deferred;
}
};
});

View File

@ -0,0 +1,32 @@
import React from 'react'
import ReactDOM from 'react-dom'
import { Router, Route, IndexRedirect, useRouterHistory } from 'react-router'
import { createHashHistory } from 'history'
import KnowledgeBase from 'help/knowledge_base.jsx'
import SystemInfo from 'help/system_info.jsx'
const history = useRouterHistory(createHashHistory)({ queryKey: false });
const App = React.createClass({
render() {
return this.props.children;
}
});
const container = document.getElementById('help_container');
if(container) {
ReactDOM.render((
<Router history={ history }>
<Route path="/" component={ App }>
<IndexRedirect to="knowledgeBase" />
{/* Pages */}
<Route path="knowledgeBase(/)**" params={{ tab: 'knowledgeBase' }} component={ KnowledgeBase } />
<Route path="systemInfo(/)**" params={{ tab: 'systemInfo' }} component={ SystemInfo } />
</Route>
</Router>
), container);
}

View File

@ -0,0 +1,29 @@
import React from 'react'
import MailPoet from 'mailpoet'
import Tabs from './tabs.jsx'
function KnowledgeBase() {
return (
<div>
<Tabs tab="knowledgeBase" />
<p>{MailPoet.I18n.t('knowledgeBaseIntro')}</p>
<ul>
<li><a target="_blank" href="http://beta.docs.mailpoet.com/category/116-common-problems">Common Problems</a></li>
<li><a target="_blank" href="http://beta.docs.mailpoet.com/category/165-newsletters">Newsletters</a></li>
<li><a target="_blank" href="http://beta.docs.mailpoet.com/category/156-migration-questions">Migration Questions</a></li>
<li><a target="_blank" href="http://beta.docs.mailpoet.com/category/149-sending-methods">Sending Methods</a></li>
<li><a target="_blank" href="http://beta.docs.mailpoet.com/category/139-subscription-forms">Subscription Forms</a></li>
<li><a target="_blank" href="http://beta.docs.mailpoet.com/category/114-getting-started">Getting Started</a></li>
<li><a target="_blank" href="http://beta.docs.mailpoet.com/category/123-newsletter-designer">Newsletter Designer</a></li>
<li><a target="_blank" href="http://beta.docs.mailpoet.com/category/121-subscribers-and-lists">Subscribers and Lists</a></li>
</ul>
<a target="_blank" href="http://beta.docs.mailpoet.com/" className="button button-primary">{MailPoet.I18n.t('knowledgeBaseButton')}</a>
</div>
);
};
module.exports = KnowledgeBase;

View File

@ -0,0 +1,47 @@
import React from 'react'
import MailPoet from 'mailpoet'
import _ from 'underscore'
import Tabs from './tabs.jsx'
function handleFocus(event) {
event.target.select();
}
function printData(data) {
if (_.isObject(data)) {
const printableData = Object.keys(data).map((key) => {
return `${key}: ${data[key]}`;
});
return (<textarea
readOnly={true}
onFocus={handleFocus}
value={printableData.join("\n")}
style={{
width: "100%",
height: "400px",
}}
/>);
} else {
return (<p>{MailPoet.I18n.t('systemInfoDataError')}</p>);
}
}
function KnowledgeBase() {
const data = window.help_scout_data;
return (
<div>
<Tabs tab="systemInfo" />
<div className="mailpoet_notice notice inline notice-success" style={{marginTop: "1em"}}>
<p>{MailPoet.I18n.t('systemInfoIntro')}</p>
</div>
{printData(data)}
</div>
);
};
module.exports = KnowledgeBase;

View File

@ -0,0 +1,46 @@
import React from 'react'
import { Link } from 'react-router'
import classNames from 'classnames'
import MailPoet from 'mailpoet'
const tabs = [
{
name: 'knowledgeBase',
label: MailPoet.I18n.t('tabKnowledgeBaseTitle'),
link: '/knowledgeBase'
},
{
name: 'systemInfo',
label: MailPoet.I18n.t('tabSystemInfoTitle'),
link: '/systemInfo'
},
];
function Tabs(props) {
const tabLinks = tabs.map((tab, index) => {
const tabClasses = classNames(
'nav-tab',
{ 'nav-tab-active': (props.tab === tab.name) }
);
return (
<Link
key={ 'tab-'+index }
className={ tabClasses }
to={ tab.link }
>{ tab.label }</Link>
);
});
return (
<h2 className="nav-tab-wrapper">
{ tabLinks }
</h2>
);
};
Tabs.propTypes = { tab: React.PropTypes.string };
Tabs.defaultProps = { tab: "knowledgeBase" };
module.exports = Tabs;

View File

@ -61,7 +61,7 @@ define('mp2migrator', ['mailpoet', 'jquery'], function(MailPoet, jQuery) {
}
jQuery('#progressbar').progressbar('option', 'value', progress);
jQuery('#progresslabel').html(progress + '%');
if(Number(result.current !== 0)) {
if(Number(result.current) !== 0) {
jQuery('#skip-import').hide();
}
if(MailPoet.MP2Migrator.is_logging) {

View File

@ -48,6 +48,7 @@ define([
return this._getDefaults({
type: 'posts',
amount: '10',
offset: 0,
contentType: 'post', // 'post'|'page'|'mailpoet_page'
postStatus: 'publish', // 'draft'|'pending'|'private'|'publish'|'future'
terms: [], // List of category and tag objects
@ -98,6 +99,7 @@ define([
this.fetchAvailablePosts();
this.on('change:amount change:contentType change:terms change:inclusionType change:postStatus change:search change:sortBy', refreshAvailablePosts);
this.on('loadMorePosts', this._loadMorePosts, this);
this.listenTo(this.get('_selectedPosts'), 'add remove reset', refreshTransformedPosts);
this.on('change:displayType change:titleFormat change:featuredImagePosition change:titleAlignment change:titleIsLink change:imageFullWidth change:showAuthor change:authorPrecededBy change:showCategories change:categoriesPrecededBy change:readMoreType change:readMoreText change:showDivider', refreshTransformedPosts);
@ -108,6 +110,7 @@ define([
},
fetchAvailablePosts: function() {
var that = this;
this.set('offset', 0);
CommunicationComponent.getPosts(this.toJSON()).done(function(posts) {
that.get('_availablePosts').reset(posts);
that.get('_selectedPosts').reset(); // Empty out the collection
@ -116,6 +119,27 @@ define([
MailPoet.Notice.error(MailPoet.I18n.t('failedToFetchAvailablePosts'));
});
},
_loadMorePosts: function() {
var that = this,
postCount = this.get('_availablePosts').length,
nextOffset = this.get('offset') + Number(this.get('amount'));
if(postCount === 0 || postCount < nextOffset) {
// No more posts to load
return false;
}
this.set('offset', nextOffset);
this.trigger('loadingMorePosts');
CommunicationComponent.getPosts(this.toJSON()).done(function(posts) {
that.get('_availablePosts').add(posts);
that.trigger('change:_availablePosts');
}).fail(function() {
MailPoet.Notice.error(MailPoet.I18n.t('failedToFetchAvailablePosts'));
}).always(function() {
that.trigger('morePostsLoaded');
});
},
_refreshTransformedPosts: function() {
var that = this,
data = this.toJSON();
@ -260,6 +284,7 @@ define([
});
var PostsSelectionCollectionView = Marionette.CollectionView.extend({
className: 'mailpoet_post_scroll_container',
childView: function() { return SinglePostSelectionSettingsView; },
emptyView: function() { return EmptyPostSelectionSettingsView; },
childViewOptions: function() {
@ -270,6 +295,16 @@ define([
initialize: function(options) {
this.blockModel = options.blockModel;
},
events: {
'scroll': 'onPostsScroll',
},
onPostsScroll: function(event) {
var $postsBox = jQuery(event.target);
if($postsBox.scrollTop() + $postsBox.innerHeight() >= $postsBox[0].scrollHeight){
// Load more posts if scrolled to bottom
this.blockModel.trigger('loadMorePosts');
}
},
});
var PostSelectionSettingsView = Marionette.View.extend({
@ -284,6 +319,20 @@ define([
'input .mailpoet_posts_search_term': _.partial(this.changeField, 'search'),
};
},
modelEvents: {
'change:offset': function(model, value) {
// Scroll posts view to top if settings are changed
if (value === 0) {
this.$('.mailpoet_post_scroll_container').scrollTop(0);
}
},
'loadingMorePosts': function() {
this.$('.mailpoet_post_selection_loading').css('visibility', 'visible');
},
'morePostsLoaded': function() {
this.$('.mailpoet_post_selection_loading').css('visibility', 'hidden');
}
},
onRender: function() {
// Dynamically update available post types
CommunicationComponent.getPostTypes().done(_.bind(this._updateContentTypes, this));

View File

@ -38,10 +38,17 @@ rm -Rf $plugin_name/assets/js/src
rm -Rf $plugin_name/lang/*.po
# Remove extra files (docs, examples,...) from 3rd party extensions
unameString=`uname`
if [[ "$unameString" == 'Darwin' ]]; then
findCommand='find -E '
else
findCommand='find -regextype posix-egrep '
fi
echo '[BUILD] Removing obsolete files from vendor libraries'
find $plugin_name/vendor -type f -regextype posix-egrep -iregex ".*\/*\.(markdown|md|txt)" -print0 | xargs -0 rm -f
find $plugin_name/vendor -type f -regextype posix-egrep -iregex ".*\/(readme|license|version|changes|changelog)" -print0 | xargs -0 rm -f
find $plugin_name/vendor -type d -regextype posix-egrep -iregex ".*\/(docs?|examples?|\.git)" -print0 | xargs -0 rm -rf
$findCommand $plugin_name/vendor -type f -iregex ".*\/*\.(markdown|md|txt)" -print0 | xargs -0 rm -f
$findCommand $plugin_name/vendor -type f -iregex ".*\/(readme|license|version|changes|changelog)" -print0 | xargs -0 rm -f
$findCommand $plugin_name/vendor -type d -iregex ".*\/(docs?|examples?|\.git)" -print0 | xargs -0 rm -rf
# Remove unit tests from 3rd party extensions
echo '[BUILD] Removing unit tests from vendor libraries'

View File

@ -19,6 +19,7 @@
"symfony/polyfill-xml": "^1.3"
},
"require-dev": {
"codeception/aspect-mock": "^2.0",
"codeception/codeception": "^2.2.9",
"codeception/verify": "^0.3.3",
"consolidation/robo": "^1.0.5",

388
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "c8c2fdb08b7ab624890703dde640c5d1",
"content-hash": "41f1dee36a4af45bcb91ca96c5f0872a",
"packages": [
{
"name": "cerdic/css-tidy",
@ -764,6 +764,49 @@
],
"time": "2016-10-30T11:50:56+00:00"
},
{
"name": "codeception/aspect-mock",
"version": "2.0.1",
"source": {
"type": "git",
"url": "https://github.com/Codeception/AspectMock.git",
"reference": "b7f5c50da89419824102400bb4c71988ec33044f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Codeception/AspectMock/zipball/b7f5c50da89419824102400bb4c71988ec33044f",
"reference": "b7f5c50da89419824102400bb4c71988ec33044f",
"shasum": ""
},
"require": {
"goaop/framework": "^2.0.0",
"php": ">=5.6.0",
"symfony/finder": "~2.4|~3.0"
},
"require-dev": {
"codeception/base": "~2.1",
"codeception/specify": "~0.3",
"codeception/verify": "~0.2"
},
"type": "library",
"autoload": {
"psr-0": {
"AspectMock": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Michael Bodnarchuk",
"email": "davert.php@mailican.com"
}
],
"description": "Experimental Mocking Framework powered by Aspects",
"time": "2017-01-31T20:29:56+00:00"
},
{
"name": "codeception/codeception",
"version": "2.2.9",
@ -1148,6 +1191,74 @@
"homepage": "https://github.com/container-interop/container-interop",
"time": "2017-02-14T19:40:03+00:00"
},
{
"name": "doctrine/annotations",
"version": "v1.4.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/annotations.git",
"reference": "54cacc9b81758b14e3ce750f205a393d52339e97"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/annotations/zipball/54cacc9b81758b14e3ce750f205a393d52339e97",
"reference": "54cacc9b81758b14e3ce750f205a393d52339e97",
"shasum": ""
},
"require": {
"doctrine/lexer": "1.*",
"php": "^5.6 || ^7.0"
},
"require-dev": {
"doctrine/cache": "1.*",
"phpunit/phpunit": "^5.7"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.4.x-dev"
}
},
"autoload": {
"psr-4": {
"Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "Docblock Annotations Parser",
"homepage": "http://www.doctrine-project.org",
"keywords": [
"annotations",
"docblock",
"parser"
],
"time": "2017-02-24T16:22:25+00:00"
},
{
"name": "doctrine/instantiator",
"version": "1.0.5",
@ -1202,6 +1313,60 @@
],
"time": "2015-06-14T21:17:01+00:00"
},
{
"name": "doctrine/lexer",
"version": "v1.0.1",
"source": {
"type": "git",
"url": "https://github.com/doctrine/lexer.git",
"reference": "83893c552fd2045dd78aef794c31e694c37c0b8c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c",
"reference": "83893c552fd2045dd78aef794c31e694c37c0b8c",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-0": {
"Doctrine\\Common\\Lexer\\": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.",
"homepage": "http://www.doctrine-project.org",
"keywords": [
"lexer",
"parser"
],
"time": "2014-09-09T13:34:57+00:00"
},
{
"name": "facebook/webdriver",
"version": "1.3.0",
@ -1251,6 +1416,119 @@
],
"time": "2017-01-13T15:48:08+00:00"
},
{
"name": "goaop/framework",
"version": "2.1.1",
"source": {
"type": "git",
"url": "https://github.com/goaop/framework.git",
"reference": "c6fc1db1e623bbfbf3bc2f165e03250603ff27b8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/goaop/framework/zipball/c6fc1db1e623bbfbf3bc2f165e03250603ff27b8",
"reference": "c6fc1db1e623bbfbf3bc2f165e03250603ff27b8",
"shasum": ""
},
"require": {
"doctrine/annotations": "~1.0",
"goaop/parser-reflection": "~1.2",
"jakubledl/dissect": "~1.0",
"php": ">=5.6.0"
},
"require-dev": {
"adlawson/vfs": "^0.12",
"phpunit/phpunit": "^4.8",
"symfony/console": "^2.7|^3.0"
},
"suggest": {
"symfony/console": "Enables the usage of the command-line tool."
},
"bin": [
"bin/aspect"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0-dev"
}
},
"autoload": {
"psr-4": {
"Go\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Lisachenko Alexander",
"homepage": "https://github.com/lisachenko"
}
],
"description": "Framework for aspect-oriented programming in PHP.",
"homepage": "http://go.aopphp.com/",
"keywords": [
"aop",
"aspect",
"library",
"php"
],
"time": "2017-04-25T11:27:19+00:00"
},
{
"name": "goaop/parser-reflection",
"version": "1.2.1",
"source": {
"type": "git",
"url": "https://github.com/goaop/parser-reflection.git",
"reference": "49e6cb828cb120104231a8b908b4ae794427b6a4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/goaop/parser-reflection/zipball/49e6cb828cb120104231a8b908b4ae794427b6a4",
"reference": "49e6cb828cb120104231a8b908b4ae794427b6a4",
"shasum": ""
},
"require": {
"nikic/php-parser": "^1.2|^2.0|^3.0",
"php": ">=5.6.0"
},
"require-dev": {
"phpunit/phpunit": "~4.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.x-dev"
}
},
"autoload": {
"psr-4": {
"Go\\ParserReflection\\": "src"
},
"files": [
"src/bootstrap.php"
],
"exclude-from-classmap": [
"/tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Alexander Lisachenko",
"email": "lisachenko.it@gmail.com"
}
],
"description": "Provides reflection information, based on raw source",
"time": "2017-06-27T16:23:48+00:00"
},
{
"name": "guzzlehttp/guzzle",
"version": "6.2.3",
@ -1488,6 +1766,61 @@
],
"time": "2016-03-16T15:22:20+00:00"
},
{
"name": "jakubledl/dissect",
"version": "v1.0.1",
"source": {
"type": "git",
"url": "https://github.com/jakubledl/dissect.git",
"reference": "d3a391de31e45a247e95cef6cf58a91c05af67c4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/jakubledl/dissect/zipball/d3a391de31e45a247e95cef6cf58a91c05af67c4",
"reference": "d3a391de31e45a247e95cef6cf58a91c05af67c4",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"symfony/console": "~2.1"
},
"suggest": {
"symfony/console": "for the command-line tool"
},
"bin": [
"bin/dissect.php",
"bin/dissect"
],
"type": "library",
"autoload": {
"psr-0": {
"Dissect": [
"src/"
]
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"unlicense"
],
"authors": [
{
"name": "Jakub Lédl",
"email": "jakubledl@gmail.com"
}
],
"description": "Lexing and parsing in pure PHP",
"homepage": "https://github.com/jakubledl/dissect",
"keywords": [
"ast",
"lexing",
"parser",
"parsing"
],
"time": "2013-01-29T21:29:14+00:00"
},
{
"name": "league/container",
"version": "2.4.0",
@ -1595,6 +1928,57 @@
],
"time": "2017-01-26T22:05:40+00:00"
},
{
"name": "nikic/php-parser",
"version": "v3.0.6",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
"reference": "0808939f81c1347a3c8a82a5925385a08074b0f1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/0808939f81c1347a3c8a82a5925385a08074b0f1",
"reference": "0808939f81c1347a3c8a82a5925385a08074b0f1",
"shasum": ""
},
"require": {
"ext-tokenizer": "*",
"php": ">=5.5"
},
"require-dev": {
"phpunit/phpunit": "~4.0|~5.0"
},
"bin": [
"bin/php-parse"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.0-dev"
}
},
"autoload": {
"psr-4": {
"PhpParser\\": "lib/PhpParser"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Nikita Popov"
}
],
"description": "A PHP parser written in PHP",
"keywords": [
"parser",
"php"
],
"time": "2017-06-28T20:53:48+00:00"
},
{
"name": "phpdocumentor/reflection-common",
"version": "1.0",
@ -2956,7 +3340,7 @@
"typo3"
],
"abandoned": true,
"time": "2016-05-12T11:58:38+00:00"
"time": "2016-05-12 11:58:38"
},
{
"name": "squizlabs/php_codesniffer",

View File

@ -42,17 +42,21 @@ class Database {
$driver_options[] = $character_set;
}
$current_options = ORM::for_table("")
->raw_query('SELECT @@session.wait_timeout as wait_timeout')
->findOne();
if($current_options && (int)$current_options->wait_timeout < $this->driver_option_wait_timeout) {
$driver_options[] = 'SESSION wait_timeout = ' . $this->driver_option_wait_timeout;
}
// reset the database
ORM::set_db(null);
ORM::configure('driver_options', array(
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET ' . implode(', ', $driver_options)
));
try {
$current_options = ORM::for_table("")
->raw_query('SELECT @@session.wait_timeout as wait_timeout')
->findOne();
if($current_options && (int)$current_options->wait_timeout < $this->driver_option_wait_timeout) {
ORM::raw_execute('SET SESSION wait_timeout = ' . $this->driver_option_wait_timeout);
}
} catch (\PDOException $e) {
// Rethrow PDOExceptions to prevent exposing sensitive data in stack traces
throw new \Exception($e->getMessage());
}
}
function defineTables() {

View File

@ -31,7 +31,12 @@ class Initializer {
return;
}
$this->setupDB();
try {
$this->setupDB();
} catch(\Exception $e) {
$this->handleFailedInitialization($e);
return;
}
// activation function
register_activation_hook(
@ -193,8 +198,16 @@ class Initializer {
}
function setupHooks() {
$hooks = new Hooks();
$hooks->init();
if(!$this->plugin_initialized) {
return;
}
try {
$hooks = new Hooks();
$hooks->init();
} catch(\Exception $e) {
$this->handleFailedInitialization($e);
}
}
function setupJSONAPI() {
@ -224,6 +237,10 @@ class Initializer {
}
function handleFailedInitialization($message) {
// Check if we are able to add pages at this point
if(function_exists('wp_get_current_user')) {
Menu::addErrorPage();
}
return WPNotice::displayError($message);
}
}
}

View File

@ -3,6 +3,7 @@
namespace MailPoet\Config;
use MailPoet\Util\ProgressBar;
use MailPoet\Models\Form;
use MailPoet\Models\Setting;
use MailPoet\Models\Segment;
use MailPoet\Models\Subscriber;
@ -159,12 +160,13 @@ class MP2Migrator {
$this->importSegments();
$this->importCustomFields();
$this->importSubscribers();
$this->importForms();
if(!$this->importStopped()) {
Setting::setValue('mailpoet_migration_complete', true);
$this->log(__('IMPORT COMPLETE', 'mailpoet'));
}
$this->log(sprintf('=== ' . __('END IMPORT', 'mailpoet') . ' %s ===', $datetime->formatTime(time(), \MailPoet\WP\DateTime::DEFAULT_DATE_TIME_FORMAT)));
$result = ob_get_contents();
ob_clean();
@ -199,6 +201,7 @@ class MP2Migrator {
private function resetMigrationCounters() {
Setting::setValue('last_imported_user_id', 0);
Setting::setValue('last_imported_list_id', 0);
Setting::setValue('last_imported_form_id', 0);
}
/**
@ -262,17 +265,17 @@ class MP2Migrator {
$total_count += $users_count;
$result .= sprintf(_n('%d subscriber', '%d subscribers', $users_count, 'mailpoet'), $users_count) . "\n";
// Forms
$forms_count = \ORM::for_table(MP2_FORM_TABLE)->count();
$total_count += $forms_count;
$result .= sprintf(_n('%d form', '%d forms', $forms_count, 'mailpoet'), $forms_count) . "\n";
// TODO to reactivate during the next phases
/*
// Emails
$emails_count = \ORM::for_table(MP2_EMAIL_TABLE)->count();
$total_count += $emails_count;
$result .= sprintf(_n('%d newsletter', '%d newsletters', $emails_count, 'mailpoet'), $emails_count) . "\n";
// Forms
$forms_count = \ORM::for_table(MP2_FORM_TABLE)->count();
$total_count += $forms_count;
$result .= sprintf(_n('%d form', '%d forms', $forms_count, 'mailpoet'), $forms_count) . "\n";
*/
$this->progressbar->setTotalCount($total_count);
@ -310,7 +313,7 @@ class MP2Migrator {
} while(($lists != null) && ($lists_count > 0));
$this->segments_mapping = $this->getImportedMapping('segments');
$this->log(sprintf(_n("%d segment imported", "%d segments imported", $imported_segments_count, 'mailpoet'), $imported_segments_count));
}
@ -424,7 +427,7 @@ class MP2Migrator {
'id' => $custom_field['id'],
'name' => $custom_field['name'],
'type' => $this->mapCustomFieldType($custom_field['type']),
'params' => $this->mapCustomFieldParams($custom_field),
'params' => $this->mapCustomFieldParams($custom_field['name'], unserialize($custom_field['settings'])),
);
$custom_field = new CustomField();
$custom_field->createOrUpdate($data);
@ -443,6 +446,9 @@ class MP2Migrator {
case 'input':
$type = 'text';
break;
case 'list':
$type = 'segment';
break;
default:
$type = $mp2_type;
}
@ -452,17 +458,42 @@ class MP2Migrator {
/**
* Map the MailPoet 2 custom field settings with the MailPoet custom field params
*
* @param array $custom_field MP2 custom field
* @param string $name Parameter name
* @param array $params MP2 parameters
* @return string serialized MP3 custom field params
*/
private function mapCustomFieldParams($custom_field) {
$params = unserialize($custom_field['settings']);
$params['label'] = $custom_field['name'];
private function mapCustomFieldParams($name, $params) {
if(!isset($params['label'])) {
$params['label'] = $name;
}
if(isset($params['required'])) {
$params['required'] = (bool)$params['required'];
}
if(isset($params['validate'])) {
$params['validate'] = $this->mapCustomFieldValidateValue($params['validate']);
}
if(isset($params['date_order'])) { // Convert the date_order field
$params['date_format'] = strtoupper($params['date_order']);
switch($params['date_type']) {
case 'year_month':
if(preg_match('/y$/i', $params['date_order'])) {
$params['date_format'] = 'MM/YYYY';
} else {
$params['date_format'] = 'YYYY/MM';
}
break;
case 'month';
$params['date_format'] = 'MM';
break;
case 'year';
$params['date_format'] = 'YYYY';
break;
default:
$params['date_format'] = strtoupper($params['date_order']);
}
unset($params['date_order']);
}
return $params;
@ -739,4 +770,195 @@ class MP2Migrator {
return $mappings;
}
/**
* Import the forms
*
*/
private function importForms() {
$imported_forms_count = 0;
if($this->importStopped()) {
return;
}
$this->log(__("Importing forms...", 'mailpoet'));
do {
if($this->importStopped()) {
break;
}
$forms = $this->getForms(self::CHUNK_SIZE);
$forms_count = count($forms);
if(is_array($forms)) {
foreach($forms as $form) {
$new_form = $this->importForm($form);
if(!empty($new_form)) {
$imported_forms_count++;
}
}
}
$this->progressbar->incrementCurrentCount($forms_count);
} while(($forms != null) && ($forms_count > 0));
$this->log(sprintf(_n("%d form imported", "%d forms imported", $imported_forms_count, 'mailpoet'), $imported_forms_count));
}
/**
* Get the Mailpoet 2 forms
*
* @global object $wpdb
* @param int $limit Number of forms max
* @return array Forms
*/
private function getForms($limit) {
global $wpdb;
$forms = array();
$last_id = Setting::getValue('last_imported_form_id', 0);
$table = MP2_FORM_TABLE;
$sql = "
SELECT f.*
FROM `$table` f
WHERE f.form_id > '$last_id'
ORDER BY f.form_id
LIMIT $limit
";
$forms = $wpdb->get_results($sql, ARRAY_A);
return $forms;
}
/**
* Import a form
*
* @param array $form_data Form data
* @return Form
*/
private function importForm($form_data) {
$serialized_data = base64_decode($form_data['data']);
$data = unserialize($serialized_data);
$settings = $data['settings'];
$body = $data['body'];
$segments = $this->getMappedSegmentIds($settings['lists']);
$mp3_form_settings = array(
'on_success' => $settings['on_success'],
'success_message' => $settings['success_message'],
'segments_selected_by' => $settings['lists_selected_by'],
'segments' => $segments,
);
$mp3_form_body = array();
foreach($body as $field) {
$type = $this->mapCustomFieldType($field['type']);
if($type == 'segment') {
$field_id = 'segments';
} else {
switch($field['field']) {
case 'firstname':
$field_id = 'first_name';
break;
case 'lastname':
$field_id = 'last_name';
break;
default:
$field_id = $field['field'];
}
}
$field_id = preg_replace('/^cf_(\d+)$/', '$1', $field_id);
$params = $this->mapCustomFieldParams($field['name'], $field['params']);
if(isset($params['text'])) {
$params['text'] = $this->replaceMP2Shortcodes(html_entity_decode($params['text']));
}
if(isset($params['values'])) {
$params['values'] = $this->replaceListIds($params['values']);
}
$mp3_form_body[] = array(
'type' => $type,
'name' => $field['name'],
'id' => $field_id,
'unique' => !in_array($field['type'], array('html', 'divider', 'email', 'submit'))? "1" : "0",
'static' => in_array($field_id, array('email', 'submit'))? "1" : "0",
'params' => $params,
'position' => isset($field['position'])? $field['position'] : '',
);
}
$form = Form::createOrUpdate(array(
'name' => $form_data['name'],
'body' => $mp3_form_body,
'settings' => $mp3_form_settings,
));
Setting::setValue('last_imported_form_id', $form_data['form_id']);
return $form;
}
/**
* Get the MP3 segments IDs of the MP2 lists IDs
*
* @param array $mp2_list_ids
*/
private function getMappedSegmentIds($mp2_list_ids) {
$mp3_segment_ids = array();
foreach($mp2_list_ids as $list_id) {
if(isset($this->segments_mapping[$list_id])) {
$mp3_segment_ids[] = $this->segments_mapping[$list_id];
}
}
return $mp3_segment_ids;
}
/**
* Replace the MP2 shortcodes used in the textarea fields
*
* @param string $text Text
* @return string Text
*/
private function replaceMP2Shortcodes($text) {
$text = str_replace('[total_subscribers]', '[mailpoet_subscribers_count]', $text);
$text = preg_replace_callback('/\[wysija_subscribers_count list_id="(.*)" \]/', array($this, 'replaceMP2ShortcodesCallback'), $text);
return $text;
}
/**
* Callback function for MP2 shortcodes replacement
*
* @param array $matches PREG matches
* @return string Replacement
*/
private function replaceMP2ShortcodesCallback($matches) {
if(!empty($matches)) {
$mp2_lists = explode(',', $matches[1]);
$segments = $this->getMappedSegmentIds($mp2_lists);
$segments_ids = implode(',', $segments);
return '[mailpoet_subscribers_count segments=' . $segments_ids . ']';
}
}
/**
* Replace the MP2 list IDs by MP3 segment IDs
*
* @param array $values Field values
* @return array Field values
*/
private function replaceListIds($values) {
$mp3_values = array();
foreach($values as $value) {
$mp3_value = array();
foreach($value as $item => $item_value) {
if(($item == 'list_id') && isset($this->segments_mapping[$item_value])) {
$segment_id = $this->segments_mapping[$item_value];
$mp3_value['id'] = $segment_id;
$segment = Segment::findOne($segment_id);
if(isset($segment)) {
$mp3_value['name'] = $segment->get('name');
}
} else {
$mp3_value[$item] = $item_value;
}
}
if(!empty($mp3_value)) {
$mp3_values[] = $mp3_value;
}
}
return $mp3_values;
}
}

View File

@ -4,6 +4,7 @@ namespace MailPoet\Config;
use MailPoet\Cron\CronTrigger;
use MailPoet\Form\Block;
use MailPoet\Form\Renderer as FormRenderer;
use MailPoet\Helpscout\Beacon;
use MailPoet\Listing;
use MailPoet\Models\CustomField;
use MailPoet\Models\Form;
@ -167,6 +168,18 @@ class Menu {
)
);
add_submenu_page(
$main_page_slug,
$this->setPageTitle(__('Help', 'mailpoet')),
__('Help', 'mailpoet'),
Env::$required_permission,
'mailpoet-help',
array(
$this,
'help'
)
);
// Only show this page in menu if the Premium plugin is not activated
add_submenu_page(
License::getLicense() ? true : $main_page_slug,
@ -377,6 +390,10 @@ class Menu {
$this->displayPage('settings.html', $data);
}
function help() {
$this->displayPage('help.html', array('data' => Beacon::getData()));
}
private function _getFlags() {
// flags (available features on WP install)
$flags = array();
@ -576,6 +593,34 @@ class Menu {
return (stripos($screen_id, 'mailpoet-') !== false);
}
/**
* This error page is used when the initialization is failed
* to display admin notices only
*/
static function addErrorPage() {
if(!self::isOnMailPoetAdminPage()) {
return false;
}
// Check if page already exists
if(get_plugin_page_hook($_REQUEST['page'], '')
|| get_plugin_page_hook($_REQUEST['page'], 'mailpoet-newsletters')
) {
return false;
}
add_submenu_page(
true,
'MailPoet',
'MailPoet',
Env::$required_permission,
$_REQUEST['page'],
array(__CLASS__, 'errorPageCallback')
);
}
static function errorPageCallback() {
// Used for displaying admin notices only
}
function checkMailPoetAPIKey(ServicesChecker $checker = null) {
if(self::isOnMailPoetAdminPage()) {
$show_notices = isset($_REQUEST['page'])

View File

@ -26,7 +26,6 @@ class Populator {
'newsletter_templates',
);
$this->templates = array(
"FranksRoastHouseTemplate",
"NewsletterBlank1Column",
"NewsletterBlank12Column",
"NewsletterBlank121Column",
@ -35,9 +34,23 @@ class Populator {
"WelcomeBlank1Column",
"WelcomeBlank12Column",
"SimpleText",
"Restaurant",
"StoreDiscount",
"TravelEmail"
"BurgerJoint",
"AppWelcome",
"WorldCup",
"FoodBox",
"Discount",
"KickOff",
"TakeAHike",
"FestivalEvent",
"PieceOfCake",
"Shoes",
"ScienceWeekly",
"ChocolateStore",
"Faith",
"TravelNomads",
"CoffeeShop",
"NewsDay",
"YogaStudio",
);
}

View File

@ -0,0 +1,415 @@
<?php
namespace MailPoet\Config\PopulatorData\Templates;
class AppWelcome {
private $template_image_url;
private $social_icon_url;
function __construct($assets_url) {
$this->template_image_url = '//ps.w.org/mailpoet/assets/newsletter-templates/app_welcome';
$this->social_icon_url = $assets_url . '/img/newsletter_editor/social-icons';
}
function get() {
return array(
'name' => __("App Welcome", 'mailpoet'),
'description' => __("A welcome email template for your app.", 'mailpoet'),
'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' => '#eeeeee',
),
),
'blocks' => array(
array(
'type' => 'container',
'orientation' => 'vertical',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
),
),
'blocks' => array(
array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => '#eeeeee',
'height' => '30px',
),
),
),
),
),
),
),
array(
'type' => 'container',
'orientation' => 'horizontal',
'styles' => array(
'block' => array(
'backgroundColor' => '#32b6c6',
),
),
'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' => '40px',
),
),
),
array(
'type' => 'image',
'link' => '',
'src' => $this->template_image_url . '/App-Signup-Logo-1.png',
'alt' => 'App-Signup-Logo',
'fullWidth' => false,
'width' => '80px',
'height' => '80px',
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
array(
'type' => 'text',
'text' => '<h1 style="text-align: center; margin: 0;"><strong>Welcome to Appy</strong></h1><p style="text-align: center; margin: 0;"><span style="color: #ffffff;">Let\'s get started!</span></p>',
),
array(
'type' => 'image',
'link' => '',
'src' => $this->template_image_url . '/App-Signup-Header.png',
'alt' => 'App-Signup-Header',
'fullWidth' => false,
'width' => '1280px',
'height' => '500px',
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
),
),
),
),
array(
'type' => 'container',
'orientation' => 'horizontal',
'styles' => array(
'block' => array(
'backgroundColor' => '#ffffff',
),
),
'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' => '40px',
),
),
),
array(
'type' => 'text',
'text' => '<p style="text-align: center;">Hi [subscriber:firstname | default:subscriber],</p>
<p style="text-align: center;"></p>
<p style="text-align: center;">In MailPoet, you can write emails in plain text, just like in a regular email. This can make your email newsletters more personal and attention-grabbing.</p>
<p style="text-align: center;"></p>
<p style="text-align: center;">Is this too simple? You can still style your text with basic formatting, like <strong>bold</strong> or <em>italics.</em></p>
<p style="text-align: center;"></p>
<p style="text-align: center;">Finally, you can also add a call-to-action button between 2 blocks of text, like this:</p>',
),
),
),
),
),
array(
'type' => 'container',
'orientation' => 'horizontal',
'styles' => array(
'block' => array(
'backgroundColor' => '#ffffff',
),
),
'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' => '23px',
),
),
),
array(
'type' => 'button',
'text' => 'Get Started Here',
'url' => '',
'styles' => array(
'block' => array(
'backgroundColor' => '#32b6c6',
'borderColor' => '#32b6c6',
'borderWidth' => '0px',
'borderRadius' => '40px',
'borderStyle' => 'solid',
'width' => '188px',
'lineHeight' => '50px',
'fontColor' => '#ffffff',
'fontFamily' => 'Arial',
'fontSize' => '18px',
'fontWeight' => 'normal',
'textAlign' => 'center',
),
),
),
array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'height' => '35px',
),
),
),
),
),
),
),
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' => '',
'src' => $this->template_image_url . '/App-Signup-Team.jpg',
'alt' => 'App-Signup-Team',
'fullWidth' => true,
'width' => '1280px',
'height' => '700px',
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
),
),
),
),
array(
'type' => 'container',
'orientation' => 'horizontal',
'styles' => array(
'block' => array(
'backgroundColor' => '#eeeeee',
),
),
'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' => 'image',
'link' => '',
'src' => $this->template_image_url . '/App-Signup-Logo-Footer.png',
'alt' => 'App-Signup-Logo-Footer',
'fullWidth' => false,
'width' => '50px',
'height' => '50px',
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
array(
'type' => 'text',
'text' => '<p style="text-align: center; font-size: 12px;"><strong>Appy</strong></p>
<p style="text-align: center; font-size: 12px;"><span>Address Line 1</span></p>
<p style="text-align: center; font-size: 12px;"><span>Address Line 2</span></p>
<p style="text-align: center; font-size: 12px;"><span>City</span></p>
<p style="text-align: center; font-size: 12px;"><a href="[link:subscription_unsubscribe_url]">Unsubscribe</a><span> | </span><a href="[link:subscription_manage_url]">Manage subscription</a></p>',
),
array(
'type' => 'social',
'iconSet' => 'full-symbol-color',
'icons' => array(
array(
'type' => 'socialIcon',
'iconType' => 'facebook',
'link' => 'http://www.facebook.com',
'image' => $this->social_icon_url . '/06-full-symbol-color/Facebook.png',
'height' => '32px',
'width' => '32px',
'text' => 'Facebook',
),
array(
'type' => 'socialIcon',
'iconType' => 'twitter',
'link' => 'http://www.twitter.com',
'image' => $this->social_icon_url . '/06-full-symbol-color/Twitter.png',
'height' => '32px',
'width' => '32px',
'text' => 'Twitter',
),
array(
'type' => 'socialIcon',
'iconType' => 'youtube',
'link' => 'http://www.youtube.com',
'image' => $this->social_icon_url . '/06-full-symbol-color/Youtube.png',
'height' => '32px',
'width' => '32px',
'text' => 'Youtube',
),
array(
'type' => 'socialIcon',
'iconType' => 'instagram',
'link' => 'http://instagram.com',
'image' => $this->social_icon_url . '/06-full-symbol-color/Instagram.png',
'height' => '32px',
'width' => '32px',
'text' => 'Instagram',
),
),
),
array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'height' => '40px',
),
),
),
),
),
),
),
),
),
'globalStyles' => array(
'text' => array(
'fontColor' => '#404040',
'fontFamily' => 'Arial',
'fontSize' => '15px',
),
'h1' => array(
'fontColor' => '#ffffff',
'fontFamily' => 'Arial',
'fontSize' => '26px',
),
'h2' => array(
'fontColor' => '#404040',
'fontFamily' => 'Arial',
'fontSize' => '22px',
),
'h3' => array(
'fontColor' => '#32b6c6',
'fontFamily' => 'Arial',
'fontSize' => '18px',
),
'link' => array(
'fontColor' => '#32b6c6',
'textDecoration' => 'underline',
),
'wrapper' => array(
'backgroundColor' => '#ffffff',
),
'body' => array(
'backgroundColor' => '#eeeeee',
),
),
);
}
private function getThumbnail() {
return $this->template_image_url . '/app-welcome-email.jpg';
}
}

View File

@ -0,0 +1,497 @@
<?php
namespace MailPoet\Config\PopulatorData\Templates;
class BurgerJoint {
private $template_image_url;
private $social_icon_url;
function __construct($assets_url) {
$this->template_image_url = 'http://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'),
'description' => __("Add more or less ketchup or mayo to this restaurant template.", 'mailpoet'),
'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&nbsp;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';
}
}

View File

@ -0,0 +1,846 @@
<?php
namespace MailPoet\Config\PopulatorData\Templates;
class ChocolateStore {
private $template_image_url;
private $social_icon_url;
function __construct($assets_url) {
$this->template_image_url = '//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'),
'description' => __("A classy black store template.", 'mailpoet'),
'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.&nbsp;</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.&nbsp;</em></p>
<p><em>&nbsp;</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';
}
}

View File

@ -0,0 +1,425 @@
<?php
namespace MailPoet\Config\PopulatorData\Templates;
class CoffeeShop {
private $social_icon_url;
private $template_image_url;
function __construct($assets_url) {
$this->template_image_url = '//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'),
'description' => __("Coffee and sugar in your coffee?", 'mailpoet'),
'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';
}
}

View File

@ -0,0 +1,467 @@
<?php
namespace MailPoet\Config\PopulatorData\Templates;
class Discount {
private $template_image_url;
private $social_icon_url;
function __construct($assets_url) {
$this->template_image_url = '//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'),
'description' => __("A useful layout for a simple discount email.", 'mailpoet'),
'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&nbsp;[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.&nbsp;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&nbsp;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.&nbsp;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';
}
}

View File

@ -0,0 +1,488 @@
<?php
namespace MailPoet\Config\PopulatorData\Templates;
class Faith {
private $template_image_url;
private $social_icon_url;
function __construct($assets_url) {
$this->template_image_url = '//ps.w.org/mailpoet/assets/newsletter-templates/faith';
$this->social_icon_url = $assets_url . '/img/newsletter_editor/social-icons';
}
function get() {
return array(
'name' => __("Faith", 'mailpoet'),
'description' => __("A calm and muted faith template.", 'mailpoet'),
'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 . '/church-header.jpg',
'alt' => 'church-header',
'fullWidth' => true,
'width' => '1036px',
'height' => '563px',
'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;">Spreading Love &amp; Hope...</h1><p>Duis id molestie ex. Quisque finibus magna in justo tristique pellentesque. Nulla sed leo facilisis arcu malesuada molestie vel quis dolor. Donec imperdiet condimentum odio ut elementum. Aenean nisl massa, rutrum a ullamcorper eget, molestie non erat.&nbsp;</p>',
),
3 => array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'height' => '20px',
),
),
),
),
),
),
),
1 => array(
'type' => 'container',
'orientation' => 'horizontal',
'styles' => array(
'block' => array(
'backgroundColor' => '#f3f4f4',
),
),
'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' => '<h2 style="text-align: left;">Family Faith Events</h2>',
),
2 => array(
'type' => 'image',
'link' => '',
'src' => $this->template_image_url . '/family.jpg',
'alt' => 'family',
'fullWidth' => false,
'width' => '660px',
'height' => '880px',
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
3 => array(
'type' => 'text',
'text' => '<p>In maximus tempus pellentesque. Nunc scelerisque ante odio, vel placerat dui fermentum efficitur. Integer vitae ex suscipit, aliquet eros vitae, ornare est. <a href="http://www.example.com">Aenean vel dapibus nisi</a>.</p>',
),
4 => 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' => 'text',
'text' => '<h2>Thoughts &amp; Prayers</h2>',
),
2 => array(
'type' => 'image',
'link' => '',
'src' => $this->template_image_url . '/pray.jpg',
'alt' => 'pray',
'fullWidth' => false,
'width' => '660px',
'height' => '880px',
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
3 => array(
'type' => 'text',
'text' => '<p>Donec sed vulputate ipsum. In scelerisque rutrum interdum. Donec imperdiet dignissim erat, in dictum lectus accumsan ut. <a href="http://www.example.com">Aliquam erat volutpat.</a></p>',
),
4 => 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' => 'transparent',
'height' => '20px',
),
),
),
1 => array(
'type' => 'text',
'text' => '<h1 style="text-align: center;">Latest News</h1>',
),
2 => array(
'type' => 'divider',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'padding' => '7px',
'borderStyle' => 'dotted',
'borderWidth' => '1px',
'borderColor' => '#dcdcdc',
),
),
),
3 => array(
'type' => 'automatedLatestContent',
'amount' => '3',
'contentType' => 'post',
'terms' => array(),
'inclusionType' => 'include',
'displayType' => 'excerpt',
'titleFormat' => 'h3',
'titleAlignment' => 'left',
'titleIsLink' => false,
'imageFullWidth' => false,
'featuredImagePosition' => 'belowTitle',
'showAuthor' => 'no',
'authorPrecededBy' => 'Author:',
'showCategories' => 'no',
'categoriesPrecededBy' => 'Categories:',
'readMoreType' => 'button',
'readMoreText' => 'Read more',
'readMoreButton' => array(
'type' => 'button',
'text' => 'Read more',
'url' => '[postLink]',
'styles' => array(
'block' => array(
'backgroundColor' => '#dfeaf3',
'borderColor' => '#00ddff',
'borderWidth' => '0px',
'borderRadius' => '5px',
'borderStyle' => 'solid',
'width' => '160px',
'lineHeight' => '45px',
'fontColor' => '#597890',
'fontFamily' => 'Tahoma',
'fontSize' => '16px',
'fontWeight' => 'normal',
'textAlign' => 'center',
),
),
),
'sortBy' => 'newest',
'showDivider' => true,
'divider' => array(
'type' => 'divider',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'padding' => '13px',
'borderStyle' => 'dotted',
'borderWidth' => '2px',
'borderColor' => '#dfeaf3',
),
),
),
'backgroundColor' => '#ffffff',
'backgroundColorAlternate' => '#eeeeee',
),
4 => array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'height' => '20px',
),
),
),
5 => array(
'type' => 'divider',
'styles' => array(
'block' => array(
'backgroundColor' => '#e7eff6',
'padding' => '13px',
'borderStyle' => 'ridge',
'borderWidth' => '6px',
'borderColor' => '#597890',
),
),
),
),
),
),
),
3 => array(
'type' => 'container',
'orientation' => 'horizontal',
'styles' => array(
'block' => array(
'backgroundColor' => '#e7eff6',
),
),
'blocks' => array(
0 => array(
'type' => 'container',
'orientation' => 'vertical',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
),
),
'blocks' => array(
0 => 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' => '#e7eff6',
),
'text' => array(
'fontColor' => '#787878',
'fontFamily' => 'Tahoma',
'fontSize' => '14px',
'textAlign' => 'left',
),
'link' => array(
'fontColor' => '#787878',
'textDecoration' => 'none',
),
),
),
1 => 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' => '<p style="text-align: center;">Find us socially:</p>',
),
1 => 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',
'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',
'height' => '32px',
'width' => '32px',
'text' => 'Twitter',
),
2 => array(
'type' => 'socialIcon',
'iconType' => 'email',
'link' => '',
'image' => $this->social_icon_url . '/07-full-symbol-black/Email.png',
'height' => '32px',
'width' => '32px',
'text' => 'Email',
),
3 => array(
'type' => 'socialIcon',
'iconType' => 'website',
'link' => '',
'image' => $this->social_icon_url . '/07-full-symbol-black/Website.png',
'height' => '32px',
'width' => '32px',
'text' => 'Website',
),
),
),
2 => array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'height' => '20px',
),
),
),
),
),
),
),
),
),
'globalStyles' => array(
'text' => array(
'fontColor' => '#787878',
'fontFamily' => 'Tahoma',
'fontSize' => '16px',
),
'h1' => array(
'fontColor' => '#597890',
'fontFamily' => 'Comic Sans MS',
'fontSize' => '26px',
),
'h2' => array(
'fontColor' => '#597890',
'fontFamily' => 'Comic Sans MS',
'fontSize' => '18px',
),
'h3' => array(
'fontColor' => '#787878',
'fontFamily' => 'Tahoma',
'fontSize' => '18px',
),
'link' => array(
'fontColor' => '#597890',
'textDecoration' => 'underline',
),
'wrapper' => array(
'backgroundColor' => '#ffffff',
),
'body' => array(
'backgroundColor' => '#e7eff6',
),
),
);
}
private function getThumbnail() {
return $this->template_image_url . '/faith.jpg';
}
}

View File

@ -0,0 +1,524 @@
<?php
namespace MailPoet\Config\PopulatorData\Templates;
class FestivalEvent {
private $template_image_url;
private $social_icon_url;
function __construct($assets_url) {
$this->template_image_url = '//ps.w.org/mailpoet/assets/newsletter-templates/festival_event';
$this->social_icon_url = $assets_url . '/img/newsletter_editor/social-icons';
}
function get() {
return array(
'name' => __("Festival Event", 'mailpoet'),
'description' => __("A colourful festival event template.", 'mailpoet'),
'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' => '#0a5388',
'height' => '20px',
),
),
),
1 => array(
'type' => 'image',
'link' => '',
'src' => $this->template_image_url . '/festival-header.jpg',
'alt' => 'festival-header',
'fullWidth' => true,
'width' => '1320px',
'height' => '879px',
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
2 => array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'height' => '36px',
),
),
),
3 => array(
'type' => 'text',
'text' => '<h1 style="text-align: center;">Pack your glowsticks, <br />Boomfest is back!&nbsp;</h1>
<p></p>
<p style="text-align: center;">Duis tempor nisl in risus hendrerit venenatis. <br />Curabitur ornare venenatis nisl non ullamcorper. </p>',
),
4 => array(
'type' => 'button',
'text' => 'Duis id tincidunt',
'url' => '',
'styles' => array(
'block' => array(
'backgroundColor' => '#0a5388',
'borderColor' => '#0074a2',
'borderWidth' => '0px',
'borderRadius' => '5px',
'borderStyle' => 'solid',
'width' => '260px',
'lineHeight' => '50px',
'fontColor' => '#ffffff',
'fontFamily' => 'Courier New',
'fontSize' => '18px',
'fontWeight' => 'bold',
'textAlign' => 'center',
),
),
),
5 => array(
'type' => 'text',
'text' => '<p style="text-align: center;">Maecenas scelerisque nisi sit amet metus efficitur dapibus!&nbsp;<br />Ut eros risus, facilisis ac aliquet vel, posuere ut urna.</p>',
),
6 => 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' => 'instagram',
'link' => 'http://instagram.com',
'image' => $this->social_icon_url . '/08-full-symbol-grey/Instagram.png',
'height' => '32px',
'width' => '32px',
'text' => 'Instagram',
),
),
),
),
),
),
),
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' => 'divider',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'padding' => '13px',
'borderStyle' => 'dashed',
'borderWidth' => '2px',
'borderColor' => '#ffffff',
),
),
),
1 => array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'height' => '28px',
),
),
),
2 => array(
'type' => 'text',
'text' => '<h2 style="text-align: center;">Confirmed Lineup</h2>',
),
),
),
),
),
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' => 'text',
'text' => '<h3><em><span style="color: #bae2ff;">Main Stage</span></em></h3><p>Quisque libero<br />Nulla convallis<br />Vestibulum Ornare<br />Consectetur Odio</p>',
),
),
),
1 => array(
'type' => 'container',
'orientation' => 'vertical',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
),
),
'blocks' => array(
0 => array(
'type' => 'text',
'text' => '<h3><em><span style="color: #bae2ff;">New Acts Stage</span></em></h3><p>Nulla interdum<br />Massa nec<br />Pharetra<br />Varius</p>',
),
),
),
2 => array(
'type' => 'container',
'orientation' => 'vertical',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
),
),
'blocks' => array(
0 => array(
'type' => 'text',
'text' => '<h3><em><span style="color: #bae2ff;">Comedy Stage</span></em></h3><p>In pulvinar<br />Risus sed<br />Condimentum<br />Feugiat</p>',
),
),
),
),
),
3 => 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' => 'divider',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'padding' => '13px',
'borderStyle' => 'dashed',
'borderWidth' => '2px',
'borderColor' => '#ffffff',
),
),
),
2 => array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'height' => '20px',
),
),
),
3 => array(
'type' => 'text',
'text' => '<h2 style="text-align: center;">New to the festival this year</h2>',
),
4 => array(
'type' => 'divider',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'padding' => '9px',
'borderStyle' => 'dashed',
'borderWidth' => '2px',
'borderColor' => '#ffffff',
),
),
),
5 => 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 . '/street-food.jpg',
'alt' => 'street food',
'fullWidth' => true,
'width' => '499px',
'height' => '750px',
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
1 => array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'height' => '20px',
),
),
),
2 => array(
'type' => 'text',
'text' => '<h3>Award-winning Street Food</h3><p>Nullam pharetra lectus id porta pulvinar. Proin ac massa nibh. Nullam ac mi pharetra, lobortis nunc et, placerat leo. Mauris eu feugiat elit. Pellentesque eget turpis eu diam vehicula convallis non <a href="http://www.mailpoet.com">luctus enim.</a></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 . '/happy.jpeg',
'alt' => 'happy',
'fullWidth' => true,
'width' => '499px',
'height' => '750px',
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
1 => array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'height' => '20px',
),
),
),
2 => array(
'type' => 'text',
'text' => '<h3>Prepare to&nbsp;dazzle with our Glitter Run</h3><p>Donec quis orci at metus finibus tincidunt. Sed vel urna sed urna maximus congue eu et turpis. Nulla tempus hendrerit justo eget molestie. Vivamus quis molestie lacus. Donec commodo odio a nisi feugiat, vitae egestas mi.</p>',
),
),
),
),
),
5 => 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' => 'divider',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'padding' => '13px',
'borderStyle' => 'dashed',
'borderWidth' => '2px',
'borderColor' => '#ffffff',
),
),
),
2 => array(
'type' => 'footer',
'text' => '<p>Mauris tristique ultricies ullamcorper. <br />Don\'t want to hear from us?&nbsp;<a href="[link:subscription_unsubscribe_url]">Unsubscribe</a></p><p></p><p>Add your postal address here.&nbsp;</p>',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
),
'text' => array(
'fontColor' => '#ffffff',
'fontFamily' => 'Courier New',
'fontSize' => '13px',
'textAlign' => 'center',
),
'link' => array(
'fontColor' => '#ffffff',
'textDecoration' => 'underline',
),
),
),
),
),
),
),
),
),
'globalStyles' => array(
'text' => array(
'fontColor' => '#ffffff',
'fontFamily' => 'Courier New',
'fontSize' => '16px',
),
'h1' => array(
'fontColor' => '#ffffff',
'fontFamily' => 'Georgia',
'fontSize' => '36px',
),
'h2' => array(
'fontColor' => '#ffffff',
'fontFamily' => 'Georgia',
'fontSize' => '26px',
),
'h3' => array(
'fontColor' => '#ffffff',
'fontFamily' => 'Georgia',
'fontSize' => '24px',
),
'link' => array(
'fontColor' => '#ffffff',
'textDecoration' => 'underline',
),
'wrapper' => array(
'backgroundColor' => '#8d062b',
),
'body' => array(
'backgroundColor' => '#0a5388',
),
),
);
}
private function getThumbnail() {
return $this->template_image_url . '/festival-event.jpg';
}
}

View File

@ -0,0 +1,757 @@
<?php
namespace MailPoet\Config\PopulatorData\Templates;
class FoodBox {
private $template_image_url;
private $social_icon_url;
function __construct($assets_url) {
$this->template_image_url = '//ps.w.org/mailpoet/assets/newsletter-templates/food_box';
$this->social_icon_url = $assets_url . '/img/newsletter_editor/social-icons';
}
function get() {
return array(
'name' => __("Welcome to FoodBox", 'mailpoet'),
'description' => __("A welcome email template for your takeaway.", 'mailpoet'),
'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' => '#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' => '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' => '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' => 'image',
'link' => '',
'src' => $this->template_image_url . '/Food-Delivery-Logo.png',
'alt' => 'Food-Delivery-Logo',
'fullWidth' => false,
'width' => '640px',
'height' => '180px',
'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' => '',
'src' => $this->template_image_url . '/Food-Delivery-App.png',
'alt' => 'Food-Delivery-App',
'fullWidth' => false,
'width' => '640px',
'height' => '180px',
'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',
),
),
),
),
),
),
),
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' => '40px',
),
),
),
1 => array(
'type' => 'text',
'text' => '<h1><strong>Welcome to FoodBox</strong></h1>
<h2><strong>Lorem ipsum dolor sit amet</strong></h2>
<p>Curabitur sollicitudin eros eu cursus sollicitudin. Suspendisse laoreet sollicitudin urna, ut lacinia risus dictum a. Integer a neque eu magna commodo sodales eu eget ante.</p>',
),
2 => array(
'type' => 'button',
'text' => 'Get Started',
'url' => '',
'styles' => array(
'block' => array(
'backgroundColor' => '#7cc119',
'borderColor' => '#7cc119',
'borderWidth' => '0px',
'borderRadius' => '5px',
'borderStyle' => 'solid',
'width' => '100px',
'lineHeight' => '40px',
'fontColor' => '#ffffff',
'fontFamily' => 'Arial',
'fontSize' => '14px',
'fontWeight' => 'bold',
'textAlign' => 'left',
),
),
),
),
),
1 => array(
'type' => 'container',
'orientation' => 'vertical',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
),
),
'blocks' => array(
0 => array(
'type' => 'image',
'link' => '',
'src' => $this->template_image_url . '/Food-Delivery-Focus.jpg',
'alt' => 'Food-Delivery-Focus',
'fullWidth' => false,
'width' => '800px',
'height' => '800px',
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
),
),
),
),
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' => 'divider',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'padding' => '31.5px',
'borderStyle' => 'solid',
'borderWidth' => '2px',
'borderColor' => '#e5e5e5',
),
),
),
),
),
),
),
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' => 'text',
'text' => '<h2 style="text-align: center;">Get started in 3 simple steps</h2>',
),
),
),
),
),
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' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'height' => '20px',
),
),
),
1 => array(
'type' => 'image',
'link' => '',
'src' => $this->template_image_url . '/Food-Delivery-1-1.png',
'alt' => 'Food-Delivery-1',
'fullWidth' => false,
'width' => '800px',
'height' => '250px',
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
2 => array(
'type' => 'text',
'text' => '<p style="text-align: center;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur sollicitudin eros eu cursus sollicitudin.</p>',
),
),
),
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 . '/Food-Delivery-2-1.png',
'alt' => 'Food-Delivery-2',
'fullWidth' => false,
'width' => '800px',
'height' => '250px',
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
2 => array(
'type' => 'text',
'text' => '<p style="text-align: center;"><span style="text-align: center;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur sollicitudin eros eu cursus sollicitudin.</span></p>',
),
),
),
2 => 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 . '/Food-Delivery-3-1.png',
'alt' => 'Food-Delivery-3',
'fullWidth' => false,
'width' => '800px',
'height' => '250px',
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
2 => array(
'type' => 'text',
'text' => '<p style="text-align: center;"><span style="text-align: center;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur sollicitudin eros eu cursus sollicitudin.</span></p>',
),
),
),
),
),
8 => 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' => 'button',
'text' => 'Get Started',
'url' => '',
'styles' => array(
'block' => array(
'backgroundColor' => '#7cc119',
'borderColor' => '#7cc119',
'borderWidth' => '0px',
'borderRadius' => '5px',
'borderStyle' => 'solid',
'width' => '100px',
'lineHeight' => '40px',
'fontColor' => '#ffffff',
'fontFamily' => 'Arial',
'fontSize' => '14px',
'fontWeight' => 'bold',
'textAlign' => 'center',
),
),
),
2 => array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'height' => '25px',
),
),
),
),
),
),
),
9 => array(
'type' => 'container',
'orientation' => 'horizontal',
'styles' => array(
'block' => array(
'backgroundColor' => '#4599da',
),
),
'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 style="text-align: center; font-size: 14px;"><strong><span style="color: #ffffff;">Link 1 - Link 2 - Link 3 - Link 4</span></strong></p>',
),
),
),
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' => '24px',
),
),
),
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',
'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' => 'instagram',
'link' => 'http://instagram.com',
'image' => $this->social_icon_url . '/08-full-symbol-grey/Instagram.png',
'height' => '32px',
'width' => '32px',
'text' => 'Instagram',
),
4 => array(
'type' => 'socialIcon',
'iconType' => 'website',
'link' => '',
'image' => $this->social_icon_url . '/08-full-symbol-grey/Website.png',
'height' => '32px',
'width' => '32px',
'text' => 'Website',
),
),
),
),
),
),
),
10 => array(
'type' => 'container',
'orientation' => 'horizontal',
'styles' => array(
'block' => array(
'backgroundColor' => '#4599da',
),
),
'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',
),
),
),
),
),
),
),
11 => 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' => '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 />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',
),
),
),
2 => array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'height' => '40px',
),
),
),
),
),
),
),
),
),
'globalStyles' => array(
'text' => array(
'fontColor' => '#000000',
'fontFamily' => 'Arial',
'fontSize' => '12px',
),
'h1' => array(
'fontColor' => '#4599da',
'fontFamily' => 'Arial',
'fontSize' => '26px',
),
'h2' => array(
'fontColor' => '#878787',
'fontFamily' => 'Arial',
'fontSize' => '18px',
),
'h3' => array(
'fontColor' => '#333333',
'fontFamily' => 'Arial',
'fontSize' => '14px',
),
'link' => array(
'fontColor' => '#4599da',
'textDecoration' => 'underline',
),
'wrapper' => array(
'backgroundColor' => '#ffffff',
),
'body' => array(
'backgroundColor' => '#f4f4f4',
),
),
);
}
private function getThumbnail() {
return $this->template_image_url . '/welcome-to-foodbox.jpg';
}
}

View File

@ -1,351 +0,0 @@
<?php
namespace MailPoet\Config\PopulatorData\Templates;
if(!defined('ABSPATH')) exit;
class FranksRoastHouseTemplate {
function __construct($assets_url) {
$this->assets_url = $assets_url;
$this->external_template_image_url = '//ps.w.org/mailpoet/assets/newsletter-templates/franks-roast-house';
$this->social_icon_url = $this->assets_url . '/img/newsletter_editor/social-icons';
}
function get() {
return array(
'name' => __("Frank's Roast House", 'mailpoet'),
'description' => __("Think of this as your sandbox. Play around with this example newsletter to see what MailPoet can do for you.", 'mailpoet'),
'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(
"orientation" => "horizontal",
"blocks" => array(
array(
"type" => "container",
"orientation" => "vertical",
"styles" => array(
"block" => array(
"backgroundColor" => "transparent"
)
),
"blocks" => array(
array(
"type" => "header",
"text" => __("<a href=\"[link:newsletter_view_in_browser_url]\">Open this email in your web browser.</a>", 'mailpoet'),
"styles" => array(
"block" => array(
"backgroundColor" => "#ccc6c6"
),
"text" => array(
"fontColor" => "#222222",
"fontFamily" => "Arial",
"fontSize" => "12px",
"textAlign" => "center"
),
"link" => array(
"fontColor" => "#36251e",
"textDecoration" => "underline"
)
)
),
array(
"type" => "image",
"link" => "http://www.example.com",
"src" => $this->external_template_image_url . "/header-v2.jpg",
"alt" => __("Frank's Café", 'mailpoet'),
"fullWidth" => true,
"width" => "600px",
"height" => "220px",
"styles" => array(
"block" => array(
"textAlign" => "center"
)
)
),
array(
"type" => "spacer",
"styles" => array(
"block" => array(
"backgroundColor" => "transparent",
"height" => "30px"
)
)
),
array(
"type" => "text",
"text" => __("<p>Hi there [subscriber:firstname | default:coffee drinker]</p>\n<p></p>\n<p>Sit back and enjoy your favorite roast as you read this week's newsletter. </p>", 'mailpoet')
),
array(
"type" => "image",
"link" => "http://example.org",
"src" => $this->external_template_image_url . "/coffee-grain.jpg",
"alt" => __('Coffee grain', 'mailpoet'),
"fullWidth" => false,
"width" => "1599px",
"height" => "777px",
"styles" => array(
"block" => array(
"textAlign" => "center"
)
)
),
array(
"type" => "text",
"text" => __("<h1 style=\"text-align: center;\">--- Guest Coffee Roaster: <em>Brew Bros. ---</em></h1>\n<p><em></em></p>\n<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>\n<p></p>\n<blockquote>\n<p><span style=\"color: #ff6600;\"><em>Tasting notes: A rich, caramel flavor with subtle hints of molasses. The perfect wake-up morning espresso!</em></span></p>\n</blockquote>", 'mailpoet')
)
)
)
),
"type" => "container",
"styles" => array(
"block" => array(
"backgroundColor" => "transparent"
)
)
),
array(
"orientation" => "horizontal",
"blocks" => array(
array(
"type" => "container",
"orientation" => "vertical",
"styles" => array(
"block" => array(
"backgroundColor" => "transparent"
)
),
"blocks" => array(
array(
"type" => "text",
"text" => __("<h2>Sandwich Competition</h2>", 'mailpoet')
),
array(
"type" => "image",
"link" => "http://example.org",
"src" => $this->external_template_image_url . "/sandwich.jpg",
"alt" => __('Sandwich', 'mailpoet'),
"fullWidth" => false,
"width" => "640px",
"height" => "344px",
"styles" => array(
"block" => array(
"textAlign" => "center"
)
)
),
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>\n<p></p>\n<p></p>\n<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>", 'mailpoet')
),
array(
"type" => "button",
"text" => ("Find out more"),
"url" => "http://example.org",
"styles" => array(
"block" => array(
"backgroundColor" => "#047da7",
"borderColor" => "#004a68",
"borderWidth" => "1px",
"borderRadius" => "3px",
"borderStyle" => "solid",
"width" => "180px",
"lineHeight" => "34px",
"fontColor" => "#ffffff",
"fontFamily" => "Arial",
"fontSize" => "14px",
"fontWeight" => "normal",
"textAlign" => "center"
)
)
),
array(
"type" => "text",
"text" => __("<h3 style=\"text-align: center;\">Follow Us</h3>", 'mailpoet')
),
array(
"type" => "social",
"iconSet" => "full-symbol-black",
"icons" => array(
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"
),
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"
),
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"
),
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"
)
)
)
)
),
array(
"type" => "container",
"orientation" => "vertical",
"styles" => array(
"block" => array(
"backgroundColor" => "transparent"
)
),
"blocks" => array(
array(
"type" => "text",
"text" => __("<h2>New Store Opening!</h2>", 'mailpoet')
),
array(
"type" => "image",
"link" => "http://example.org",
"src" => $this->external_template_image_url . "/map-v2.jpg",
"alt" => __('Map', 'mailpoet'),
"fullWidth" => false,
"width" => "636px",
"height" => "342px",
"styles" => array(
"block" => array(
"textAlign" => "center"
)
)
),
array(
"type" => "text",
"text" => __("<p>Watch out Broad Street, we're coming to you very soon! </p>\n<p></p>\n<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>", 'mailpoet')
),
array(
"type" => "text",
"text" => __("<h2>New and Improved Hours!</h2>\n<p></p>\n<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>\n<p></p>\n<ul>\n<li>Monday - Thursday: 6am - 12am</li>\n<li>Friday - Saturday: 6am - 1:30am</li>\n<li>Sunday: 7:30am - 11pm</li>\n</ul>", 'mailpoet')
)
)
)
),
"type" => "container",
"styles" => array(
"block" => array(
"backgroundColor" => "#ebebeb"
)
)
),
array(
"orientation" => "horizontal",
"blocks" => array(
array(
"type" => "container",
"orientation" => "vertical",
"styles" => array(
"block" => array(
"backgroundColor" => "transparent"
)
),
"blocks" => array(
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>", 'mailpoet'),
"styles" => array(
"block" => array(
"backgroundColor" => "#a9a7a7"
),
"text" => array(
"fontColor" => "#000000",
"fontFamily" => "Arial",
"fontSize" => "12px",
"textAlign" => "center"
),
"link" => array(
"fontColor" => "#000000",
"textDecoration" => "underline"
)
)
)
)
)
),
"type" => "container",
"styles" => array(
"block" => array(
"backgroundColor" => "transparent"
)
)
)
)
),
"globalStyles" => array(
"text" => array(
"fontColor" => "#000000",
"fontFamily" => "Arial",
"fontSize" => "14px"
),
"h1" => array(
"fontColor" => "#604b4b",
"fontFamily" => "Lucida",
"fontSize" => "30px"
),
"h2" => array(
"fontColor" => "#047da7",
"fontFamily" => "Lucida",
"fontSize" => "22px"
),
"h3" => array(
"fontColor" => "#333333",
"fontFamily" => "Georgia",
"fontSize" => "20px"
),
"link" => array(
"fontColor" => "#047da7",
"textDecoration" => "underline"
),
"wrapper" => array(
"backgroundColor" => "#ffffff"
),
"body" => array(
"backgroundColor" => "#ccc6c6"
)
)
);
}
private function getThumbnail() {
return $this->external_template_image_url . '/screenshot.jpg';
}
}

View File

@ -0,0 +1,721 @@
<?php
namespace MailPoet\Config\PopulatorData\Templates;
class KickOff {
private $template_image_url;
private $social_icon_url;
function __construct($assets_url) {
$this->template_image_url = '//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'),
'description' => __("Sporty green template for your team or sport event.", 'mailpoet'),
'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 &amp; 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';
}
}

View File

@ -0,0 +1,555 @@
<?php
namespace MailPoet\Config\PopulatorData\Templates;
class NewsDay {
private $template_image_url;
private $social_icon_url;
function __construct($assets_url) {
$this->template_image_url = '//ps.w.org/mailpoet/assets/newsletter-templates/news_day';
$this->social_icon_url = $assets_url . '/img/newsletter_editor/social-icons';
}
function get() {
return array(
'name' => __("News Day", 'mailpoet'),
'description' => __("Media ready template. ", 'mailpoet'),
'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' => '#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' => '#f2f2f2',
'height' => '20px',
),
),
),
1 => array(
'type' => 'image',
'link' => '',
'src' => $this->template_image_url . '/News-Outlet-Title-2.jpg',
'alt' => 'News-Outlet-Title-2',
'fullWidth' => true,
'width' => '1280px',
'height' => '700px',
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
),
),
),
),
1 => 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' => '25px',
),
),
),
),
),
),
),
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' => 'text',
'text' => '<h1 style="text-align: left;"><span style="color: #2ca5d2;"><strong>Top Story</strong></span></h1>',
),
1 => array(
'type' => 'text',
'text' => '<h2 style="text-align: left;" data-post-id="1991"><strong>Plasma jet engines that could take you from the ground to space</strong></h2>',
),
2 => array(
'type' => 'image',
'link' => 'http://mailpoet.info/plasma-jet-engines-that-could-take-you-from-the-ground-to-space/',
'src' => $this->template_image_url . '/plasma-stingray111-800x533.jpg',
'alt' => 'Plasma jet engines that could take you from the ground to space',
'fullWidth' => false,
'width' => 660,
'height' => 440,
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
3 => array(
'type' => 'text',
'text' => '<p class="mailpoet_wp_post">FORGET fuel-powered jet engines. Were on the verge of having aircraft that can fly from the ground up to the edge of space using air and electricity alone. Traditional jet engines create thrust by mixing compressed air with fuel and igniting it. The burning mixture expands rapidly and is blasted out of the back of the engine, pushing it forwards. &hellip;</p><p><a href="http://mailpoet.info/plasma-jet-engines-that-could-take-you-from-the-ground-to-space/">Read More</a></p>',
),
4 => array(
'type' => 'divider',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'padding' => '13px',
'borderStyle' => 'solid',
'borderWidth' => '1px',
'borderColor' => '#aaaaaa',
),
),
),
5 => array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'height' => '20px',
),
),
),
6 => array(
'type' => 'text',
'text' => '<h3><span style="color: #2ca5d2;"><strong>Popular Posts Today</strong></span></h3>',
),
7 => 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' => 'text',
'text' => '<h3 style="text-align: left; font-size: 18px; line-height: 1.4;" data-post-id="1997"><strong>Cutting through the smog: What to do to fight air pollution</strong></h3>
<p class="mailpoet_wp_post">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>
<p><a href="http://mailpoet.info/cutting-through-the-smog-what-to-do-to-fight-air-pollution/">Read More</a></p>',
),
1 => array(
'type' => 'divider',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'padding' => '13px',
'borderStyle' => 'solid',
'borderWidth' => '1px',
'borderColor' => '#aaaaaa',
),
),
),
2 => array(
'type' => 'text',
'text' => '<h3 style="text-align: left; font-size: 18px; line-height: 1.4;" data-post-id="1994"><strong>Ladybird&rsquo;s transparent shell reveals how it&nbsp;moves</strong></h3>
<p class="mailpoet_wp_post">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>
<p><a href="http://mailpoet.info/ladybirds-transparent-shell-reveals-how-it-folds-its-wings/">Read More</a></p>',
),
3 => array(
'type' => 'divider',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'padding' => '13px',
'borderStyle' => 'solid',
'borderWidth' => '1px',
'borderColor' => '#aaaaaa',
),
),
),
4 => array(
'type' => 'text',
'text' => '<h3 style="text-align: left; font-size: 18px; line-height: 1.4;" data-post-id="1938"><strong>Brazil&rsquo;s history-making Hurricane</strong></h3>
<p class="mailpoet_wp_post">Jairzinho has just made history. In claiming the fourth goal of an unforgettable 1970 FIFA World Cup Mexico&trade; Final against Italy, he has maintained his record of scoring in every one of Brazil&rsquo;s matches en route to the Trophy.</p>
<p><a href="http://mailpoet.info/brazils-history-making-hurricane/">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; font-size: 18px; line-height: 1.4;" data-post-id="1935"><strong>Iceland&rsquo;s dentist-coach defying convention and expectations</strong></h3>
<p class="mailpoet_wp_post">As Iceland&rsquo;s key matches loom, with kick-off just a couple of hours away, you will find their national coach in the pub. This may seem unusual...</p>
<p><a href="http://mailpoet.info/icelands-dentist-coach-defying-convention-and-expectations/">Read More</a></p>',
),
1 => array(
'type' => 'divider',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'padding' => '13px',
'borderStyle' => 'solid',
'borderWidth' => '1px',
'borderColor' => '#aaaaaa',
),
),
),
2 => array(
'type' => 'text',
'text' => '<h3 style="text-align: left; font-size: 18px; line-height: 1.4;" data-post-id="1932"><strong>Impact and legacy of 2018 FIFA World Cup Russia</strong></h3>
<p class="mailpoet_wp_post">Organising a FIFA World Cup&trade; in a sustainable manner is a major challenge. The scale of the event inevitably has an impact on the Host Country.&nbsp;</p>
<p><a href="http://mailpoet.info/impact-and-legacy-of-2018-fifa-world-cup-russia-facts-and-figures/">Read More</a></p>',
),
3 => array(
'type' => 'divider',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'padding' => '13px',
'borderStyle' => 'solid',
'borderWidth' => '1px',
'borderColor' => '#aaaaaa',
),
),
),
4 => array(
'type' => 'text',
'text' => '<h3 style="text-align: left; font-size: 18px; line-height: 1.4;" data-post-id="1929"><strong>Lineker&rsquo;s life-changing treble</strong></h3>
<p class="mailpoet_wp_post">Given that he won the Golden Boot in his first and came within a whisker of the Final in his second, one might expect Gary Lineker to have a tough time picking his FIFA World Cup&trade; highlight. Yet the man who scored ten times...</p>
<p><a href="http://mailpoet.info/linekers-life-changing-treble/">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' => '40px',
),
),
),
1 => array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => '#f2f2f2',
'height' => '40px',
),
),
),
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' => 'footer',
'text' => '<p><strong>NewsDay</strong></p>
<p><a href="[link:subscription_unsubscribe_url]">Unsubscribe</a> | <a href="[link:subscription_manage_url]">Manage subscription</a><br /><br /></p>
<p></p>',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
),
'text' => array(
'fontColor' => '#222222',
'fontFamily' => 'Arial',
'fontSize' => '12px',
'textAlign' => 'left',
),
'link' => array(
'fontColor' => '#6cb7d4',
'textDecoration' => 'underline',
),
),
),
),
),
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' => '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',
'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',
'height' => '32px',
'width' => '32px',
'text' => 'Twitter',
),
2 => array(
'type' => 'socialIcon',
'iconType' => 'youtube',
'link' => 'http://www.youtube.com',
'image' => $this->social_icon_url . '/03-circles/Youtube.png',
'height' => '32px',
'width' => '32px',
'text' => 'Youtube',
),
3 => array(
'type' => 'socialIcon',
'iconType' => 'instagram',
'link' => 'http://instagram.com',
'image' => $this->social_icon_url . '/03-circles/Instagram.png',
'height' => '32px',
'width' => '32px',
'text' => 'Instagram',
),
4 => array(
'type' => 'socialIcon',
'iconType' => 'linkedin',
'link' => 'http://www.linkedin.com',
'image' => $this->social_icon_url . '/03-circles/LinkedIn.png',
'height' => '32px',
'width' => '32px',
'text' => 'LinkedIn',
),
),
),
2 => array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'height' => '20px',
),
),
),
),
),
),
),
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' => '#f2f2f2',
'height' => '40px',
),
),
),
),
),
),
),
),
),
'globalStyles' => array(
'text' => array(
'fontColor' => '#000000',
'fontFamily' => 'Arial',
'fontSize' => '13px',
),
'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' => '#2ca5d2',
'textDecoration' => 'underline',
),
'wrapper' => array(
'backgroundColor' => '#ffffff',
),
'body' => array(
'backgroundColor' => '#f2f2f2',
),
),
);
}
private function getThumbnail() {
return $this->template_image_url . '/news-day.jpg';
}
}

View File

@ -0,0 +1,444 @@
<?php
namespace MailPoet\Config\PopulatorData\Templates;
class PieceOfCake {
private $template_image_url;
private $social_icon_url;
function __construct($assets_url) {
$this->template_image_url = '//ps.w.org/mailpoet/assets/newsletter-templates/piece_of_cake';
$this->social_icon_url = $assets_url . '/img/newsletter_editor/social-icons';
}
function get() {
return array(
'name' => __("Piece of cake", 'mailpoet'),
'description' => __("Baked with plenty of images.", 'mailpoet'),
'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' => '#ffffff',
),
),
'blocks' => array(
0 => array(
'type' => 'container',
'orientation' => 'vertical',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
),
),
'blocks' => array(
0 => array(
'type' => 'header',
'text' => '<p><strong>Open daily from 9am to 9pm |&nbsp;<a href="[link:newsletter_view_in_browser_url]">View Online</a></strong></p>',
'styles' => array(
'block' => array(
'backgroundColor' => '#ececeb',
),
'text' => array(
'fontColor' => '#606060',
'fontFamily' => 'Arial',
'fontSize' => '13px',
'textAlign' => 'right',
),
'link' => array(
'fontColor' => '#d42b2b',
'textDecoration' => 'none',
),
),
),
1 => array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'height' => '30px',
),
),
),
2 => array(
'type' => 'image',
'link' => '',
'src' => $this->template_image_url . '/Restaurant-Bakery-Logo-1.png',
'alt' => 'Restaurant-Bakery-Logo-1',
'fullWidth' => true,
'width' => '1280px',
'height' => '180px',
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
3 => array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'height' => '30px',
),
),
),
4 => array(
'type' => 'image',
'link' => '',
'src' => $this->template_image_url . '/Restaurant-Bakery-Header.jpg',
'alt' => 'Restaurant-Bakery-Header',
'fullWidth' => true,
'width' => '1280px',
'height' => '1600px',
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
5 => array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'height' => '40px',
),
),
),
6 => array(
'type' => 'text',
'text' => '<h1 style="text-align: center;"><strong>It\'s our Birthday!</strong></h1>',
),
7 => array(
'type' => 'text',
'text' => '<h3 style="text-align: center; line-height: 1.4;">To celebrate, we\'re adding a slice of our Birthday cake to every order. Pop in this weekend to use our special offer code and enjoy!</h3>',
),
8 => 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' => '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' => '<p style="text-align: center; border: 3px dashed #d42b2b; color: #d42b2b; padding: 10px; font-size: 24px;"><strong>HAPPYBDAY</strong></p>',
),
),
),
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',
),
),
),
),
),
),
),
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' => '50px',
),
),
),
),
),
),
),
3 => array(
'type' => 'container',
'orientation' => 'horizontal',
'styles' => array(
'block' => array(
'backgroundColor' => '#ececeb',
),
),
'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',
),
),
),
),
),
),
),
4 => array(
'type' => 'container',
'orientation' => 'horizontal',
'styles' => array(
'block' => array(
'backgroundColor' => '#ececeb',
),
),
'blocks' => array(
0 => array(
'type' => 'container',
'orientation' => 'vertical',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
),
),
'blocks' => array(
0 => array(
'type' => 'text',
'text' => '<p style="background-color: #ececeb; line-height: 1.3;"><span style="font-weight: 600;"><span style="font-size: 12px; text-align: center;">Add your postal address here.</span></span></p>',
),
),
),
1 => array(
'type' => 'container',
'orientation' => 'vertical',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
),
),
'blocks' => array(
0 => 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',
'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',
'height' => '32px',
'width' => '32px',
'text' => 'Twitter',
),
2 => array(
'type' => 'socialIcon',
'iconType' => 'youtube',
'link' => 'http://www.youtube.com',
'image' => $this->social_icon_url . '/06-full-symbol-color/Youtube.png',
'height' => '32px',
'width' => '32px',
'text' => 'Youtube',
),
3 => array(
'type' => 'socialIcon',
'iconType' => 'instagram',
'link' => 'http://instagram.com',
'image' => $this->social_icon_url . '/06-full-symbol-color/Instagram.png',
'height' => '32px',
'width' => '32px',
'text' => 'Instagram',
),
),
),
),
),
2 => array(
'type' => 'container',
'orientation' => 'vertical',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
),
),
'blocks' => array(
0 => array(
'type' => 'text',
'text' => '<p style="text-align: right; line-height: 1.3;"><strong><a href="[link:subscription_unsubscribe_url]" style="color: #d42b2b; text-decoration: none; font-size: 12px; text-align: center;">Unsubscribe</a></strong></p>
<p style="text-align: right; line-height: 1.3;"><strong><a href="[link:subscription_manage_url]" style="color: #d42b2b; text-decoration: none; font-size: 12px; text-align: center;">Manage&nbsp;Subscription</a></strong></p>',
),
),
),
),
),
5 => array(
'type' => 'container',
'orientation' => 'horizontal',
'styles' => array(
'block' => array(
'backgroundColor' => '#ececeb',
),
),
'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',
),
),
),
),
),
),
),
),
),
'globalStyles' => array(
'text' => array(
'fontColor' => '#606060',
'fontFamily' => 'Arial',
'fontSize' => '16px',
),
'h1' => array(
'fontColor' => '#606060',
'fontFamily' => 'Arial',
'fontSize' => '30px',
),
'h2' => array(
'fontColor' => '#d42b2b',
'fontFamily' => 'Arial',
'fontSize' => '24px',
),
'h3' => array(
'fontColor' => '#606060',
'fontFamily' => 'Arial',
'fontSize' => '20px',
),
'link' => array(
'fontColor' => '#d42b2b',
'textDecoration' => 'underline',
),
'wrapper' => array(
'backgroundColor' => '#ffffff',
),
'body' => array(
'backgroundColor' => '#ececeb',
),
),
);
}
private function getThumbnail() {
return $this->template_image_url . '/piece-of-cake.jpg';
}
}

View File

@ -1,413 +0,0 @@
<?php
namespace MailPoet\Config\PopulatorData\Templates;
if(!defined('ABSPATH')) exit;
class Restaurant {
function __construct($assets_url) {
$this->assets_url = $assets_url;
$this->external_template_image_url = '//ps.w.org/mailpoet/assets/newsletter-templates/restaurant';
$this->template_image_url = $this->assets_url . '/img/sample_templates/restaurant';
$this->social_icon_url = $this->assets_url . '/img/newsletter_editor/social-icons';
}
function get() {
return array(
'name' => __("Restaurant", 'mailpoet'),
'description' => __("What's fresh on the menu?", 'mailpoet'),
'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" => "",
"src" => $this->external_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" => "",
"src" => $this->external_template_image_url . "/burger.jpg",
"alt" => "burger",
"fullWidth" => true,
"width" => "1127px",
"height" => "945px",
"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" => "",
"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" => "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" => "",
"src" => $this->external_template_image_url . "/boyga-1329911-639x852.jpg",
"alt" => "boyga-1329911-639x852",
"fullWidth" => false,
"width" => "639px",
"height" => "852px",
"styles" => array(
"block" => array(
"textAlign" => "center"
)
)
), array(
"type" => "text",
"text" => "<blockquote>\n<p>These onion rings have the perfect crispy batter! - Hayley King, Daily News</p>\n</blockquote>"
))
), array(
"type" => "container",
"orientation" => "vertical",
"styles" => array(
"block" => array(
"backgroundColor" => "transparent"
)
),
"blocks" => array(array(
"type" => "image",
"link" => "",
"src" => $this->external_template_image_url . "/macaroni-w-salad-1323787.jpg",
"alt" => "Macaroni salad",
"fullWidth" => false,
"width" => "600px",
"height" => "800px",
"styles" => array(
"block" => array(
"textAlign" => "center"
)
)
), array(
"type" => "text",
"text" => "<blockquote>\n<p>NEW! Ultimate Mac &amp; Cheese Salad. Available at all locations</p>\n</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" => "29px",
"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" => "text",
"text" => "<h2 style=\"text-align: center;\">Find us at these locations</h2>"
))
))
), 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>\n<p>1263 Schoville Street</p>\n<p>53355 DENVER</p>\n<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>\n<p><em></em>157 Maine Street</p>\n<p>86432 FORT COLLINS<br />CO</p>\n<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>\n<p><em></em>5390 York Avenue</p>\n<p>64297 Pueblo</p>\n<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" => "",
"image" => $this->social_icon_url . "/07-full-symbol-black/Facebook.png",
"height" => "32px",
"width" => "32px",
"text" => "Facebook"
), array(
"type" => "socialIcon",
"iconType" => "twitter",
"link" => "",
"image" => $this->social_icon_url . "/07-full-symbol-black/Twitter.png",
"height" => "32px",
"width" => "32px",
"text" => "Twitter"
), array(
"type" => "socialIcon",
"iconType" => "instagram",
"link" => "",
"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->external_template_image_url . '/screenshot.jpg';
}
}

View File

@ -0,0 +1,677 @@
<?php
namespace MailPoet\Config\PopulatorData\Templates;
class ScienceWeekly {
private $template_image_url;
private $social_icon_url;
function __construct($assets_url) {
$this->template_image_url = '//ps.w.org/mailpoet/assets/newsletter-templates/science_weekly';
$this->social_icon_url = $assets_url . '/img/newsletter_editor/social-icons';
}
function get() {
return array(
'name' => __("Science Weekly", 'mailpoet'),
'description' => __("The right chemistry to send your weekly posts.", 'mailpoet'),
'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' => '#ffffff',
),
),
'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 . '/Science-Logo.png',
'alt' => 'Science-Logo',
'fullWidth' => true,
'width' => '1280px',
'height' => '300px',
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
1 => array(
'type' => 'image',
'link' => '',
'src' => $this->template_image_url . '/Health-Mag-Title-2.png',
'alt' => 'Health-Mag-Title-2',
'fullWidth' => true,
'width' => '1280px',
'height' => '300px',
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
),
),
),
),
1 => array(
'type' => 'container',
'orientation' => 'horizontal',
'styles' => array(
'block' => array(
'backgroundColor' => '#b1b6d1',
),
),
'blocks' => array(
0 => array(
'type' => 'container',
'orientation' => 'vertical',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
),
),
'blocks' => array(
0 => array(
'type' => 'text',
'text' => '<p style="text-align: center; font-size: 12px;"><span style="color: #ffffff;">Display problems?&nbsp;<a href="[link:newsletter_view_in_browser_url]" style="color: #ffffff;">Open this email in your web browser.</a></span></p>',
),
),
),
),
),
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' => '#b1b6d1',
'height' => '20px',
),
),
),
),
),
),
),
3 => 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' => '20px',
),
),
),
1 => array(
'type' => 'automatedLatestContent',
'amount' => '2',
'contentType' => 'post',
'terms' => array(),
'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(
'type' => 'button',
'text' => 'Read more',
'url' => '[postLink]',
'styles' => array(
'block' => array(
'backgroundColor' => '#2b2d37',
'borderColor' => '#112d31',
'borderWidth' => '1px',
'borderRadius' => '21px',
'borderStyle' => 'solid',
'width' => '114px',
'lineHeight' => '33px',
'fontColor' => '#ffffff',
'fontFamily' => 'Arial',
'fontSize' => '16px',
'fontWeight' => 'normal',
'textAlign' => 'left',
),
),
),
'sortBy' => 'newest',
'showDivider' => true,
'divider' => array(
'type' => 'divider',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'padding' => '13px',
'borderStyle' => 'solid',
'borderWidth' => '3px',
'borderColor' => '#aaaaaa',
),
),
),
'backgroundColor' => '#ffffff',
'backgroundColorAlternate' => '#eeeeee',
),
),
),
),
),
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' => '#ffffff',
'height' => '30px',
),
),
),
1 => array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => '#b1b6d1',
'height' => '20px',
),
),
),
2 => array(
'type' => 'image',
'link' => '',
'src' => $this->template_image_url . '/Health-Mag-End-1.png',
'alt' => 'Health-Mag-End',
'fullWidth' => true,
'width' => '1280px',
'height' => '50px',
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
3 => array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => '#2b2d37',
'height' => '35px',
),
),
),
),
),
),
),
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 . '/Health-Mag-Promo-Start.png',
'alt' => 'Health-Mag-Promo-Start',
'fullWidth' => true,
'width' => '1280px',
'height' => '50px',
'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' => 'transparent',
'height' => '50px',
),
),
),
1 => array(
'type' => 'text',
'text' => '<h2><strong>Download our app!</strong></h2>
<p><span>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed in odio dui. Duis et dolor nec erat dictum laoreet. Morbi dapibus turpis id eros viverra tempor. </span></p>
<p><span></span></p>
<p><span>Fusce et diam ac sapien posuere luctus. Etiam in vehicula metus, ac viverra elit. Duis diam lacus, molestie vel enim non, rutrum placerat massa. Suspendisse a elit tincidunt, egestas lacus at, maximus diam. </span></p>
<p><span></span></p>',
),
2 => array(
'type' => 'button',
'text' => 'Download Now',
'url' => '',
'styles' => array(
'block' => array(
'backgroundColor' => '#2b2d37',
'borderColor' => '#2b2d37',
'borderWidth' => '1px',
'borderRadius' => '40px',
'borderStyle' => 'solid',
'width' => '144px',
'lineHeight' => '40px',
'fontColor' => '#ffffff',
'fontFamily' => 'Arial',
'fontSize' => '16px',
'fontWeight' => 'normal',
'textAlign' => 'left',
),
),
),
),
),
1 => array(
'type' => 'container',
'orientation' => 'vertical',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
),
),
'blocks' => array(
0 => array(
'type' => 'image',
'link' => '',
'src' => $this->template_image_url . '/Health-Mag-Phone.png',
'alt' => 'Health-Mag-Phone',
'fullWidth' => false,
'width' => '400px',
'height' => '573px',
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
),
),
),
),
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' => 'image',
'link' => '',
'src' => $this->template_image_url . '/Health-Mag-Promo-End.png',
'alt' => 'Health-Mag-Promo-End',
'fullWidth' => true,
'width' => '1280px',
'height' => '50px',
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
),
),
),
),
8 => 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' => '#2b2d37',
'height' => '35px',
),
),
),
1 => array(
'type' => 'image',
'link' => '',
'src' => $this->template_image_url . '/Health-Mag-Promo-Start.png',
'alt' => 'Health-Mag-Promo-Start',
'fullWidth' => true,
'width' => '1280px',
'height' => '50px',
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
),
),
),
),
9 => 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;">Keep In Touch With Us</h3>',
),
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',
'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',
'height' => '32px',
'width' => '32px',
'text' => 'Twitter',
),
2 => array(
'type' => 'socialIcon',
'iconType' => 'youtube',
'link' => 'http://www.youtube.com',
'image' => $this->social_icon_url . '/03-circles/Youtube.png',
'height' => '32px',
'width' => '32px',
'text' => 'Youtube',
),
3 => array(
'type' => 'socialIcon',
'iconType' => 'instagram',
'link' => 'http://instagram.com',
'image' => $this->social_icon_url . '/03-circles/Instagram.png',
'height' => '32px',
'width' => '32px',
'text' => 'Instagram',
),
),
),
),
),
),
),
10 => 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 . '/Health-Mag-Promo-End.png',
'alt' => 'Health-Mag-Promo-End',
'fullWidth' => true,
'width' => '1280px',
'height' => '50px',
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
1 => array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => '#2b2d37',
'height' => '26px',
),
),
),
2 => array(
'type' => 'footer',
'text' => '<p><span style="color: #b1b6d1;"><a href="[link:subscription_unsubscribe_url]" style="color: #b1b6d1;">Unsubscribe</a> | <a href="[link:subscription_manage_url]" style="color: #b1b6d1;">Manage subscription</a></span><br />Add your postal address here!</p>',
'styles' => array(
'block' => array(
'backgroundColor' => '#2b2d37',
),
'text' => array(
'fontColor' => '#d6d6d6',
'fontFamily' => 'Arial',
'fontSize' => '12px',
'textAlign' => 'center',
),
'link' => array(
'fontColor' => '#6cb7d4',
'textDecoration' => 'none',
),
),
),
3 => array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => '#2b2d37',
'height' => '40px',
),
),
),
),
),
),
),
),
),
'globalStyles' => array(
'text' => array(
'fontColor' => '#000000',
'fontFamily' => 'Arial',
'fontSize' => '15px',
),
'h1' => array(
'fontColor' => '#111111',
'fontFamily' => 'Arial',
'fontSize' => '26px',
),
'h2' => array(
'fontColor' => '#222222',
'fontFamily' => 'Arial',
'fontSize' => '22px',
),
'h3' => array(
'fontColor' => '#333333',
'fontFamily' => 'Arial',
'fontSize' => '20px',
),
'link' => array(
'fontColor' => '#21759B',
'textDecoration' => 'underline',
),
'wrapper' => array(
'backgroundColor' => '#ffffff',
),
'body' => array(
'backgroundColor' => '#2b2d37',
),
),
);
}
private function getThumbnail() {
return $this->template_image_url . '/science-weekly.jpg';
}
}

View File

@ -0,0 +1,579 @@
<?php
namespace MailPoet\Config\PopulatorData\Templates;
class Shoes {
private $template_image_url;
private $social_icon_url;
function __construct($assets_url) {
$this->template_image_url = '//ps.w.org/mailpoet/assets/newsletter-templates/shoes';
$this->social_icon_url = $assets_url . '/img/newsletter_editor/social-icons';
}
function get() {
return array(
'name' => __("Shoes", 'mailpoet'),
'description' => __("Nothing like a pair that fits perfectly.", 'mailpoet'),
'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' => '#f6f6f6',
),
),
'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 . '/Retail-Shoes-Logo.png',
'alt' => 'Retail-Shoes-Logo',
'fullWidth' => true,
'width' => '1280px',
'height' => '220px',
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
),
),
),
),
1 => 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' => 'image',
'link' => '',
'src' => $this->template_image_url . '/Retail-Shoes-Header.jpg',
'alt' => 'Retail-Shoes-Header',
'fullWidth' => true,
'width' => '1280px',
'height' => '700px',
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
),
),
),
),
2 => array(
'type' => 'container',
'orientation' => 'horizontal',
'styles' => array(
'block' => array(
'backgroundColor' => '#f1b512',
),
),
'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' => '<h2 style="text-align: center;"><span style="color: #614a0d;">Our New Range</span></h2>
<p style="text-align: center;"><span style="color: #614a0d;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque cursus aliquam urna, non ultricies diam sagittis sit amet. Etiam tempus a metus sed tincidunt.</span></p>
<p style="text-align: center;"><span style="color: #614a0d;">Curabitur fermentum ligula eget lacus aliquam volutpat. Integer sapien neque, laoreet quis lobortis sed, semper eget magna. Suspendisse potentiu.</span></p>',
),
2 => array(
'type' => 'button',
'text' => 'Find Out More',
'url' => '',
'styles' => array(
'block' => array(
'backgroundColor' => '#41c7bf',
'borderColor' => '#28a9a2',
'borderWidth' => '2px',
'borderRadius' => '5px',
'borderStyle' => 'solid',
'width' => '160px',
'lineHeight' => '40px',
'fontColor' => '#ffffff',
'fontFamily' => 'Arial',
'fontSize' => '16px',
'fontWeight' => 'normal',
'textAlign' => 'center',
),
),
),
3 => array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'height' => '30px',
),
),
),
),
),
),
),
3 => array(
'type' => 'container',
'orientation' => 'horizontal',
'styles' => array(
'block' => array(
'backgroundColor' => '#36b0a9',
),
),
'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' => '70px',
),
),
),
1 => array(
'type' => 'text',
'text' => '<h2><span style="color: #ffffff;">Handcrafted Shoes</span></h2>
<p style="font-size: 14px;"><span><span style="color: #ffffff;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque cursus aliquam urna, non ultricies diam sagittis sit amet. Etiam tempus a metus sed tincidunt. Curabitur fermentum ligula eget lacus aliquam volutpat.</span></span></p>',
),
2 => 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' => '',
'src' => $this->template_image_url . '/Retail-Shoes-Boxes-1.jpg',
'alt' => 'Retail-Shoes-Boxes-1',
'fullWidth' => true,
'width' => '700px',
'height' => '700px',
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
),
),
),
),
4 => array(
'type' => 'container',
'orientation' => 'horizontal',
'styles' => array(
'block' => array(
'backgroundColor' => '#36b0a9',
),
),
'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 . '/Retail-Shoes-Boxes-2.jpg',
'alt' => 'Retail-Shoes-Boxes-2',
'fullWidth' => true,
'width' => '700px',
'height' => '700px',
'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' => '70px',
),
),
),
1 => array(
'type' => 'text',
'text' => '<h2><span style="color: #ffffff;">Perfect For Any Occasion</span></h2>
<p style="font-size: 14px;"><span><span style="color: #ffffff;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque cursus aliquam urna, non ultricies diam sagittis sit amet. Etiam tempus a metus sed tincidunt. Curabitur fermentum ligula eget lacus aliquam volutpat.</span></span></p>',
),
2 => array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'height' => '40px',
),
),
),
),
),
),
),
5 => array(
'type' => 'container',
'orientation' => 'horizontal',
'styles' => array(
'block' => array(
'backgroundColor' => '#f6f6f6',
),
),
'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' => '<h3 style="text-align: center;"><strong>We\'re open every day!</strong></h3>
<p style="text-align: center;">Call in any time and we\'ll help you pick the best shoes for any occasion.</p>
<p style="text-align: center;">If you\'re not happy, just bring them back to us and we\'ll give you a full refund.</p>',
),
2 => array(
'type' => 'button',
'text' => 'Check Out Our Website',
'url' => '',
'styles' => array(
'block' => array(
'backgroundColor' => '#41c7bf',
'borderColor' => '#28a9a2',
'borderWidth' => '2px',
'borderRadius' => '5px',
'borderStyle' => 'solid',
'width' => '220px',
'lineHeight' => '40px',
'fontColor' => '#ffffff',
'fontFamily' => 'Arial',
'fontSize' => '16px',
'fontWeight' => 'normal',
'textAlign' => 'center',
),
),
),
3 => array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'height' => '30px',
),
),
),
4 => array(
'type' => 'divider',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'padding' => '13px',
'borderStyle' => 'solid',
'borderWidth' => '2px',
'borderColor' => '#d3d3d3',
),
),
),
5 => array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'height' => '20px',
),
),
),
),
),
),
),
6 => array(
'type' => 'container',
'orientation' => 'horizontal',
'styles' => array(
'block' => array(
'backgroundColor' => '#f6f6f6',
),
),
'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 . '/Retail-Shoes-Logo-Footer.png',
'alt' => 'Retail-Shoes-Logo-Footer',
'fullWidth' => true,
'width' => '1280px',
'height' => '60px',
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
1 => array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'height' => '20px',
),
),
),
2 => array(
'type' => 'text',
'text' => '<p style="text-align: center; font-size: 12px;"><span style="color: #999999;">Address Line 1</span></p>
<p style="text-align: center; font-size: 12px;"><span style="color: #999999;">Address Line 2</span></p>
<p style="text-align: center; font-size: 12px;"><span style="color: #999999;">City</span></p>
<p style="text-align: center; font-size: 12px;"><span style="color: #999999;">Country</span></p>',
),
3 => 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',
'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',
'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',
'height' => '32px',
'width' => '32px',
'text' => 'Instagram',
),
),
),
),
),
),
),
7 => array(
'type' => 'container',
'orientation' => 'horizontal',
'styles' => array(
'block' => array(
'backgroundColor' => '#f6f6f6',
),
),
'blocks' => array(
0 => array(
'type' => 'container',
'orientation' => 'vertical',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
),
),
'blocks' => array(
0 => array(
'type' => 'footer',
'text' => '<p><a href="[link:subscription_unsubscribe_url]">Unsubscribe</a> | <a href="[link:subscription_manage_url]">Manage your subscription</a></p>',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
),
'text' => array(
'fontColor' => '#222222',
'fontFamily' => 'Arial',
'fontSize' => '12px',
'textAlign' => 'center',
),
'link' => array(
'fontColor' => '#41c7bf',
'textDecoration' => 'none',
),
),
),
1 => 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' => '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' => '#f6f6f6',
),
),
);
}
private function getThumbnail() {
return $this->template_image_url . '/shoes.jpg';
}
}

View File

@ -1,406 +0,0 @@
<?php
namespace MailPoet\Config\PopulatorData\Templates;
if(!defined('ABSPATH')) exit;
class StoreDiscount {
function __construct($assets_url) {
$this->assets_url = $assets_url;
$this->external_template_image_url = '//ps.w.org/mailpoet/assets/newsletter-templates/store-discount';
$this->template_image_url = $this->assets_url . '/img/sample_templates/discount';
$this->social_icon_url = $this->assets_url . '/img/newsletter_editor/social-icons';
}
function get() {
return array(
'name' => __("Store Discount", 'mailpoet'),
'description' => __("Store discount email with coupon and shopping suggestions", 'mailpoet'),
'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" => "spacer",
"styles" => array(
"block" => array(
"backgroundColor" => "transparent",
"height" => "20px"
)
)
), array(
"type" => "image",
"link" => "",
"src" => $this->external_template_image_url . "/bicycle-header3.png",
"alt" => __("bicycle-header3", 'mailpoet'),
"fullWidth" => false,
"width" => "423px",
"height" => "135px",
"styles" => array(
"block" => array(
"textAlign" => "center"
)
)
), array(
"type" => "text",
"text" => __("<p></p>\n<p>Hi [subscriber:firstname | default:reader]</p>\n<p class=\"\"></p>\n<p>Fancy 15% off your next order? Use this coupon on any product in our store. Expires Wednesday! To apply the discount, enter the code on the payments page.</p>", 'mailpoet')
), array(
"type" => "spacer",
"styles" => array(
"block" => array(
"backgroundColor" => "transparent",
"height" => "20px"
)
)
))
))
), array(
"type" => "container",
"orientation" => "horizontal",
"styles" => array(
"block" => array(
"backgroundColor" => "#ebdddd"
)
),
"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" => "16px",
"borderStyle" => "dashed",
"borderWidth" => "2px",
"borderColor" => "#9a5fa1"
)
)
), array(
"type" => "text",
"text" => __("<h1 style=\"text-align: center;\"><em><strong>Get a 15% off your next order</strong></em></h1>", 'mailpoet')
), array(
"type" => "text",
"text" => __("<h2 style=\"text-align: center;\"><strong>USE CODE: WELOVEMAILPOET</strong></h2>", 'mailpoet')
), array(
"type" => "divider",
"styles" => array(
"block" => array(
"backgroundColor" => "transparent",
"padding" => "16px",
"borderStyle" => "dashed",
"borderWidth" => "2px",
"borderColor" => "#9a5fa1"
)
)
))
))
), 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" => "20px"
)
)
), array(
"type" => "button",
"text" => __("SHOP NOW", 'mailpoet'),
"url" => "",
"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"
)
)
), array(
"type" => "text",
"text" => __("<h1 style=\"text-align: center;\"><strong><em>Use your discount on these great products...</em></strong></h1>", 'mailpoet')
), 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" => "",
"src" => $this->external_template_image_url . "/red-icycle.jpg",
"alt" => __("red-bicycle", 'mailpoet'),
"fullWidth" => false,
"width" => "558px",
"height" => "399px",
"styles" => array(
"block" => array(
"textAlign" => "center"
)
)
), array(
"type" => "text",
"text" => __("<h3 style=\"text-align: center;\">Lovely Red Bicycle</h3>\n<p>What can we say? It's a totally awesome red bike, and it's the first of its kind in our collection. No sweat!</p>\n<h3 style=\"text-align: center;\"><strong><span style=\"color: #488e88;\">$289.99</span></strong></h3>", 'mailpoet')
), array(
"type" => "button",
"text" => __("Buy", 'mailpoet'),
"url" => "",
"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"
)
)
))
), array(
"type" => "container",
"orientation" => "vertical",
"styles" => array(
"block" => array(
"backgroundColor" => "transparent"
)
),
"blocks" => array(array(
"type" => "image",
"link" => "",
"src" => $this->external_template_image_url . "/orange-bicycle.jpg",
"alt" => __("orange-bicycle", 'mailpoet'),
"fullWidth" => false,
"width" => "639px",
"height" => "457px",
"styles" => array(
"block" => array(
"textAlign" => "center"
)
)
), array(
"type" => "text",
"text" => __("<h3 style=\"text-align: center;\">Little Orange Bicycle</h3>\n<p>Another product that's just as awesome but it's the second type, and more orange, with some blue. Cool beans!</p>\n<h3 style=\"line-height: 22.4px; text-align: center;\"><span style=\"color: #488e88;\"><strong>$209.99</strong></span></h3>", 'mailpoet')
), array(
"type" => "button",
"text" => __("Buy", 'mailpoet'),
"url" => "",
"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"
)
)
))
))
), 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" => "22px"
)
)
), array(
"type" => "divider",
"styles" => array(
"block" => array(
"backgroundColor" => "transparent",
"padding" => "20px",
"borderStyle" => "solid",
"borderWidth" => "1px",
"borderColor" => "#9e9e9e"
)
)
), array(
"type" => "text",
"text" => __("<p><em>Terms and Conditions:</em></p>\n<ul>\n<li><span style=\"line-height: 1.6em; background-color: inherit;\">Must be used by midnight EST December 15 2036.</span></li>\n<li><span style=\"line-height: 1.6em; background-color: inherit;\">Discount does not include shipping.</span></li>\n<li><span style=\"line-height: 1.6em; background-color: inherit;\">Cannot be used in conjunction with any other offer.</span></li>\n</ul>", 'mailpoet')
), array(
"type" => "social",
"iconSet" => "grey",
"icons" => array(array(
"type" => "socialIcon",
"iconType" => "facebook",
"link" => "",
"image" => $this->social_icon_url . "/02-grey/Facebook.png",
"height" => "32px",
"width" => "32px",
"text" => __("Facebook", 'mailpoet')
), array(
"type" => "socialIcon",
"iconType" => "twitter",
"link" => "",
"image" => $this->social_icon_url . "/02-grey/Twitter.png",
"height" => "32px",
"width" => "32px",
"text" => __("Twitter", 'mailpoet')
))
), array(
"type" => "footer",
"text" => __("<p><a href=\"[link:subscription_unsubscribe_url]\">Unsubscribe</a> | <a href=\"[link:subscription_manage_url]\">Manage subscription</a></p>\n<p>1 Store Street, Shopville, CA 1345</p>", 'mailpoet'),
"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->external_template_image_url . '/screenshot.jpg';
}
}

View File

@ -0,0 +1,769 @@
<?php
namespace MailPoet\Config\PopulatorData\Templates;
class TakeAHike {
private $template_image_url;
private $social_icon_url;
function __construct($assets_url) {
$this->template_image_url = '//ps.w.org/mailpoet/assets/newsletter-templates/take_a_hike';
$this->social_icon_url = $assets_url . '/img/newsletter_editor/social-icons';
}
function get() {
return array(
'name' => __("Take a Hike", 'mailpoet'),
'description' => __("Can you climb to the top?", 'mailpoet'),
'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 . '/header.jpg',
'alt' => 'header',
'fullWidth' => true,
'width' => '1320px',
'height' => '483px',
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
1 => array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'height' => '20px',
),
),
),
2 => array(
'type' => 'text',
'text' => '<p>Hi&nbsp;[subscriber:firstname | default:explorer]</p>
<p></p>
<p>Aliquam feugiat nisl eget eleifend congue. Nullam neque tellus, elementum vel elit dictum, tempus sagittis nunc. Phasellus quis commodo odio. Vestibulum vitae mi vel quam rhoncus egestas eget vitae eros.&nbsp;</p>',
),
3 => array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'height' => '20px',
),
),
),
4 => array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => '#843c15',
'height' => '40px',
),
),
),
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' => 'text',
'text' => '<h1><strong>How to plan your hiking route</strong></h1>
<p>Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Aliquam dictum urna ac lacus dapibus rhoncus.</p>',
),
1 => array(
'type' => 'button',
'text' => 'Read More',
'url' => 'https://www.google.co.uk',
'styles' => array(
'block' => array(
'backgroundColor' => '#64a1af',
'borderColor' => '#0074a2',
'borderWidth' => '0px',
'borderRadius' => '5px',
'borderStyle' => 'solid',
'width' => '150px',
'lineHeight' => '34px',
'fontColor' => '#ffffff',
'fontFamily' => 'Courier New',
'fontSize' => '18px',
'fontWeight' => 'bold',
'textAlign' => 'left',
),
),
),
),
),
1 => array(
'type' => 'container',
'orientation' => 'vertical',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
),
),
'blocks' => array(
0 => array(
'type' => 'image',
'link' => '',
'src' => $this->template_image_url . '/map.jpg',
'alt' => 'map',
'fullWidth' => false,
'width' => '330px',
'height' => '227px',
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
),
),
),
),
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' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => '#843c15',
'height' => '40px',
),
),
),
2 => 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' => '',
'src' => $this->template_image_url . '/boots.jpg',
'alt' => 'boots',
'fullWidth' => false,
'width' => '600px',
'height' => '400px',
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
),
),
1 => array(
'type' => 'container',
'orientation' => 'vertical',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
),
),
'blocks' => array(
0 => array(
'type' => 'text',
'text' => '<h2><strong>Tried &amp; tested: Our favourite walking boots</strong></h2>
<p>Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.&nbsp;</p>',
),
1 => array(
'type' => 'button',
'text' => 'See Reviews',
'url' => '',
'styles' => array(
'block' => array(
'backgroundColor' => '#64a1af',
'borderColor' => '#0074a2',
'borderWidth' => '0px',
'borderRadius' => '5px',
'borderStyle' => 'solid',
'width' => '150px',
'lineHeight' => '34px',
'fontColor' => '#ffffff',
'fontFamily' => 'Courier New',
'fontSize' => '18px',
'fontWeight' => 'bold',
'textAlign' => 'left',
),
),
),
),
),
),
),
4 => 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' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => '#843c15',
'height' => '40px',
),
),
),
2 => array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'height' => '20px',
),
),
),
3 => array(
'type' => 'text',
'text' => '<h3 style="text-align: center;"><strong>Hikers Gallery</strong></h3>',
),
),
),
),
),
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 . '/gallery3.jpg',
'alt' => 'gallery3',
'fullWidth' => true,
'width' => '1000px',
'height' => '750px',
'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' => '',
'src' => $this->template_image_url . '/gallery1-300x225.jpg',
'alt' => 'gallery1',
'fullWidth' => true,
'width' => '300px',
'height' => '225px',
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
),
),
2 => array(
'type' => 'container',
'orientation' => 'vertical',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
),
),
'blocks' => array(
0 => array(
'type' => 'image',
'link' => '',
'src' => $this->template_image_url . '/gallery2-1.jpg',
'alt' => 'gallery2',
'fullWidth' => true,
'width' => '1000px',
'height' => '750px',
'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' => 'transparent',
'height' => '20px',
),
),
),
1 => array(
'type' => 'text',
'text' => '<p style="text-align: center;">Edit this to insert text</p>',
),
2 => array(
'type' => 'button',
'text' => 'View More Photos',
'url' => '',
'styles' => array(
'block' => array(
'backgroundColor' => '#64a1af',
'borderColor' => '#0074a2',
'borderWidth' => '0px',
'borderRadius' => '5px',
'borderStyle' => 'solid',
'width' => '214px',
'lineHeight' => '34px',
'fontColor' => '#ffffff',
'fontFamily' => 'Courier New',
'fontSize' => '18px',
'fontWeight' => 'bold',
'textAlign' => 'center',
),
),
),
3 => array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => '#843c15',
'height' => '40px',
),
),
),
4 => array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'height' => '20px',
),
),
),
5 => array(
'type' => 'text',
'text' => '<h3 style="text-align: center;"><strong>Hiking goes social...</strong></h3>',
),
6 => 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',
'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',
'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',
'height' => '32px',
'width' => '32px',
'text' => 'Instagram',
),
3 => array(
'type' => 'socialIcon',
'iconType' => 'google-plus',
'link' => 'http://plus.google.com',
'image' => $this->social_icon_url . '/03-circles/Google-Plus.png',
'height' => '32px',
'width' => '32px',
'text' => 'Google Plus',
),
4 => array(
'type' => 'socialIcon',
'iconType' => 'youtube',
'link' => 'http://www.youtube.com',
'image' => $this->social_icon_url . '/03-circles/Youtube.png',
'height' => '32px',
'width' => '32px',
'text' => 'Youtube',
),
),
),
7 => array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'height' => '20px',
),
),
),
8 => array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => '#843c15',
'height' => '40px',
),
),
),
),
),
),
),
7 => array(
'type' => 'container',
'orientation' => 'horizontal',
'styles' => array(
'block' => array(
'backgroundColor' => '#64a1af',
),
),
'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',
),
),
),
),
),
),
),
8 => array(
'type' => 'container',
'orientation' => 'horizontal',
'styles' => array(
'block' => array(
'backgroundColor' => '#64a1af',
),
),
'blocks' => array(
0 => array(
'type' => 'container',
'orientation' => 'vertical',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
),
),
'blocks' => array(
0 => 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' => '#ffffff',
'fontFamily' => 'Arial',
'fontSize' => '13px',
'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' => 'footer',
'text' => '<p>Add your postal address here!</p>',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
),
'text' => array(
'fontColor' => '#ffffff',
'fontFamily' => 'Arial',
'fontSize' => '13px',
'textAlign' => 'right',
),
'link' => array(
'fontColor' => '#ffffff',
'textDecoration' => 'underline',
),
),
),
),
),
),
),
9 => array(
'type' => 'container',
'orientation' => 'horizontal',
'styles' => array(
'block' => array(
'backgroundColor' => '#64a1af',
),
),
'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',
),
),
),
),
),
),
),
),
),
'globalStyles' => array(
'text' => array(
'fontColor' => '#4f230c',
'fontFamily' => 'Arial',
'fontSize' => '16px',
),
'h1' => array(
'fontColor' => '#423c39',
'fontFamily' => 'Courier New',
'fontSize' => '24px',
),
'h2' => array(
'fontColor' => '#265f6d',
'fontFamily' => 'Courier New',
'fontSize' => '24px',
),
'h3' => array(
'fontColor' => '#423c39',
'fontFamily' => 'Courier New',
'fontSize' => '20px',
),
'link' => array(
'fontColor' => '#843c15',
'textDecoration' => 'underline',
),
'wrapper' => array(
'backgroundColor' => '#ffffff',
),
'body' => array(
'backgroundColor' => '#843c15',
),
),
);
}
private function getThumbnail() {
return $this->template_image_url . '/take-a-hike.jpg';
}
}

View File

@ -1,527 +0,0 @@
<?php
namespace MailPoet\Config\PopulatorData\Templates;
if(!defined('ABSPATH')) exit;
class TravelEmail {
function __construct($assets_url) {
$this->assets_url = $assets_url;
$this->external_template_image_url = '//ps.w.org/mailpoet/assets/newsletter-templates/travel-email';
$this->template_image_url = $this->assets_url . '/img/sample_templates/travel';
$this->social_icon_url = $this->assets_url . '/img/newsletter_editor/social-icons';
}
function get() {
return array(
'name' => __("Travel email", 'mailpoet'),
'description' => __("A little postcard from your trip", 'mailpoet'),
'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" => "",
"src" => $this->external_template_image_url . "/header.png",
"alt" => __("Travelling Tales with Jane & Steven", 'mailpoet'),
"fullWidth" => true,
"width" => "660px",
"height" => "165px",
"styles" => array(
"block" => array(
"textAlign" => "center"
)
)
), array(
"type" => "spacer",
"styles" => array(
"block" => array(
"backgroundColor" => "transparent",
"height" => "30px"
)
)
), array(
"type" => "text",
"text" => __("<h1 style=\"text-align: center;\">Hi [subscriber:firstname | default:reader]!</h1>\n<p></p>\n<p>Greetings from New Zealand! We're here enjoying the sights, sounds, and smells of Rotarua! Yesterday, we visited the local hot springs, and today, we're going swimming.</p>\n<p>Don't forget to stay updated with Twitter!</p>", 'mailpoet')
), array(
"type" => "social",
"iconSet" => "circles",
"icons" => array(array(
"type" => "socialIcon",
"iconType" => "twitter",
"link" => "",
"image" => $this->social_icon_url . "/03-circles/Twitter.png",
"height" => "32px",
"width" => "32px",
"text" => __("Twitter", 'mailpoet')
))
), array(
"type" => "text",
"text" => __("<h1 style=\"text-align: center;\"><strong>Photos from Rotarua</strong></h1>", 'mailpoet')
), 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" => "",
"src" => $this->external_template_image_url . "/gallery1.jpg",
"alt" => __("hot thermals", 'mailpoet'),
"fullWidth" => false,
"width" => "640px",
"height" => "425px",
"styles" => array(
"block" => array(
"textAlign" => "center"
)
)
), array(
"type" => "spacer",
"styles" => array(
"block" => array(
"backgroundColor" => "transparent",
"height" => "40px"
)
)
))
), array(
"type" => "container",
"orientation" => "vertical",
"styles" => array(
"block" => array(
"backgroundColor" => "transparent"
)
),
"blocks" => array(array(
"type" => "image",
"link" => "",
"src" => $this->external_template_image_url . "/gallery2.jpg",
"alt" => __("The view from our campsite", 'mailpoet'),
"fullWidth" => false,
"width" => "640px",
"height" => "425px",
"styles" => array(
"block" => array(
"textAlign" => "center"
)
)
), array(
"type" => "spacer",
"styles" => array(
"block" => array(
"backgroundColor" => "transparent",
"height" => "40px"
)
)
))
))
), 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" => "",
"src" => $this->external_template_image_url . "/gallery3.jpg",
"alt" => __("Red sky at night", 'mailpoet'),
"fullWidth" => false,
"width" => "640px",
"height" => "425px",
"styles" => array(
"block" => array(
"textAlign" => "center"
)
)
))
), array(
"type" => "container",
"orientation" => "vertical",
"styles" => array(
"block" => array(
"backgroundColor" => "transparent"
)
),
"blocks" => array(array(
"type" => "image",
"link" => "",
"src" => $this->external_template_image_url . "/gallery4.jpg",
"alt" => __("Don't go chasing waterfalls", 'mailpoet'),
"fullWidth" => false,
"width" => "640px",
"height" => "425px",
"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" => "spacer",
"styles" => array(
"block" => array(
"backgroundColor" => "transparent",
"height" => "20px"
)
)
), array(
"type" => "button",
"text" => __("View NZ Photo Gallery", 'mailpoet'),
"url" => "",
"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"
)
)
))
))
), 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" => "23px",
"borderStyle" => "double",
"borderWidth" => "3px",
"borderColor" => "#aaaaaa"
)
)
), array(
"type" => "text",
"text" => __("<h2><em>Here's our top recommendations in Rotarua</em></h2>", 'mailpoet')
), 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" => "",
"src" => $this->external_template_image_url . "/glow-worms.jpg",
"alt" => __("Glowworms, Waitomo Caves", 'mailpoet'),
"fullWidth" => true,
"width" => "640px",
"height" => "428px",
"styles" => array(
"block" => array(
"textAlign" => "center"
)
)
), array(
"type" => "text",
"text" => __("<p><em><a href=\"http://www.waitomo.com/Waitomo-Glowworm-Caves/Pages/default.aspx\"><strong>Waitomo GlowWorm Caves</strong></a></em></p>", 'mailpoet')
))
), array(
"type" => "container",
"orientation" => "vertical",
"styles" => array(
"block" => array(
"backgroundColor" => "transparent"
)
),
"blocks" => array(array(
"type" => "image",
"link" => "",
"src" => $this->external_template_image_url . "/luge.jpg",
"alt" => __("luge", 'mailpoet'),
"fullWidth" => false,
"width" => "375px",
"height" => "500px",
"styles" => array(
"block" => array(
"textAlign" => "center"
)
)
), array(
"type" => "text",
"text" => __("<p><em><strong><a href=\"http://www.skyline.co.nz/rotorua/ssr_luge/\">Luge!</a></strong></em></p>", 'mailpoet')
))
), array(
"type" => "container",
"orientation" => "vertical",
"styles" => array(
"block" => array(
"backgroundColor" => "transparent"
)
),
"blocks" => array(array(
"type" => "image",
"link" => "",
"src" => $this->external_template_image_url . "/holiday-park.jpg",
"alt" => __("holiday-park", 'mailpoet'),
"fullWidth" => true,
"width" => "640px",
"height" => "425px",
"styles" => array(
"block" => array(
"textAlign" => "center"
)
)
), array(
"type" => "text",
"text" => __("<p><em><strong><a href=\"http://rotoruathermal.co.nz/\">Roturua Thermal Holiday Park</a></strong></em></p>", 'mailpoet')
))
))
), 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" => "21px"
)
)
), array(
"type" => "text",
"text" => __("<p>Tomorrow we're heading towards Taupo where we'll visit the 'Craters of the moon' and go prawn fishing! Hopefully the weather will stay good.</p>\n<p></p>\n<p>Keep on travellin'</p>\n<p>Jane &amp; Steven</p>", 'mailpoet')
))
))
), 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" => "13px",
"borderStyle" => "dotted",
"borderWidth" => "2px",
"borderColor" => "#aaaaaa"
)
)
), 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"
)
)
), array(
"type" => "footer",
"text" => __("<p><a href=\"[link:subscription_unsubscribe_url]\">Unsubscribe</a> | <a href=\"[link:subscription_manage_url]\">Manage subscription</a></p>", 'mailpoet'),
"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" => "24px"
),
"h2" => array(
"fontColor" => "#180d6b",
"fontFamily" => "Trebuchet MS",
"fontSize" => "20px"
),
"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->external_template_image_url . '/screenshot.jpg';
}
}

View File

@ -0,0 +1,603 @@
<?php
namespace MailPoet\Config\PopulatorData\Templates;
class TravelNomads {
private $template_image_url;
private $social_icon_url;
function __construct($assets_url) {
$this->template_image_url = '//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'),
'description' => __("Ideal for sharing your travel adventures.", 'mailpoet'),
'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&nbsp;[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 &amp; 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?&nbsp;<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';
}
}

View File

@ -0,0 +1,785 @@
<?php
namespace MailPoet\Config\PopulatorData\Templates;
class WorldCup {
private $template_image_url;
private $social_icon_url;
function __construct($assets_url) {
$this->template_image_url = '//ps.w.org/mailpoet/assets/newsletter-templates/world_cup';
$this->social_icon_url = $assets_url . '/img/newsletter_editor/social-icons';
}
function get() {
return array(
'name' => __("World Cup", 'mailpoet'),
'description' => __("Always a winner. ", 'mailpoet'),
'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' => '#222222',
),
),
'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' => '20px',
),
),
),
array(
'type' => 'image',
'link' => '',
'src' => $this->template_image_url . '/Sports-Football-Header.png',
'alt' => 'Sports-Football-Header',
'fullWidth' => true,
'width' => '1280px',
'height' => '220px',
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
array(
'type' => 'image',
'link' => '',
'src' => $this->template_image_url . '/Sports-Football-Divider-1.png',
'alt' => 'Sports-Football-Divider-1',
'fullWidth' => true,
'width' => '1280px',
'height' => '50px',
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
),
),
),
),
array(
'type' => 'container',
'orientation' => 'horizontal',
'styles' => array(
'block' => array(
'backgroundColor' => '#da6110',
),
),
'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' => '20px',
),
),
),
array(
'type' => 'text',
'text' => '<p><strong><span style="color: #ffffff; font-size: 14px;">Issue #1</span></strong></p>',
),
),
),
array(
'type' => 'container',
'orientation' => 'vertical',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
),
),
'blocks' => array(
array(
'type' => 'text',
'text' => '<p style="text-align: right;"><a href="[link:newsletter_view_in_browser_url]" target="_blank" style="color: #ffffff; font-size: 14px; text-align: center;">View In Browser</a></p>
<p style="text-align: right;"><span style="color: #ffffff; text-align: start;">Monday 1st January 2017</span></p>',
),
),
),
),
),
array(
'type' => 'container',
'orientation' => 'horizontal',
'styles' => array(
'block' => array(
'backgroundColor' => '#ffffff',
),
),
'blocks' => array(
array(
'type' => 'container',
'orientation' => 'vertical',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
),
),
'blocks' => array(
array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => '#da6110',
'height' => '20px',
),
),
),
array(
'type' => 'image',
'link' => '',
'src' => $this->template_image_url . '/Sports-Football-Header-1.png',
'alt' => 'Sports-Football-Header',
'fullWidth' => true,
'width' => '1280px',
'height' => '580px',
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'height' => '30px',
),
),
),
array(
'type' => 'text',
'text' => '<h2 style="text-align: left;"><strong>Welcome Back!</strong></h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam consequat lorem at est congue, non consequat lacus iaculis. Integer euismod mauris velit, vel ultrices nibh bibendum quis. Donec eget fermentum magna.</p>
<p></p>
<p>Nullam congue dui lectus, quis pellentesque orci placerat eu. Fusce semper neque a mi aliquet vulputate sed sit amet nisi. Etiam sed nisl nec orci pretium lacinia eget in turpis. Maecenas in posuere justo. Vestibulum et sapien vestibulum, imperdiet neque in, maximus velit.</p>
<p></p>
<p>Proin dignissim elit magna, viverra scelerisque libero vehicula sed</p>',
),
array(
'type' => 'image',
'link' => '',
'src' => $this->template_image_url . '/Sports-Football-Divider-3.png',
'alt' => 'Sports-Football-Divider-3',
'fullWidth' => true,
'width' => '1280px',
'height' => '50px',
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => '#efefef',
'height' => '20px',
),
),
),
),
),
),
),
array(
'type' => 'container',
'orientation' => 'horizontal',
'styles' => array(
'block' => array(
'backgroundColor' => '#efefef',
),
),
'blocks' => array(
array(
'type' => 'container',
'orientation' => 'vertical',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
),
),
'blocks' => array(
array(
'type' => 'text',
'text' => '<h2 style="padding-bottom: 0;"><span style="font-weight: 600;">Latest News</span></h2>',
),
),
),
array(
'type' => 'container',
'orientation' => 'vertical',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
),
),
'blocks' => array(
array(
'type' => 'button',
'text' => 'View All News',
'url' => '',
'styles' => array(
'block' => array(
'backgroundColor' => '#d35400',
'borderColor' => '#d35400',
'borderWidth' => '1px',
'borderRadius' => '5px',
'borderStyle' => 'solid',
'width' => '110px',
'lineHeight' => '36px',
'fontColor' => '#ffffff',
'fontFamily' => 'Tahoma',
'fontSize' => '14px',
'fontWeight' => 'normal',
'textAlign' => 'right',
),
),
),
),
),
),
),
array(
'type' => 'container',
'orientation' => 'horizontal',
'styles' => array(
'block' => array(
'backgroundColor' => '#efefef',
),
),
'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' => '20px',
),
),
),
),
),
),
),
array(
'type' => 'container',
'orientation' => 'horizontal',
'styles' => array(
'block' => array(
'backgroundColor' => '#efefef',
),
),
'blocks' => array(
array(
'type' => 'container',
'orientation' => 'vertical',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
),
),
'blocks' => array(
array(
'type' => 'image',
'link' => 'http://mailpoet.info/brazils-history-making-hurricane/',
'src' => $this->template_image_url . '/2865897_full-lnd.jpg',
'alt' => 'Brazils history-making Hurricane',
'fullWidth' => false,
'width' => 652,
'height' => 366,
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
array(
'type' => 'text',
'text' => '<h3 style="text-align: left;" data-post-id="1938"><strong>Brazil&rsquo;s history-making Hurricane</strong></h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam consequat lorem at est congue, non consequat lacus iaculis. Integer euismod mauris velit, vel ultrices nibh bibendum quis. Donec eget fermentum magna. Nullam congue dui lectus, quis pellentesque orci placerat eu. Fusce semper neque a mi aliquet vulputate sed sit amet nisi...</p>
<p><a href="http://mailpoet.info/brazils-history-making-hurricane/">Read More</a></p>',
),
array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'height' => '20px',
),
),
),
),
),
),
),
array(
'type' => 'container',
'orientation' => 'horizontal',
'styles' => array(
'block' => array(
'backgroundColor' => '#efefef',
),
),
'blocks' => array(
array(
'type' => 'container',
'orientation' => 'vertical',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
),
),
'blocks' => array(
array(
'type' => 'image',
'link' => 'http://mailpoet.info/icelands-dentist-coach-defying-convention-and-expectations/',
'src' => $this->template_image_url . '/2866107_full-lnd.jpg',
'alt' => 'Icelands dentist-coach defying convention and expectations',
'fullWidth' => false,
'width' => 652,
'height' => 366,
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
array(
'type' => 'text',
'text' => '<h3><strong>Iceland&rsquo;s dentist-coach defying convention and expectations</strong></h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam consequat lorem at est congue, non consequat lacus iaculis. Integer euismod mauris velit...</p>
<p><a href="http://mailpoet.info/icelands-dentist-coach-defying-convention-and-expectations/">Read More</a></p>',
),
),
),
array(
'type' => 'container',
'orientation' => 'vertical',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
),
),
'blocks' => array(
array(
'type' => 'image',
'link' => 'http://mailpoet.info/impact-and-legacy-of-2018-fifa-world-cup-russia-facts-and-figures/',
'src' => $this->template_image_url . '/2709222_full-lnd.jpg',
'alt' => 'Impact and legacy of 2018 FIFA World Cup Russia: facts and figures',
'fullWidth' => false,
'width' => 652,
'height' => 366,
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
array(
'type' => 'text',
'text' => '<h3 style="text-align: left;" data-post-id="1932"><strong>Impact and legacy of 2018 FIFA World Cup Russia: facts and figures</strong></h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam consequat lorem at est congue, non consequat lacus iaculis. Integer euismod...</p>
<p><a href="http://mailpoet.info/impact-and-legacy-of-2018-fifa-world-cup-russia-facts-and-figures/">Read More</a></p>',
),
),
),
array(
'type' => 'container',
'orientation' => 'vertical',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
),
),
'blocks' => array(
array(
'type' => 'image',
'link' => 'http://mailpoet.info/linekers-life-changing-treble/',
'src' => $this->template_image_url . '/2867790_full-lnd.jpg',
'alt' => 'Linekers life-changing treble',
'fullWidth' => false,
'width' => 652,
'height' => 366,
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
array(
'type' => 'text',
'text' => '<h3 style="text-align: left;" data-post-id="1929"><strong>Lineker&rsquo;s life-changing treble</strong></h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam consequat lorem at est congue, non consequat lacus iaculis. Integer euismod mauris velit&nbsp;<span style="background-color: inherit;">consequat lorem at est congue...</span></p>
<p><a href="http://mailpoet.info/linekers-life-changing-treble/">Read More</a></p>',
),
),
),
),
),
array(
'type' => 'container',
'orientation' => 'horizontal',
'styles' => array(
'block' => array(
'backgroundColor' => '#f8f8f8',
),
),
'blocks' => array(
array(
'type' => 'container',
'orientation' => 'vertical',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
),
),
'blocks' => array(
array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => '#efefef',
'height' => '20px',
),
),
),
array(
'type' => 'image',
'link' => '',
'src' => $this->template_image_url . '/Sports-Football-Divider-2.png',
'alt' => 'Sports-Football-Divider-2',
'fullWidth' => true,
'width' => '1280px',
'height' => '50px',
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
),
),
),
),
array(
'type' => 'container',
'orientation' => 'horizontal',
'styles' => array(
'block' => array(
'backgroundColor' => '#222222',
),
),
'blocks' => array(
array(
'type' => 'container',
'orientation' => 'vertical',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
),
),
'blocks' => array(
array(
'type' => 'image',
'link' => '',
'src' => $this->template_image_url . '/Sports-Football-Footer-1.png',
'alt' => 'Sports-Football-Footer',
'fullWidth' => true,
'width' => '1280px',
'height' => '500px',
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => '#da6110',
'height' => '20px',
),
),
),
),
),
),
),
array(
'type' => 'container',
'orientation' => 'horizontal',
'styles' => array(
'block' => array(
'backgroundColor' => '#da6110',
),
),
'blocks' => array(
array(
'type' => 'container',
'orientation' => 'vertical',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
),
),
'blocks' => array(
array(
'type' => 'social',
'iconSet' => 'full-symbol-grey',
'icons' => array(
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',
),
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',
),
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',
),
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',
),
),
),
),
),
),
),
array(
'type' => 'container',
'orientation' => 'horizontal',
'styles' => array(
'block' => array(
'backgroundColor' => '#b55311',
),
),
'blocks' => array(
array(
'type' => 'container',
'orientation' => 'vertical',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
),
),
'blocks' => array(
array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => '#da6110',
'height' => '20px',
),
),
),
array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'height' => '20px',
),
),
),
array(
'type' => 'image',
'link' => '',
'src' => $this->template_image_url . '/Sports-Football-Logo-Small.png',
'alt' => 'Sports-Football-Logo-Small',
'fullWidth' => false,
'width' => '772px',
'height' => '171px',
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'height' => '20px',
),
),
),
),
),
array(
'type' => 'container',
'orientation' => 'vertical',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
),
),
'blocks' => array(
array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => '#da6110',
'height' => '20px',
),
),
),
array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'height' => '20px',
),
),
),
array(
'type' => 'footer',
'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' => '#ffffff',
'fontFamily' => 'Tahoma',
'fontSize' => '12px',
'textAlign' => 'right',
),
'link' => array(
'fontColor' => '#ffffff',
'textDecoration' => 'underline',
),
),
),
),
),
),
),
),
),
'globalStyles' => array(
'text' => array(
'fontColor' => '#000000',
'fontFamily' => 'Tahoma',
'fontSize' => '14px',
),
'h1' => array(
'fontColor' => '#111111',
'fontFamily' => 'Tahoma',
'fontSize' => '30px',
),
'h2' => array(
'fontColor' => '#da6110',
'fontFamily' => 'Tahoma',
'fontSize' => '24px',
),
'h3' => array(
'fontColor' => '#333333',
'fontFamily' => 'Tahoma',
'fontSize' => '18px',
),
'link' => array(
'fontColor' => '#da6110',
'textDecoration' => 'underline',
),
'wrapper' => array(
'backgroundColor' => '#ffffff',
),
'body' => array(
'backgroundColor' => '#222222',
),
),
);
}
private function getThumbnail() {
return $this->template_image_url . '/world-cup.jpg';
}
}

View File

@ -0,0 +1,793 @@
<?php
namespace MailPoet\Config\PopulatorData\Templates;
class YogaStudio {
private $template_image_url;
private $social_icon_url;
function __construct($assets_url) {
$this->template_image_url = '//ps.w.org/mailpoet/assets/newsletter-templates/yoga_studio';
$this->social_icon_url = $assets_url . '/img/newsletter_editor/social-icons';
}
function get() {
return array(
'name' => __("Yoga Studio", 'mailpoet'),
'description' => __("Salute the sun and your subscribers.", 'mailpoet'),
'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' => '#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' => '#1e2937',
'height' => '20px',
),
),
),
),
),
),
),
1 => 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' => 'image',
'link' => '',
'src' => $this->template_image_url . '/yoga-1.png',
'alt' => 'yoga-1',
'fullWidth' => true,
'width' => '1280px',
'height' => '740px',
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
1 => array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'height' => '30px',
),
),
),
2 => array(
'type' => 'text',
'text' => '<h2 style="text-align: center;"><strong>Here\'s your classes for this week:</strong></h2>',
),
3 => 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' => 'text',
'text' => '<h3><strong><span style="color: #83bd31;"><em>Weekdays</em></span></strong></h3>
<p><strong>Monday</strong>: 7am, 9am, 11am, 3pm and 5pm.</p>
<p><strong>Tuesday</strong>: 7am, 9am, 11am, 3pm and 5pm.</p>
<p><strong>Wednesday</strong>: 7am, 9am, 11am, 3pm and 5pm.</p>
<p><strong>Thursday</strong>:&nbsp;CLOSED FOR PRIVATE CLASS.</p>
<p><strong>Friday</strong>: 7am, 9am, 11am,&nbsp;and 3pm.</p>',
),
),
),
1 => array(
'type' => 'container',
'orientation' => 'vertical',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
),
),
'blocks' => array(
0 => array(
'type' => 'text',
'text' => '<h3><strong><span style="color: #83bd31;"><em>Weekend</em></span></strong></h3>
<p><strong>Saturday</strong>: 7am, 9am, 11am, 3pm and 5pm.</p>
<p><strong>Sunday</strong>: 7am, 9am, 11am, 3pm and 5pm.</p>
<p></p>',
),
),
),
),
),
3 => 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' => 'divider',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'padding' => '22px',
'borderStyle' => 'solid',
'borderWidth' => '1px',
'borderColor' => '#d5d5d5',
),
),
),
2 => array(
'type' => 'text',
'text' => '<h3 style="text-align: center;"><span style="font-weight: 600;">Meet the instructors</span></h3>',
),
),
),
),
),
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' => '20px',
),
),
),
1 => array(
'type' => 'image',
'link' => '',
'src' => $this->template_image_url . '/yoga-person-1.png',
'alt' => 'yoga-person-1',
'fullWidth' => false,
'width' => '400px',
'height' => '400px',
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
2 => array(
'type' => 'text',
'text' => '<h3 style="text-align: center;"><span style="color: #83bd31;"><span style="font-weight: 600;">Maria Smith</span></span></h3>
<p style="text-align: center;">Nullam hendrerit feugiat feugiat. Praesent mollis ante lacus, quis tempor leo sagittis vel. Donec sagittis eros at felis venenatis ultricies.</p>',
),
3 => array(
'type' => 'button',
'text' => 'Find Out More',
'url' => '',
'styles' => array(
'block' => array(
'backgroundColor' => '#83bd31',
'borderColor' => '#83bd31',
'borderWidth' => '1px',
'borderRadius' => '40px',
'borderStyle' => 'solid',
'width' => '180px',
'lineHeight' => '30px',
'fontColor' => '#ffffff',
'fontFamily' => 'Arial',
'fontSize' => '14px',
'fontWeight' => 'normal',
'textAlign' => 'center',
),
),
),
4 => array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'height' => '30px',
),
),
),
),
),
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 . '/yoga-person-2.png',
'alt' => 'yoga-person-2',
'fullWidth' => false,
'width' => '400px',
'height' => '400px',
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
2 => array(
'type' => 'text',
'text' => '<h3 style="text-align: center;"><span style="color: #83bd31;"><span style="font-weight: 600;">Fiona&nbsp;Davies</span></span></h3>
<p style="text-align: center;">Nullam hendrerit feugiat feugiat. Praesent mollis ante lacus, quis tempor leo sagittis vel. Donec sagittis eros at felis venenatis ultricies.</p>',
),
3 => array(
'type' => 'button',
'text' => 'Find Out More',
'url' => '',
'styles' => array(
'block' => array(
'backgroundColor' => '#83bd31',
'borderColor' => '#83bd31',
'borderWidth' => '1px',
'borderRadius' => '40px',
'borderStyle' => 'solid',
'width' => '180px',
'lineHeight' => '30px',
'fontColor' => '#ffffff',
'fontFamily' => 'Arial',
'fontSize' => '14px',
'fontWeight' => 'normal',
'textAlign' => 'center',
),
),
),
4 => array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'height' => '30px',
),
),
),
),
),
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 . '/yoga-person-3.png',
'alt' => 'yoga-person-3',
'fullWidth' => false,
'width' => '400px',
'height' => '400px',
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
2 => array(
'type' => 'text',
'text' => '<h3 style="text-align: center;"><span style="color: #83bd31;"><span style="font-weight: 600;">Matthew&nbsp;Johnson</span></span></h3>
<p style="text-align: center;">Nullam hendrerit feugiat feugiat. Praesent mollis ante lacus, quis tempor leo sagittis vel. Donec sagittis eros at felis venenatis ultricies.</p>',
),
3 => array(
'type' => 'button',
'text' => 'Find Out More',
'url' => '',
'styles' => array(
'block' => array(
'backgroundColor' => '#83bd31',
'borderColor' => '#83bd31',
'borderWidth' => '1px',
'borderRadius' => '40px',
'borderStyle' => 'solid',
'width' => '180px',
'lineHeight' => '31px',
'fontColor' => '#ffffff',
'fontFamily' => 'Arial',
'fontSize' => '14px',
'fontWeight' => 'normal',
'textAlign' => 'center',
),
),
),
4 => array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'height' => '30px',
),
),
),
),
),
),
),
5 => array(
'type' => 'container',
'orientation' => 'horizontal',
'styles' => array(
'block' => array(
'backgroundColor' => '#83bd31',
),
),
'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' => '<p><strong>Pose of the week:</strong></p>
<h2>Virabhadrasana I</h2>
<p>The myth is that the powerful priest Daksha made a great yagna (ritual sacrifice) but did not invite his youngest daughter Sati and her husband Shiva, the supreme ruler of the universe. Sati found out and decided to go alone to the yagna.</p>
<p></p>
<p>When she arrived, Sati entered into an argument with her father. Unable to withstand his insults, she spoke a vow to her father, &ldquo;Since it was you who gave me this body, I no longer wish to be associated with it.&rdquo;</p>',
),
2 => 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' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'height' => '40px',
),
),
),
1 => array(
'type' => 'image',
'link' => '',
'src' => $this->template_image_url . '/yoga-pose.png',
'alt' => 'yoga-pose',
'fullWidth' => false,
'width' => '400px',
'height' => '400px',
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
2 => array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'height' => '35px',
),
),
),
),
),
),
),
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' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
'height' => '40px',
),
),
),
1 => array(
'type' => 'text',
'text' => '<h3 style="text-align: center;"><span style="font-weight: 600;">Quote of the week</span></h3>',
),
2 => array(
'type' => 'text',
'text' => '<h2 style="text-align: center;"><em>Be a lamp to yourself. Be your own confidence. Hold on to the truth within yourself as to the only truth.</em></h2>
<p style="text-align: center;"><span style="font-family: Arial, sans-serif; font-size: 14px; text-align: center; color: #999999;">Buddha</span><em></em></p>',
),
3 => array(
'type' => 'spacer',
'styles' => array(
'block' => array(
'backgroundColor' => '#ffffff',
'height' => '20px',
),
),
),
4 => array(
'type' => 'divider',
'styles' => array(
'block' => array(
'backgroundColor' => '#d5d5d5',
'padding' => '15px',
'borderStyle' => 'solid',
'borderWidth' => '1px',
'borderColor' => '#b3b3b3',
),
),
),
),
),
),
),
7 => array(
'type' => 'container',
'orientation' => 'horizontal',
'styles' => array(
'block' => array(
'backgroundColor' => '#d5d5d5',
),
),
'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 . '/yoga-logo-small.png',
'alt' => 'yoga-logo-small',
'fullWidth' => false,
'width' => '50px',
'height' => '50px',
'styles' => array(
'block' => array(
'textAlign' => 'center',
),
),
),
1 => 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',
'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',
'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',
'height' => '32px',
'width' => '32px',
'text' => 'Instagram',
),
3 => array(
'type' => 'socialIcon',
'iconType' => 'youtube',
'link' => 'http://www.youtube.com',
'image' => $this->social_icon_url . '/07-full-symbol-black/Youtube.png',
'height' => '32px',
'width' => '32px',
'text' => 'Youtube',
),
),
),
),
),
1 => array(
'type' => 'container',
'orientation' => 'vertical',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
),
),
'blocks' => array(
0 => array(
'type' => 'text',
'text' => '<p style="font-size: 13px; text-align: center;"><strong>Yoga Studio</strong></p>
<p style="font-size: 11px; text-align: center;">Address Line 1</p>
<p style="font-size: 11px; text-align: center;">Address Line 2</p>
<p style="font-size: 11px; text-align: center;">City/Town</p>
<p style="font-size: 11px; text-align: center;">Country</p>',
),
),
),
2 => array(
'type' => 'container',
'orientation' => 'vertical',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
),
),
'blocks' => array(
0 => array(
'type' => 'footer',
'text' => '<p><a href="[link:subscription_unsubscribe_url]">Unsubscribe</a></p><p><a href="[link:subscription_manage_url]">Manage subscription</a></p>',
'styles' => array(
'block' => array(
'backgroundColor' => 'transparent',
),
'text' => array(
'fontColor' => '#222222',
'fontFamily' => 'Arial',
'fontSize' => '11px',
'textAlign' => 'center',
),
'link' => array(
'fontColor' => '#000000',
'textDecoration' => 'underline',
),
),
),
),
),
),
),
8 => 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' => '#d5d5d5',
'padding' => '13px',
'borderStyle' => 'solid',
'borderWidth' => '1px',
'borderColor' => '#aaaaaa',
),
),
),
),
),
),
),
),
),
'globalStyles' => array(
'text' => array(
'fontColor' => '#1e2937',
'fontFamily' => 'Arial',
'fontSize' => '13px',
),
'h1' => array(
'fontColor' => '#1e2937',
'fontFamily' => 'Arial',
'fontSize' => '30px',
),
'h2' => array(
'fontColor' => '#1e2937',
'fontFamily' => 'Arial',
'fontSize' => '24px',
),
'h3' => array(
'fontColor' => '#1e2937',
'fontFamily' => 'Arial',
'fontSize' => '20px',
),
'link' => array(
'fontColor' => '#83bd31',
'textDecoration' => 'underline',
),
'wrapper' => array(
'backgroundColor' => '#ffffff',
),
'body' => array(
'backgroundColor' => '#1e2937',
),
),
);
}
private function getThumbnail() {
return $this->template_image_url . '/yoga-studio.jpg';
}
}

View File

@ -112,6 +112,13 @@ class Widget {
'ajax_url' => admin_url('admin-ajax.php'),
'is_rtl' => (function_exists('is_rtl') ? (bool)is_rtl() : false)
));
$ajaxFailedErrorMessage = __('An error has happened while performing a request, please try again later.');
wp_add_inline_script(
'mailpoet_public',
sprintf('MailPoet.I18n.add("ajaxFailedErrorMessage", "%s")', $ajaxFailedErrorMessage),
'after'
);
}
function setupAdminWidgetPageDependencies() {

View File

@ -169,4 +169,15 @@ class Model extends \Sudzy\ValidModel {
static function getTrashed() {
return static::whereNotNull('deleted_at');
}
/**
* Rethrow PDOExceptions to prevent exposing sensitive data in stack traces
*/
public static function __callStatic($method, $parameters) {
try {
return parent::__callStatic($method, $parameters);
} catch (\PDOException $e) {
throw new \Exception($e->getMessage());
}
}
}

View File

@ -39,11 +39,15 @@ class AutomatedLatestContent {
'orderby' => 'date',
'order' => ($args['sortBy'] === 'newest') ? 'DESC' : 'ASC',
);
if(!empty($args['offset']) && (int)$args['offset'] > 0) {
$parameters['offset'] = (int)$args['offset'];
}
if(isset($args['search'])) {
$parameters['s'] = $args['search'];
}
if(isset($args['posts']) && is_array($args['posts'])) {
$parameters['post__in'] = $args['posts'];
$parameters['posts_per_page'] = -1; // Get all posts with matching IDs
}
if(!empty($posts_to_exclude)) {
$parameters['post__not_in'] = $posts_to_exclude;

View File

@ -160,10 +160,11 @@ class Scheduler {
return $relation->value;
}
static function getNextRunDate($schedule) {
static function getNextRunDate($schedule, $from_timestamp = false) {
$from_timestamp = ($from_timestamp) ? $from_timestamp : current_time('timestamp');
try {
$schedule = \Cron\CronExpression::factory($schedule);
$next_run_date = $schedule->getNextRunDate(Carbon::createFromTimestamp(current_time('timestamp')))
$next_run_date = $schedule->getNextRunDate(Carbon::createFromTimestamp($from_timestamp))
->format('Y-m-d H:i:s');
} catch(\Exception $e) {
$next_run_date = false;

View File

@ -1,27 +1,29 @@
<?php
namespace MailPoet\Subscription;
use MailPoet\API\JSON\API;
use MailPoet\API\JSON\Response as APIResponse;
use MailPoet\Util\Url;
use MailPoet\Util\Url as UrlHelper;
class Form {
static function onSubmit() {
static function onSubmit($request_data = false) {
$request_data = ($request_data) ? $request_data : $_REQUEST;
$api = new API();
$api->setRequestData($_REQUEST);
$form_id = (!empty($_REQUEST['data']['form_id'])) ? (int)$_REQUEST['data']['form_id'] : false;
$api->setRequestData($request_data);
$form_id = (!empty($request_data['data']['form_id'])) ? (int)$request_data['data']['form_id'] : false;
$response = $api->processRoute();
if($response->status !== APIResponse::STATUS_OK) {
Url::redirectBack(
return UrlHelper::redirectBack(
array(
'mailpoet_error' => ($form_id) ? $form_id : true,
'mailpoet_success' => null
)
);
} else {
(isset($response->meta['redirect_url'])) ?
Url::redirectTo($response->meta['redirect_url']) :
Url::redirectBack(
return (isset($response->meta['redirect_url'])) ?
UrlHelper::redirectTo($response->meta['redirect_url']) :
UrlHelper::redirectBack(
array(
'mailpoet_success' => $form_id,
'mailpoet_error' => null

View File

@ -1,4 +1,5 @@
<?php
namespace MailPoet\Twig;
if(!defined('ABSPATH')) exit;
@ -15,6 +16,34 @@ class Filters extends \Twig_Extension {
'intval',
'intval'
),
new \Twig_SimpleFilter(
'replaceLink',
array(
$this,
'replaceLink'
)
)
);
}
function replaceLink($source, $link = false, $attributes = array()) {
if(!$link) return $source;
$attributes = array_map(function($key) use ($attributes) {
if(is_bool($attributes[$key])) {
return $attributes[$key] ? $key : '';
}
return sprintf('%s="%s"', $key, $attributes[$key]);
}, array_keys($attributes));
$source = str_replace(
'[link]',
sprintf(
'<a %s href="%s">',
join(' ', $attributes),
$link
),
$source
);
$source = str_replace('[/link]', '</a>', $source);
return preg_replace('/\s+/', ' ', $source);
}
}

View File

@ -4,7 +4,7 @@ if(!defined('ABSPATH')) exit;
/*
* Plugin Name: MailPoet
* Version: 3.0.0-beta.36.0.1
* Version: 3.0.0-beta.36.2.0
* Plugin URI: http://www.mailpoet.com
* Description: Create and send beautiful email newsletters, autoresponders, and post notifications without leaving WordPress. This is a beta version of our brand new plugin!
* Author: MailPoet
@ -21,7 +21,7 @@ if(!defined('ABSPATH')) exit;
*/
$mailpoet_plugin = array(
'version' => '3.0.0-beta.36.0.1',
'version' => '3.0.0-beta.36.2.0',
'filename' => __FILE__,
'path' => dirname(__FILE__),
'autoloader' => dirname(__FILE__) . '/vendor/autoload.php',

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Some files were not shown because too many files have changed in this diff Show More