diff --git a/assets/js/src/newsletters/templates.jsx b/assets/js/src/newsletters/templates.jsx index 082e0f3a42..7b7ba69f5c 100644 --- a/assets/js/src/newsletters/templates.jsx +++ b/assets/js/src/newsletters/templates.jsx @@ -24,27 +24,31 @@ const templatesCategories = [ name: 'notification', label: MailPoet.I18n.t('tabNotificationTitle'), }, - { +]; + +if (window.mailpoet_woocommerce_active) { + templatesCategories.push({ name: 'woocommerce', label: MailPoet.I18n.t('tabWoocommerceTitle'), - }, - { - name: 'sample', - label: MailPoet.I18n.t('sample'), - }, - { - name: 'blank', - label: MailPoet.I18n.t('blank'), - }, - { - name: 'recent', - label: MailPoet.I18n.t('recentlySent'), - }, - { - name: 'saved', - label: MailPoet.I18n.t('savedTemplates'), - }, -]; + }); +} + +templatesCategories.push( + ...[ + { + name: 'all', + label: MailPoet.I18n.t('allTemplates'), + }, + { + name: 'recent', + label: MailPoet.I18n.t('recentlySent'), + }, + { + name: 'saved', + label: MailPoet.I18n.t('savedTemplates'), + }, + ] +); class NewsletterTemplates extends React.Component { constructor(props) { diff --git a/lib/Config/Menu.php b/lib/Config/Menu.php index 0c7bd45492..d139d34ff6 100644 --- a/lib/Config/Menu.php +++ b/lib/Config/Menu.php @@ -580,6 +580,7 @@ class Menu { $data['tracking_enabled'] = Setting::getValue('tracking.enabled'); $data['premium_plugin_active'] = License::getLicense(); + $data['is_woocommerce_active'] = class_exists('WooCommerce'); $data['automatic_emails'] = array( array( diff --git a/lib/Config/Populator.php b/lib/Config/Populator.php index 7dd7fd4869..992ef87b68 100644 --- a/lib/Config/Populator.php +++ b/lib/Config/Populator.php @@ -4,6 +4,7 @@ namespace MailPoet\Config; use MailPoet\Cron\CronTrigger; use MailPoet\Mailer\MailerLog; use MailPoet\Models\Newsletter; +use MailPoet\Models\NewsletterTemplate; use MailPoet\Models\Segment; use MailPoet\Models\SendingQueue; use MailPoet\Models\StatisticsForms; @@ -89,6 +90,7 @@ class Populator { $this->createDefaultSettings(); $this->createMailPoetPage(); $this->createSourceForSubscribers(); + $this->updateNewsletterCategories(); } private function createMailPoetPage() { @@ -381,4 +383,18 @@ class Populator { ' AND `wp_user_id` IS NOT NULL' ); } + + private function updateNewsletterCategories() { + global $wpdb; + // perform once for versions below or equal to 3.14.0 + if(version_compare(Setting::getValue('db_version', '3.14.1'), '3.14.0', '>')) { + return false; + } + $query = "UPDATE `%s` SET categories = REPLACE(REPLACE(categories, ',\"blank\"', ''), ',\"sample\"', ',\"all\"')"; + $wpdb->query(sprintf( + $query, + NewsletterTemplate::$_table + )); + return true; + } } diff --git a/lib/Config/PopulatorData/Templates/AppWelcome.php b/lib/Config/PopulatorData/Templates/AppWelcome.php index d0ca95c8ea..80ffb382a3 100644 --- a/lib/Config/PopulatorData/Templates/AppWelcome.php +++ b/lib/Config/PopulatorData/Templates/AppWelcome.php @@ -15,7 +15,7 @@ class AppWelcome { function get() { return array( 'name' => __("App Welcome", 'mailpoet'), - 'categories' => json_encode(array('welcome', 'sample')), + 'categories' => json_encode(array('welcome', 'all')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), 'body' => json_encode($this->getBody()), diff --git a/lib/Config/PopulatorData/Templates/Avocado.php b/lib/Config/PopulatorData/Templates/Avocado.php index d3ab225a52..f0f5a9aa02 100644 --- a/lib/Config/PopulatorData/Templates/Avocado.php +++ b/lib/Config/PopulatorData/Templates/Avocado.php @@ -15,7 +15,7 @@ class Avocado { function get() { return array( 'name' => __("Avocado", 'mailpoet'), - 'categories' => json_encode(array('woocommerce', 'sample')), + 'categories' => json_encode(array('woocommerce', 'all')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), 'body' => json_encode($this->getBody()), diff --git a/lib/Config/PopulatorData/Templates/Charity.php b/lib/Config/PopulatorData/Templates/Charity.php index cbb9488c0e..a5a244f960 100644 --- a/lib/Config/PopulatorData/Templates/Charity.php +++ b/lib/Config/PopulatorData/Templates/Charity.php @@ -15,7 +15,7 @@ class Charity { function get() { return array( 'name' => __("Charity", 'mailpoet'), - 'categories' => json_encode(array('standard', 'sample')), + 'categories' => json_encode(array('standard', 'all')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), 'body' => json_encode($this->getBody()), diff --git a/lib/Config/PopulatorData/Templates/Coffee.php b/lib/Config/PopulatorData/Templates/Coffee.php index 5b3d3f3084..33dd486c7f 100644 --- a/lib/Config/PopulatorData/Templates/Coffee.php +++ b/lib/Config/PopulatorData/Templates/Coffee.php @@ -15,7 +15,7 @@ class Coffee { function get() { return array( 'name' => __("Coffee", 'mailpoet'), - 'categories' => json_encode(array('standard', 'sample')), + 'categories' => json_encode(array('standard', 'all')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), 'body' => json_encode($this->getBody()), diff --git a/lib/Config/PopulatorData/Templates/DogFood.php b/lib/Config/PopulatorData/Templates/DogFood.php index b633e300c3..6a99750ac3 100644 --- a/lib/Config/PopulatorData/Templates/DogFood.php +++ b/lib/Config/PopulatorData/Templates/DogFood.php @@ -15,7 +15,7 @@ class DogFood { function get() { return array( 'name' => __("Dog Food", 'mailpoet'), - 'categories' => json_encode(array('woocommerce', 'sample')), + 'categories' => json_encode(array('woocommerce', 'all')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), 'body' => json_encode($this->getBody()), diff --git a/lib/Config/PopulatorData/Templates/Drone.php b/lib/Config/PopulatorData/Templates/Drone.php index 03f3840fbb..80e6e5564d 100644 --- a/lib/Config/PopulatorData/Templates/Drone.php +++ b/lib/Config/PopulatorData/Templates/Drone.php @@ -15,7 +15,7 @@ class Drone { function get() { return array( 'name' => __("Drone", 'mailpoet'), - 'categories' => json_encode(array('standard', 'sample')), + 'categories' => json_encode(array('standard', 'all')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), 'body' => json_encode($this->getBody()), diff --git a/lib/Config/PopulatorData/Templates/Faith.php b/lib/Config/PopulatorData/Templates/Faith.php index 0c06d3ac9e..024602956a 100644 --- a/lib/Config/PopulatorData/Templates/Faith.php +++ b/lib/Config/PopulatorData/Templates/Faith.php @@ -15,7 +15,7 @@ class Faith { function get() { return array( 'name' => __("Faith", 'mailpoet'), - 'categories' => json_encode(array('standard', 'sample')), + 'categories' => json_encode(array('standard', 'all')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), 'body' => json_encode($this->getBody()), diff --git a/lib/Config/PopulatorData/Templates/FashionStore.php b/lib/Config/PopulatorData/Templates/FashionStore.php index 251a7d43b4..89fda8632e 100644 --- a/lib/Config/PopulatorData/Templates/FashionStore.php +++ b/lib/Config/PopulatorData/Templates/FashionStore.php @@ -15,7 +15,7 @@ class FashionStore { function get() { return array( 'name' => __("Fashion Store", 'mailpoet'), - 'categories' => json_encode(array('standard', 'sample')), + 'categories' => json_encode(array('standard', 'all')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), 'body' => json_encode($this->getBody()), diff --git a/lib/Config/PopulatorData/Templates/FestivalEvent.php b/lib/Config/PopulatorData/Templates/FestivalEvent.php index e5a15d3db5..fc9ef57ead 100644 --- a/lib/Config/PopulatorData/Templates/FestivalEvent.php +++ b/lib/Config/PopulatorData/Templates/FestivalEvent.php @@ -15,7 +15,7 @@ class FestivalEvent { function get() { return array( 'name' => __("Festival Event", 'mailpoet'), - 'categories' => json_encode(array('standard', 'sample')), + 'categories' => json_encode(array('standard', 'all')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), 'body' => json_encode($this->getBody()), diff --git a/lib/Config/PopulatorData/Templates/Fitness.php b/lib/Config/PopulatorData/Templates/Fitness.php index e6b7e4a8dd..1014338539 100644 --- a/lib/Config/PopulatorData/Templates/Fitness.php +++ b/lib/Config/PopulatorData/Templates/Fitness.php @@ -15,7 +15,7 @@ class Fitness { function get() { return array( 'name' => __("Fitness", 'mailpoet'), - 'categories' => json_encode(array('woocommerce', 'sample')), + 'categories' => json_encode(array('woocommerce', 'all')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), 'body' => json_encode($this->getBody()), diff --git a/lib/Config/PopulatorData/Templates/FoodBox.php b/lib/Config/PopulatorData/Templates/FoodBox.php index 9f62da69e4..75e3387d7a 100644 --- a/lib/Config/PopulatorData/Templates/FoodBox.php +++ b/lib/Config/PopulatorData/Templates/FoodBox.php @@ -16,7 +16,7 @@ class FoodBox { function get() { return array( 'name' => __("Welcome to FoodBox", 'mailpoet'), - 'categories' => json_encode(array('standard', 'sample')), + 'categories' => json_encode(array('standard', 'all')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), 'body' => json_encode($this->getBody()), diff --git a/lib/Config/PopulatorData/Templates/GiftWelcome.php b/lib/Config/PopulatorData/Templates/GiftWelcome.php index 7dc6290b42..b159385c6c 100644 --- a/lib/Config/PopulatorData/Templates/GiftWelcome.php +++ b/lib/Config/PopulatorData/Templates/GiftWelcome.php @@ -15,7 +15,7 @@ class GiftWelcome { function get() { return array( 'name' => __("Gift Welcome", 'mailpoet'), - 'categories' => json_encode(array('welcome', 'sample')), + 'categories' => json_encode(array('welcome', 'all')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), 'body' => json_encode($this->getBody()), diff --git a/lib/Config/PopulatorData/Templates/Hotels.php b/lib/Config/PopulatorData/Templates/Hotels.php index 7c3cd41bce..d6ac00f397 100644 --- a/lib/Config/PopulatorData/Templates/Hotels.php +++ b/lib/Config/PopulatorData/Templates/Hotels.php @@ -15,7 +15,7 @@ class Hotels { function get() { return array( 'name' => __("Hotels", 'mailpoet'), - 'categories' => json_encode(array('standard', 'sample')), + 'categories' => json_encode(array('standard', 'all')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), 'body' => json_encode($this->getBody()), diff --git a/lib/Config/PopulatorData/Templates/KidsClothing.php b/lib/Config/PopulatorData/Templates/KidsClothing.php index 10c35ef14f..f6a38d9eab 100644 --- a/lib/Config/PopulatorData/Templates/KidsClothing.php +++ b/lib/Config/PopulatorData/Templates/KidsClothing.php @@ -15,7 +15,7 @@ class KidsClothing { function get() { return array( 'name' => __("Kids Clothing", 'mailpoet'), - 'categories' => json_encode(array('woocommerce', 'sample')), + 'categories' => json_encode(array('woocommerce', 'all')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), 'body' => json_encode($this->getBody()), diff --git a/lib/Config/PopulatorData/Templates/Minimal.php b/lib/Config/PopulatorData/Templates/Minimal.php index 69a856ad6e..119d19a4d0 100644 --- a/lib/Config/PopulatorData/Templates/Minimal.php +++ b/lib/Config/PopulatorData/Templates/Minimal.php @@ -15,7 +15,7 @@ class Minimal { function get() { return array( 'name' => __("Minimal", 'mailpoet'), - 'categories' => json_encode(array('welcome', 'sample')), + 'categories' => json_encode(array('welcome', 'all')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), 'body' => json_encode($this->getBody()), diff --git a/lib/Config/PopulatorData/Templates/ModularStyleStories.php b/lib/Config/PopulatorData/Templates/ModularStyleStories.php index 9077981ef7..f88f4673fa 100644 --- a/lib/Config/PopulatorData/Templates/ModularStyleStories.php +++ b/lib/Config/PopulatorData/Templates/ModularStyleStories.php @@ -15,7 +15,7 @@ class ModularStyleStories { function get() { return array( 'name' => __("Modular Style Stories", 'mailpoet'), - 'categories' => json_encode(array('notification', 'sample')), + 'categories' => json_encode(array('notification', 'all')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), 'body' => json_encode($this->getBody()), diff --git a/lib/Config/PopulatorData/Templates/Music.php b/lib/Config/PopulatorData/Templates/Music.php index f9180c2008..1b62fae472 100644 --- a/lib/Config/PopulatorData/Templates/Music.php +++ b/lib/Config/PopulatorData/Templates/Music.php @@ -15,7 +15,7 @@ class Music { function get() { return array( 'name' => __("Music", 'mailpoet'), - 'categories' => json_encode(array('standard', 'sample')), + 'categories' => json_encode(array('standard', 'all')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), 'body' => json_encode($this->getBody()), diff --git a/lib/Config/PopulatorData/Templates/NewsDay.php b/lib/Config/PopulatorData/Templates/NewsDay.php index f741c910a3..2adeadcad9 100644 --- a/lib/Config/PopulatorData/Templates/NewsDay.php +++ b/lib/Config/PopulatorData/Templates/NewsDay.php @@ -15,7 +15,7 @@ class NewsDay { function get() { return array( 'name' => __("News Day", 'mailpoet'), - 'categories' => json_encode(array('standard', 'sample')), + 'categories' => json_encode(array('standard', 'all')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), 'body' => json_encode($this->getBody()), diff --git a/lib/Config/PopulatorData/Templates/NewsletterBlank121Column.php b/lib/Config/PopulatorData/Templates/NewsletterBlank121Column.php index 022821a2b1..e749d4a0b5 100644 --- a/lib/Config/PopulatorData/Templates/NewsletterBlank121Column.php +++ b/lib/Config/PopulatorData/Templates/NewsletterBlank121Column.php @@ -15,7 +15,7 @@ class NewsletterBlank121Column { function get() { return array( 'name' => __("Newsletter: Blank 1:2:1 Column", 'mailpoet'), - 'categories' => json_encode(array('standard', 'blank')), + 'categories' => json_encode(array('standard')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), 'body' => json_encode($this->getBody()), diff --git a/lib/Config/PopulatorData/Templates/NewsletterBlank12Column.php b/lib/Config/PopulatorData/Templates/NewsletterBlank12Column.php index c25c6beb95..d80aa56e0d 100644 --- a/lib/Config/PopulatorData/Templates/NewsletterBlank12Column.php +++ b/lib/Config/PopulatorData/Templates/NewsletterBlank12Column.php @@ -15,7 +15,7 @@ class NewsletterBlank12Column { function get() { return array( 'name' => __("Newsletter: Blank 1:2 Column", 'mailpoet'), - 'categories' => json_encode(array('standard', 'blank')), + 'categories' => json_encode(array('standard')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), 'body' => json_encode($this->getBody()), diff --git a/lib/Config/PopulatorData/Templates/NewsletterBlank13Column.php b/lib/Config/PopulatorData/Templates/NewsletterBlank13Column.php index 1192172529..1420fb0998 100644 --- a/lib/Config/PopulatorData/Templates/NewsletterBlank13Column.php +++ b/lib/Config/PopulatorData/Templates/NewsletterBlank13Column.php @@ -15,7 +15,7 @@ class NewsletterBlank13Column { function get() { return array( 'name' => __("Newsletter: Blank 1:3 Column", 'mailpoet'), - 'categories' => json_encode(array('standard', 'blank')), + 'categories' => json_encode(array('standard')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), 'body' => json_encode($this->getBody()), diff --git a/lib/Config/PopulatorData/Templates/NewsletterBlank1Column.php b/lib/Config/PopulatorData/Templates/NewsletterBlank1Column.php index d778d30bfa..64ae6a92a4 100644 --- a/lib/Config/PopulatorData/Templates/NewsletterBlank1Column.php +++ b/lib/Config/PopulatorData/Templates/NewsletterBlank1Column.php @@ -15,7 +15,7 @@ class NewsletterBlank1Column { function get() { return array( 'name' => __("Newsletter: Blank 1 Column", 'mailpoet'), - 'categories' => json_encode(array('standard', 'blank')), + 'categories' => json_encode(array('standard')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), 'body' => json_encode($this->getBody()), diff --git a/lib/Config/PopulatorData/Templates/NotSoMedium.php b/lib/Config/PopulatorData/Templates/NotSoMedium.php index 3ff94f02ba..56cd7560c3 100644 --- a/lib/Config/PopulatorData/Templates/NotSoMedium.php +++ b/lib/Config/PopulatorData/Templates/NotSoMedium.php @@ -15,7 +15,7 @@ class NotSoMedium { function get() { return array( 'name' => __("One Full Post In An Email", 'mailpoet'), - 'categories' => json_encode(array('notification', 'sample')), + 'categories' => json_encode(array('notification', 'all')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), 'body' => json_encode($this->getBody()), diff --git a/lib/Config/PopulatorData/Templates/Phone.php b/lib/Config/PopulatorData/Templates/Phone.php index f90e6f47c9..cf8c4da367 100644 --- a/lib/Config/PopulatorData/Templates/Phone.php +++ b/lib/Config/PopulatorData/Templates/Phone.php @@ -15,7 +15,7 @@ class Phone { function get() { return array( 'name' => __("New Phone Purchase", 'mailpoet'), - 'categories' => json_encode(array('welcome', 'sample')), + 'categories' => json_encode(array('welcome', 'all')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), 'body' => json_encode($this->getBody()), diff --git a/lib/Config/PopulatorData/Templates/PieceOfCake.php b/lib/Config/PopulatorData/Templates/PieceOfCake.php index 7b394b43cd..33b1d15fdb 100644 --- a/lib/Config/PopulatorData/Templates/PieceOfCake.php +++ b/lib/Config/PopulatorData/Templates/PieceOfCake.php @@ -15,7 +15,7 @@ class PieceOfCake { function get() { return array( 'name' => __("Piece of cake", 'mailpoet'), - 'categories' => json_encode(array('standard', 'sample')), + 'categories' => json_encode(array('standard', 'all')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), 'body' => json_encode($this->getBody()), diff --git a/lib/Config/PopulatorData/Templates/PostNotificationsBlank1Column.php b/lib/Config/PopulatorData/Templates/PostNotificationsBlank1Column.php index 843267bae7..a8852594bc 100644 --- a/lib/Config/PopulatorData/Templates/PostNotificationsBlank1Column.php +++ b/lib/Config/PopulatorData/Templates/PostNotificationsBlank1Column.php @@ -15,7 +15,7 @@ class PostNotificationsBlank1Column { function get() { return array( 'name' => __("Post Notifications: Blank 1 Column", 'mailpoet'), - 'categories' => json_encode(array('notification', 'blank')), + 'categories' => json_encode(array('notification')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), 'body' => json_encode($this->getBody()), diff --git a/lib/Config/PopulatorData/Templates/RealEstate.php b/lib/Config/PopulatorData/Templates/RealEstate.php index dfe0c82e72..c9b27834ec 100644 --- a/lib/Config/PopulatorData/Templates/RealEstate.php +++ b/lib/Config/PopulatorData/Templates/RealEstate.php @@ -16,7 +16,7 @@ class RealEstate { function get() { return array( 'name' => __("Real Estate", 'mailpoet'), - 'categories' => json_encode(['welcome', 'sample']), + 'categories' => json_encode(['welcome', 'all']), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), 'body' => json_encode($this->getBody()), diff --git a/lib/Config/PopulatorData/Templates/Retro.php b/lib/Config/PopulatorData/Templates/Retro.php index ed05fa683f..0b4b913652 100644 --- a/lib/Config/PopulatorData/Templates/Retro.php +++ b/lib/Config/PopulatorData/Templates/Retro.php @@ -15,7 +15,7 @@ class Retro { function get() { return array( 'name' => __("Retro", 'mailpoet'), - 'categories' => json_encode(array('standard', 'sample')), + 'categories' => json_encode(array('standard', 'all')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), 'body' => json_encode($this->getBody()), diff --git a/lib/Config/PopulatorData/Templates/RetroComputingMagazine.php b/lib/Config/PopulatorData/Templates/RetroComputingMagazine.php index 3473515c54..48da410971 100644 --- a/lib/Config/PopulatorData/Templates/RetroComputingMagazine.php +++ b/lib/Config/PopulatorData/Templates/RetroComputingMagazine.php @@ -15,7 +15,7 @@ class RetroComputingMagazine { function get() { return array( 'name' => __("Retro Computing Magazine", 'mailpoet'), - 'categories' => json_encode(array('standard', 'sample')), + 'categories' => json_encode(array('standard', 'all')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), 'body' => json_encode($this->getBody()), diff --git a/lib/Config/PopulatorData/Templates/RssSimpleNews.php b/lib/Config/PopulatorData/Templates/RssSimpleNews.php index 93f228e747..c51f7972df 100644 --- a/lib/Config/PopulatorData/Templates/RssSimpleNews.php +++ b/lib/Config/PopulatorData/Templates/RssSimpleNews.php @@ -15,7 +15,7 @@ class RssSimpleNews { function get() { return array( 'name' => __("Stripped RSS Style Layout", 'mailpoet'), - 'categories' => json_encode(array('notification', 'sample')), + 'categories' => json_encode(array('notification', 'all')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), 'body' => json_encode($this->getBody()), diff --git a/lib/Config/PopulatorData/Templates/ScienceWeekly.php b/lib/Config/PopulatorData/Templates/ScienceWeekly.php index c332a78532..5d3f6c4352 100644 --- a/lib/Config/PopulatorData/Templates/ScienceWeekly.php +++ b/lib/Config/PopulatorData/Templates/ScienceWeekly.php @@ -15,7 +15,7 @@ class ScienceWeekly { function get() { return array( 'name' => __("Science Weekly", 'mailpoet'), - 'categories' => json_encode(array('notification', 'sample')), + 'categories' => json_encode(array('notification', 'all')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), 'body' => json_encode($this->getBody()), diff --git a/lib/Config/PopulatorData/Templates/Shoes.php b/lib/Config/PopulatorData/Templates/Shoes.php index 5bc1d704c3..543e61a43d 100644 --- a/lib/Config/PopulatorData/Templates/Shoes.php +++ b/lib/Config/PopulatorData/Templates/Shoes.php @@ -15,7 +15,7 @@ class Shoes { function get() { return array( 'name' => __("Shoes", 'mailpoet'), - 'categories' => json_encode(array('standard', 'sample')), + 'categories' => json_encode(array('standard', 'all')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), 'body' => json_encode($this->getBody()), diff --git a/lib/Config/PopulatorData/Templates/SimpleText.php b/lib/Config/PopulatorData/Templates/SimpleText.php index 0f9ad7bbf7..3b24c70692 100644 --- a/lib/Config/PopulatorData/Templates/SimpleText.php +++ b/lib/Config/PopulatorData/Templates/SimpleText.php @@ -15,7 +15,7 @@ class SimpleText { function get() { return array( 'name' => __("Simple Text", 'mailpoet'), - 'categories' => json_encode(array('standard', 'sample')), + 'categories' => json_encode(array('standard', 'all')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), 'body' => json_encode($this->getBody()), diff --git a/lib/Config/PopulatorData/Templates/Sunglasses.php b/lib/Config/PopulatorData/Templates/Sunglasses.php index 33be5c52cc..4400c064de 100644 --- a/lib/Config/PopulatorData/Templates/Sunglasses.php +++ b/lib/Config/PopulatorData/Templates/Sunglasses.php @@ -16,7 +16,7 @@ class Sunglasses { function get() { return array( 'name' => __("Sunglasses", 'mailpoet'), - 'categories' => json_encode(array('welcome', 'sample')), + 'categories' => json_encode(array('welcome', 'all')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), 'body' => json_encode($this->getBody()), diff --git a/lib/Config/PopulatorData/Templates/TakeAHike.php b/lib/Config/PopulatorData/Templates/TakeAHike.php index 1155a54cd1..fa9e1079bb 100644 --- a/lib/Config/PopulatorData/Templates/TakeAHike.php +++ b/lib/Config/PopulatorData/Templates/TakeAHike.php @@ -15,7 +15,7 @@ class TakeAHike { function get() { return array( 'name' => __("Take a Hike", 'mailpoet'), - 'categories' => json_encode(array('standard', 'sample')), + 'categories' => json_encode(array('standard', 'all')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), 'body' => json_encode($this->getBody()), diff --git a/lib/Config/PopulatorData/Templates/WelcomeBlank12Column.php b/lib/Config/PopulatorData/Templates/WelcomeBlank12Column.php index bd2ab025df..0eb444102b 100644 --- a/lib/Config/PopulatorData/Templates/WelcomeBlank12Column.php +++ b/lib/Config/PopulatorData/Templates/WelcomeBlank12Column.php @@ -15,7 +15,7 @@ class WelcomeBlank12Column { function get() { return array( 'name' => __("Welcome Email: Blank 1:2 Column", 'mailpoet'), - 'categories' => json_encode(array('welcome', 'blank')), + 'categories' => json_encode(array('welcome')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), 'body' => json_encode($this->getBody()), diff --git a/lib/Config/PopulatorData/Templates/WelcomeBlank1Column.php b/lib/Config/PopulatorData/Templates/WelcomeBlank1Column.php index 23c5b4c9be..1ad3124f7f 100644 --- a/lib/Config/PopulatorData/Templates/WelcomeBlank1Column.php +++ b/lib/Config/PopulatorData/Templates/WelcomeBlank1Column.php @@ -15,7 +15,7 @@ class WelcomeBlank1Column { function get() { return array( 'name' => __("Welcome Email: Blank 1 Column", 'mailpoet'), - 'categories' => json_encode(array('welcome', 'blank')), + 'categories' => json_encode(array('welcome')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), 'body' => json_encode($this->getBody()), diff --git a/lib/Config/PopulatorData/Templates/WideStoryLayout.php b/lib/Config/PopulatorData/Templates/WideStoryLayout.php index 5df04462bd..5e8440970e 100644 --- a/lib/Config/PopulatorData/Templates/WideStoryLayout.php +++ b/lib/Config/PopulatorData/Templates/WideStoryLayout.php @@ -15,7 +15,7 @@ class WideStoryLayout { function get() { return array( 'name' => __("Wide Story Layout", 'mailpoet'), - 'categories' => json_encode(array('notification', 'sample')), + 'categories' => json_encode(array('notification', 'all')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), 'body' => json_encode($this->getBody()), diff --git a/lib/Config/PopulatorData/Templates/WineCity.php b/lib/Config/PopulatorData/Templates/WineCity.php index f1bda2bd3b..a7eed2c598 100644 --- a/lib/Config/PopulatorData/Templates/WineCity.php +++ b/lib/Config/PopulatorData/Templates/WineCity.php @@ -15,7 +15,7 @@ class WineCity { function get() { return array( 'name' => __("Wine City", 'mailpoet'), - 'categories' => json_encode(array('woocommerce', 'sample')), + 'categories' => json_encode(array('woocommerce', 'all')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), 'body' => json_encode($this->getBody()), diff --git a/lib/Config/PopulatorData/Templates/WorldCup.php b/lib/Config/PopulatorData/Templates/WorldCup.php index 878ca60106..e54acf5419 100644 --- a/lib/Config/PopulatorData/Templates/WorldCup.php +++ b/lib/Config/PopulatorData/Templates/WorldCup.php @@ -15,7 +15,7 @@ class WorldCup { function get() { return array( 'name' => __("World Cup", 'mailpoet'), - 'categories' => json_encode(array('standard', 'sample')), + 'categories' => json_encode(array('standard', 'all')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), 'body' => json_encode($this->getBody()), diff --git a/lib/Config/PopulatorData/Templates/YogaStudio.php b/lib/Config/PopulatorData/Templates/YogaStudio.php index c48c45876c..bec5433885 100644 --- a/lib/Config/PopulatorData/Templates/YogaStudio.php +++ b/lib/Config/PopulatorData/Templates/YogaStudio.php @@ -15,7 +15,7 @@ class YogaStudio { function get() { return array( 'name' => __("Yoga Studio", 'mailpoet'), - 'categories' => json_encode(array('standard', 'sample')), + 'categories' => json_encode(array('standard', 'all')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), 'body' => json_encode($this->getBody()), diff --git a/views/newsletters.html b/views/newsletters.html index 809562f9e1..0e483b526d 100644 --- a/views/newsletters.html +++ b/views/newsletters.html @@ -22,6 +22,7 @@ var mailpoet_date_storage_format = "Y-m-d"; var mailpoet_tracking_enabled = <%= json_encode(tracking_enabled) %>; var mailpoet_premium_active = <%= json_encode(premium_plugin_active) %>; + var mailpoet_woocommerce_active = <%= json_encode(is_woocommerce_active) %>; var mailpoet_automatic_emails = <%= json_encode(automatic_emails) %>; var mailpoet_in_app_announcements = mailpoet_settings.in_app_announcements; var mailpoet_free_welcome_emails_image = '<%= image_url('in_app_announcements/hello-illustration-for-welcome-emails.png') %>'; @@ -293,8 +294,7 @@ 'savedTemplates': __('Your saved templates'), 'templatePreview': __('Template preview'), 'zoom': __('Preview'), - 'blank': _x('Blank', 'Blank newsletters templates category'), - 'sample': _x('Sample', 'Sample newsletters templates category'), + 'allTemplates': _x('All', 'Name of a section with all email templates'), 'tabImportTitle': _x('Import', 'Importing template tab title'), 'noTemplates': __('This category does not contain any template yet!'),