Don't show "missing unsubscribe link" for already sent newsletters
[MAILPOET-2195]
This commit is contained in:
committed by
Jack Kitterhing
parent
f61f6c248d
commit
6cb2eba0e4
@ -248,7 +248,7 @@ Module.SaveView = Marionette.View.extend({
|
|||||||
},
|
},
|
||||||
validateNewsletter: function (jsonObject) {
|
validateNewsletter: function (jsonObject) {
|
||||||
var body = '';
|
var body = '';
|
||||||
var newsletter;
|
var newsletter = App.getNewsletter();
|
||||||
if (!App._contentContainer.isValid()) {
|
if (!App._contentContainer.isValid()) {
|
||||||
this.showValidationError(App._contentContainer.validationError);
|
this.showValidationError(App._contentContainer.validationError);
|
||||||
return;
|
return;
|
||||||
@ -259,12 +259,12 @@ Module.SaveView = Marionette.View.extend({
|
|||||||
}
|
}
|
||||||
if (App.getConfig().get('validation.validateUnsubscribeLinkPresent')
|
if (App.getConfig().get('validation.validateUnsubscribeLinkPresent')
|
||||||
&& body.indexOf('[link:subscription_unsubscribe_url]') < 0
|
&& body.indexOf('[link:subscription_unsubscribe_url]') < 0
|
||||||
&& body.indexOf('[link:subscription_unsubscribe]') < 0) {
|
&& body.indexOf('[link:subscription_unsubscribe]') < 0
|
||||||
|
&& newsletter.get('status') !== 'sent') {
|
||||||
this.showValidationError(MailPoet.I18n.t('unsubscribeLinkMissing'));
|
this.showValidationError(MailPoet.I18n.t('unsubscribeLinkMissing'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
newsletter = App.getNewsletter();
|
|
||||||
if ((newsletter.get('type') === 'notification')
|
if ((newsletter.get('type') === 'notification')
|
||||||
&& body.indexOf('"type":"automatedLatestContent"') < 0
|
&& body.indexOf('"type":"automatedLatestContent"') < 0
|
||||||
&& body.indexOf('"type":"automatedLatestContentLayout"') < 0
|
&& body.indexOf('"type":"automatedLatestContentLayout"') < 0
|
||||||
|
Reference in New Issue
Block a user