From 334b119bb344daab402e38dabc6434b012b1f66e Mon Sep 17 00:00:00 2001 From: Pavel Dohnal Date: Tue, 27 Jun 2017 16:12:12 +0100 Subject: [PATCH] Add News Day template [MAILPOET-922] --- lib/Config/Populator.php | 1 + .../PopulatorData/Templates/NewsDay.php | 554 ++++++++++++++++++ 2 files changed, 555 insertions(+) create mode 100644 lib/Config/PopulatorData/Templates/NewsDay.php diff --git a/lib/Config/Populator.php b/lib/Config/Populator.php index 4865e0aa35..e035c4f1cf 100644 --- a/lib/Config/Populator.php +++ b/lib/Config/Populator.php @@ -49,6 +49,7 @@ class Populator { "Faith", "TravelNomads", "CoffeeShop", + "NewsDay", ); } diff --git a/lib/Config/PopulatorData/Templates/NewsDay.php b/lib/Config/PopulatorData/Templates/NewsDay.php new file mode 100644 index 0000000000..23949f6a02 --- /dev/null +++ b/lib/Config/PopulatorData/Templates/NewsDay.php @@ -0,0 +1,554 @@ +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' => '

Top Story

', + ), + 1 => array( + 'type' => 'text', + 'text' => '

Plasma jet engines that could take you from the ground to space

', + ), + 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' => '

FORGET fuel-powered jet engines. We’re on the verge of having aircraft that can fly from the ground up to the edge of space using air and electricity alone. 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. …

Read More

', + ), + 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' => '

Popular Posts Today

', + ), + 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' => '

Cutting through the smog: What to do to fight air pollution

+

Tackling our air problems starts with traffic control, but individual action to reduce energy use and intensive farming would also help clean our air.

+

Read More

', + ), + 1 => array( + 'type' => 'divider', + 'styles' => array( + 'block' => array( + 'backgroundColor' => 'transparent', + 'padding' => '13px', + 'borderStyle' => 'solid', + 'borderWidth' => '1px', + 'borderColor' => '#aaaaaa', + ), + ), + ), + 2 => array( + 'type' => 'text', + 'text' => '

Ladybird’s transparent shell reveals how it moves

+

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.

+

Read More

', + ), + 3 => array( + 'type' => 'divider', + 'styles' => array( + 'block' => array( + 'backgroundColor' => 'transparent', + 'padding' => '13px', + 'borderStyle' => 'solid', + 'borderWidth' => '1px', + 'borderColor' => '#aaaaaa', + ), + ), + ), + 4 => array( + 'type' => 'text', + 'text' => '

Brazil’s history-making Hurricane

+

Jairzinho has just made history. In claiming the fourth goal of an unforgettable 1970 FIFA World Cup Mexico™ Final against Italy, he has maintained his record of scoring in every one of Brazil’s matches en route to the Trophy.

+

Read More

', + ), + ), + ), + 1 => array( + 'type' => 'container', + 'orientation' => 'vertical', + 'styles' => array( + 'block' => array( + 'backgroundColor' => 'transparent', + ), + ), + 'blocks' => array( + 0 => array( + 'type' => 'text', + 'text' => '

Iceland’s dentist-coach defying convention and expectations

+

As Iceland’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...

+

Read More

', + ), + 1 => array( + 'type' => 'divider', + 'styles' => array( + 'block' => array( + 'backgroundColor' => 'transparent', + 'padding' => '13px', + 'borderStyle' => 'solid', + 'borderWidth' => '1px', + 'borderColor' => '#aaaaaa', + ), + ), + ), + 2 => array( + 'type' => 'text', + 'text' => '

Impact and legacy of 2018 FIFA World Cup Russia

+

Organising a FIFA World Cup™ in a sustainable manner is a major challenge. The scale of the event inevitably has an impact on the Host Country. 

+

Read More

', + ), + 3 => array( + 'type' => 'divider', + 'styles' => array( + 'block' => array( + 'backgroundColor' => 'transparent', + 'padding' => '13px', + 'borderStyle' => 'solid', + 'borderWidth' => '1px', + 'borderColor' => '#aaaaaa', + ), + ), + ), + 4 => array( + 'type' => 'text', + 'text' => '

Lineker’s life-changing treble

+

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™ highlight. Yet the man who scored ten times...

+

Read More

', + ), + ), + ), + ), + ), + 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' => '

NewsDay

+

Unsubscribe | Manage subscription

+

', + '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() { + } + +} \ No newline at end of file