Only do validation if MSS is active

[MAILPOET-3857]
This commit is contained in:
Pavel Dohnal
2021-10-19 13:04:27 +02:00
committed by Veljko V
parent 813d43f857
commit 0d70174737
3 changed files with 24 additions and 6 deletions

View File

@@ -40,9 +40,11 @@ function validateNewsletter(newsletter) {
return MailPoet.I18n.t('newsletterIsEmpty');
}
}
// todo only check this if MSS is active
if (body.indexOf('[link:subscription_unsubscribe_url]') < 0
&& body.indexOf('[link:subscription_unsubscribe]') < 0
if (
window.mailpoet_mss_active
&& (body.indexOf('[link:subscription_unsubscribe_url]') < 0)
&& (body.indexOf('[link:subscription_unsubscribe]') < 0)
) {
return MailPoet.I18n.t('unsubscribeLinkMissing');
}