Prevents welcome emails from being created
Adds filter to modify available email types
This commit is contained in:
@@ -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">
|
||||
{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>
|
||||
<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>
|
||||
{type.action}
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
)
|
||||
}, this)}
|
||||
</ul>
|
||||
</div>
|
||||
);
|
||||
|
@@ -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'),
|
||||
|
Reference in New Issue
Block a user