Prevents welcome emails from being created

Adds filter to modify available email types
This commit is contained in:
Vlad
2017-05-15 21:36:52 -04:00
committed by stoletniy
parent 028de860a2
commit ce3eb06924
2 changed files with 61 additions and 59 deletions

View File

@@ -2,12 +2,14 @@ define(
[
'react',
'mailpoet',
'wp-js-hooks',
'react-router',
'newsletters/breadcrumb.jsx'
],
function(
React,
MailPoet,
Hooks,
Router,
Breadcrumb
) {
@@ -41,6 +43,47 @@ define(
});
},
render: function() {
var types = [
{
'id': 'standard',
'title': MailPoet.I18n.t('regularNewsletterTypeTitle'),
'description': MailPoet.I18n.t('regularNewsletterTypeDescription'),
'action': function() {
return (
<a className="button button-primary" onClick={ this.createNewsletter.bind(null, 'standard') }>
{MailPoet.I18n.t('create')}
</a>
)
}.bind(this)()
},
{
'id': 'welcome',
'title': MailPoet.I18n.t('welcomeNewsletterTypeTitle'),
'description': MailPoet.I18n.t('welcomeNewsletterTypeDescription'),
'action': function() {
return (
<div>
Premium feature text (TBD)
</div>
)
}()
},
{
'id': 'notification',
'title': MailPoet.I18n.t('postNotificationNewsletterTypeTitle'),
'description': MailPoet.I18n.t('postNotificationNewsletterTypeDescription'),
'action': function() {
return (
<a className="button button-primary" onClick={ this.createNewsletter.bind(null, 'standard') }>
{MailPoet.I18n.t('setUp')}
</a>
)
}.bind(this)()
}
];
types = Hooks.applyFilters('mailpoet_newsletters_types', types);
return (
<div>
<h1>{MailPoet.I18n.t('pickCampaignType')}</h1>
@@ -48,65 +91,24 @@ define(
<Breadcrumb step="type" />
<ul className="mailpoet_boxes clearfix">
<li data-type="standard">
<div className="mailpoet_thumbnail"></div>
{types.map(function(type, index) {
return (
<li key={index} data-type={type.id}>
<div>
<div className="mailpoet_thumbnail"></div>
<div className="mailpoet_description">
<h3>{MailPoet.I18n.t('regularNewsletterTypeTitle')}</h3>
<p>
{MailPoet.I18n.t('regularNewsletterTypeDescription')}
</p>
</div>
<div className="mailpoet_description">
<h3>{type.title}</h3>
<p>{type.description}</p>
</div>
<div className="mailpoet_actions">
<a
className="button button-primary"
onClick={ this.createNewsletter.bind(null, 'standard') }
>
{MailPoet.I18n.t('create')}
</a>
</div>
</li>
<li data-type="welcome">
<div className="mailpoet_thumbnail"></div>
<div className="mailpoet_description">
<h3>{MailPoet.I18n.t('welcomeNewsletterTypeTitle')}</h3>
<p>
{MailPoet.I18n.t('welcomeNewsletterTypeDescription')}
</p>
</div>
<div className="mailpoet_actions">
<a
className="button button-primary"
onClick={ this.setupNewsletter.bind(null, 'welcome') }
>
{MailPoet.I18n.t('setUp')}
</a>
</div>
</li>
<li data-type="notification">
<div className="mailpoet_thumbnail"></div>
<div className="mailpoet_description">
<h3>{MailPoet.I18n.t('postNotificationNewsletterTypeTitle')}</h3>
<p>
{MailPoet.I18n.t('postNotificationsNewsletterTypeDescription')}
</p>
</div>
<div className="mailpoet_actions">
<a
className="button button-primary"
onClick={ this.setupNewsletter.bind(null, 'notification') }
>
{MailPoet.I18n.t('setUp')}
</a>
</div>
</li>
<div className="mailpoet_actions">
{type.action}
</div>
</div>
</li>
)
}, this)}
</ul>
</div>
);
@@ -115,4 +117,4 @@ define(
return NewsletterTypes;
}
);
);

View File

@@ -123,7 +123,7 @@
'welcomeNewsletterTypeDescription': __('Automatically send an email (or series of emails) to new subscribers or WordPress users. Send a day, a week, or a month after they sign up.'),
'setUp': __('Set up'),
'postNotificationNewsletterTypeTitle': __('Latest Post Notifications'),
'postNotificationsNewsletterTypeDescription': __('Let MailPoet email your subscribers with your latest content. You can send daily, weekly, monthly, or even immediately after publication.'),
'postNotificationNewsletterTypeDescription': __('Let MailPoet email your subscribers with your latest content. You can send daily, weekly, monthly, or even immediately after publication.'),
'selectFrequency': __('Select a frequency'),
'postNotificationSubjectLineTip': __("Insert [newsletter:total] to show number of posts, [newsletter:post_title] to show the latest post's title & [newsletter:number] to display the issue number."),
'activate': __('Activate'),