Replace email title after update status of automatic email

[MAILPOET-3371]
This commit is contained in:
Jan Lysý
2021-02-01 13:57:22 +01:00
committed by Veljko V
parent 365db2fa9e
commit e0a1b777f0

View File

@@ -178,7 +178,9 @@ class Listings extends React.Component {
},
}).done((response) => {
if (response.data.status === 'active') {
MailPoet.Notice.success(MailPoet.I18n.t('automaticEmailActivated'));
const newsletterGroup = e.target.getAttribute('data-group');
const email = automaticEmails[newsletterGroup];
MailPoet.Notice.success(MailPoet.I18n.t('automaticEmailActivated').replace('%1s', email.title));
}
// force refresh of listing so that groups are updated
this.forceUpdate();
@@ -202,6 +204,7 @@ class Listings extends React.Component {
className="mailpoet-listing-status-toggle"
onCheck={this.updateStatus}
data-id={newsletter.id}
data-group={newsletter.options.group}
dimension="small"
defaultChecked={newsletter.status === 'active'}
/>