Keep role emails list in one place
[MAILPOET-2101]
This commit is contained in:
@ -3,41 +3,7 @@
|
|||||||
import jQuery from 'jquery';
|
import jQuery from 'jquery';
|
||||||
import _ from 'underscore';
|
import _ from 'underscore';
|
||||||
|
|
||||||
const ROLE_EMAILS = [
|
const isRoleEmail = email => window.roleBasedEmails.findIndex(element => email.startsWith(`${element}@`)) >= 0;
|
||||||
'abuse',
|
|
||||||
'compliance',
|
|
||||||
'devnull',
|
|
||||||
'dns',
|
|
||||||
'ftp',
|
|
||||||
'hostmaster',
|
|
||||||
'inoc',
|
|
||||||
'ispfeedback',
|
|
||||||
'ispsupport',
|
|
||||||
'list-request',
|
|
||||||
'list',
|
|
||||||
'maildaemon',
|
|
||||||
'noc',
|
|
||||||
'no-reply',
|
|
||||||
'noreply',
|
|
||||||
'null',
|
|
||||||
'phish',
|
|
||||||
'phishing',
|
|
||||||
'postmaster',
|
|
||||||
'privacy',
|
|
||||||
'registrar',
|
|
||||||
'root',
|
|
||||||
'security',
|
|
||||||
'spam',
|
|
||||||
'sysadmin',
|
|
||||||
'undisclosed-recipients',
|
|
||||||
'unsubscribe',
|
|
||||||
'usenet',
|
|
||||||
'uucp',
|
|
||||||
'webmaster',
|
|
||||||
'www',
|
|
||||||
];
|
|
||||||
|
|
||||||
const isRoleEmail = email => ROLE_EMAILS.findIndex(element => email.startsWith(`${element}@`)) >= 0;
|
|
||||||
|
|
||||||
const detectAndCleanupEmail = (emailString) => {
|
const detectAndCleanupEmail = (emailString) => {
|
||||||
let test;
|
let test;
|
||||||
|
@ -13,6 +13,7 @@ use MailPoet\Listing;
|
|||||||
use MailPoet\Mailer\MailerLog;
|
use MailPoet\Mailer\MailerLog;
|
||||||
use MailPoet\Models\CustomField;
|
use MailPoet\Models\CustomField;
|
||||||
use MailPoet\Models\Form;
|
use MailPoet\Models\Form;
|
||||||
|
use MailPoet\Models\ModelValidator;
|
||||||
use MailPoet\Models\Segment;
|
use MailPoet\Models\Segment;
|
||||||
use MailPoet\Models\Subscriber;
|
use MailPoet\Models\Subscriber;
|
||||||
use MailPoet\Newsletter\Shortcodes\ShortcodesHelper;
|
use MailPoet\Newsletter\Shortcodes\ShortcodesHelper;
|
||||||
@ -788,6 +789,7 @@ class Menu {
|
|||||||
'date_formats' => Block\Date::getDateFormats(),
|
'date_formats' => Block\Date::getDateFormats(),
|
||||||
'month_names' => Block\Date::getMonthNames(),
|
'month_names' => Block\Date::getMonthNames(),
|
||||||
'sub_menu' => 'mailpoet-subscribers',
|
'sub_menu' => 'mailpoet-subscribers',
|
||||||
|
'role_based_emails' => json_encode(ModelValidator::ROLE_EMAILS),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$data['is_new_user'] = $this->isNewUser();
|
$data['is_new_user'] = $this->isNewUser();
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var
|
var
|
||||||
maxPostSize = '<%= maxPostSize %>',
|
maxPostSize = '<%= maxPostSize %>',
|
||||||
|
roleBasedEmails = <%= role_based_emails|raw %>,
|
||||||
maxPostSizeBytes = '<%= maxPostSizeBytes %>',
|
maxPostSizeBytes = '<%= maxPostSizeBytes %>',
|
||||||
importData = {},
|
importData = {},
|
||||||
mailpoetColumnsSelect2 = <%= subscriberFieldsSelect2|raw %>,
|
mailpoetColumnsSelect2 = <%= subscriberFieldsSelect2|raw %>,
|
||||||
|
Reference in New Issue
Block a user