Keep role emails list in one place
[MAILPOET-2101]
This commit is contained in:
@ -3,41 +3,7 @@
|
||||
import jQuery from 'jquery';
|
||||
import _ from 'underscore';
|
||||
|
||||
const ROLE_EMAILS = [
|
||||
'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 isRoleEmail = email => window.roleBasedEmails.findIndex(element => email.startsWith(`${element}@`)) >= 0;
|
||||
|
||||
const detectAndCleanupEmail = (emailString) => {
|
||||
let test;
|
||||
|
@ -13,6 +13,7 @@ use MailPoet\Listing;
|
||||
use MailPoet\Mailer\MailerLog;
|
||||
use MailPoet\Models\CustomField;
|
||||
use MailPoet\Models\Form;
|
||||
use MailPoet\Models\ModelValidator;
|
||||
use MailPoet\Models\Segment;
|
||||
use MailPoet\Models\Subscriber;
|
||||
use MailPoet\Newsletter\Shortcodes\ShortcodesHelper;
|
||||
@ -788,6 +789,7 @@ class Menu {
|
||||
'date_formats' => Block\Date::getDateFormats(),
|
||||
'month_names' => Block\Date::getMonthNames(),
|
||||
'sub_menu' => 'mailpoet-subscribers',
|
||||
'role_based_emails' => json_encode(ModelValidator::ROLE_EMAILS),
|
||||
]);
|
||||
|
||||
$data['is_new_user'] = $this->isNewUser();
|
||||
|
@ -22,6 +22,7 @@
|
||||
<script type="text/javascript">
|
||||
var
|
||||
maxPostSize = '<%= maxPostSize %>',
|
||||
roleBasedEmails = <%= role_based_emails|raw %>,
|
||||
maxPostSizeBytes = '<%= maxPostSizeBytes %>',
|
||||
importData = {},
|
||||
mailpoetColumnsSelect2 = <%= subscriberFieldsSelect2|raw %>,
|
||||
|
Reference in New Issue
Block a user