Change unsubscribe verifier to check for "Unsubscribe" shortcode

presence
This commit is contained in:
Tautvidas Sipavičius
2016-05-31 16:29:10 +03:00
parent 2b6e87c3a7
commit e6724b1d4a
4 changed files with 6 additions and 1 deletions

View File

@@ -62,6 +62,7 @@ define([
invalid_elements: "script",
block_formats: 'Paragraph=p',
relative_urls: false,
remove_script_host: false,
plugins: "link textcolor colorpicker mailpoet_custom_fields",

View File

@@ -62,6 +62,7 @@ define([
invalid_elements: "script",
block_formats: 'Paragraph=p',
relative_urls: false,
remove_script_host: false,
plugins: "link textcolor colorpicker mailpoet_custom_fields",

View File

@@ -60,6 +60,7 @@ define([
invalid_elements: "script",
block_formats: 'Heading 1=h1;Heading 2=h2;Heading 3=h3;Paragraph=p',
relative_urls: false,
remove_script_host: false,
plugins: "link code textcolor colorpicker mailpoet_custom_fields",

View File

@@ -283,8 +283,10 @@ define([
return;
}
var contents = JSON.stringify(jsonObject);
if (App.getConfig().get('validation.validateUnsubscribeLinkPresent') &&
JSON.stringify(jsonObject).indexOf("[link:subscription_unsubscribe_url]") < 0) {
contents.indexOf("[link:subscription_unsubscribe_url]") < 0 &&
contents.indexOf("[link:subscription_unsubscribe]") < 0) {
this.showValidationError(MailPoet.I18n.t('unsubscribeLinkMissing'));
return;
}