Add template category Re-engagement Emails
[MAILPOET-3764]
This commit is contained in:
@@ -75,6 +75,8 @@ class NewsletterTemplates extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
this.addReEngagementCategory();
|
||||||
|
|
||||||
MailPoet.Ajax.get({
|
MailPoet.Ajax.get({
|
||||||
api_version: window.mailpoet_api_version,
|
api_version: window.mailpoet_api_version,
|
||||||
endpoint: 'newsletterTemplates',
|
endpoint: 'newsletterTemplates',
|
||||||
@@ -104,6 +106,21 @@ class NewsletterTemplates extends React.Component {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We want temporarily to allow re-engagement emails only when the feature is active
|
||||||
|
addReEngagementCategory() {
|
||||||
|
if (this.context.features.isSupported('re-engagement-email')) {
|
||||||
|
const notificationIndex = templatesCategories.map((category) => category.name).indexOf('notification');
|
||||||
|
const categoriesTmp = templatesCategories.splice(notificationIndex + 1);
|
||||||
|
templatesCategories.push(
|
||||||
|
{
|
||||||
|
name: 're_engagement',
|
||||||
|
label: MailPoet.I18n.t('tabReEngagementTitle'),
|
||||||
|
},
|
||||||
|
...categoriesTmp
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
addTemplate(template) {
|
addTemplate(template) {
|
||||||
const categoriesNames = templatesCategories.map((category) => category.name);
|
const categoriesNames = templatesCategories.map((category) => category.name);
|
||||||
let categories;
|
let categories;
|
||||||
|
@@ -102,6 +102,7 @@
|
|||||||
'tabWoocommerceTitle': __('WooCommerce Emails'),
|
'tabWoocommerceTitle': __('WooCommerce Emails'),
|
||||||
'tabReEngagementTitle': __('Re-engagement Email'),
|
'tabReEngagementTitle': __('Re-engagement Email'),
|
||||||
'tabBlankTitle': __('Simple text'),
|
'tabBlankTitle': __('Simple text'),
|
||||||
|
'tabReEngagementTitle': __('Re-engagement Emails'),
|
||||||
|
|
||||||
'reEngagementTextPre': __('After no activity for'),
|
'reEngagementTextPre': __('After no activity for'),
|
||||||
'reEngagementAterTimeNumberPlaceholder': __('count'),
|
'reEngagementAterTimeNumberPlaceholder': __('count'),
|
||||||
|
Reference in New Issue
Block a user