Add template category Re-engagement Emails
[MAILPOET-3764]
This commit is contained in:
@@ -75,6 +75,8 @@ class NewsletterTemplates extends React.Component {
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.addReEngagementCategory();
|
||||
|
||||
MailPoet.Ajax.get({
|
||||
api_version: window.mailpoet_api_version,
|
||||
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) {
|
||||
const categoriesNames = templatesCategories.map((category) => category.name);
|
||||
let categories;
|
||||
|
Reference in New Issue
Block a user