Remove SPF notice

[MAILPOET-2867]
This commit is contained in:
Pavel Dohnal
2020-04-21 13:42:08 +02:00
committed by Veljko V
parent df3a429c94
commit e5639d1adb
11 changed files with 1 additions and 149 deletions

View File

@@ -1,23 +0,0 @@
import MailPoet from 'mailpoet';
import _ from 'underscore';
const getErrorMessage = (senderAddress) => `<h3>${MailPoet.I18n.t('spfCheckTitle')}</h3>
<p>${MailPoet.I18n.t('spfCheckMsgWhy').replace('%s', _.escape(senderAddress))}</p>
<p>${MailPoet.I18n.t('spfCheckMsgEdit').replace('%s', '<em>include:spf.sendingservice.net</em>')}</p>
<p><a class="button button-primary" href="https://kb.mailpoet.com/article/151-email-authentication-spf-and-dkim" target="_blank">${MailPoet.I18n.t('spfCheckReadMore')}</a></p>`;
const checkSPFRecord = () => MailPoet.Ajax.post({
api_version: window.mailpoet_api_version,
endpoint: 'services',
action: 'checkSPFRecord',
data: {},
}).fail((response) => {
if (response.meta.sender_address) {
MailPoet.Notice.system(
getErrorMessage(response.meta.sender_address),
{ static: true, scroll: true, id: 'spf_check_error' }
);
}
});
export default checkSPFRecord;

View File

@@ -7,7 +7,6 @@ import Marionette from 'backbone.marionette';
import SuperModel from 'backbone.supermodel';
import _ from 'underscore';
import jQuery from 'jquery';
import checkSPFRecord from 'common/check_spf_record.jsx';
var Module = {};
var SidebarView;
@@ -348,9 +347,6 @@ Module.SidebarPreviewView = Marionette.View.extend({
'MailPoet Free version': window.mailpoet_version,
'Domain name': data.subscriber.substring(data.subscriber.indexOf('@') + 1),
});
if (App.getConfig().get('validation.validateSPFRecord')) {
checkSPFRecord();
}
}).fail(function (response) {
if (response.errors.length > 0) {
MailPoet.Notice.error(

View File

@@ -6,7 +6,6 @@ import { useSelector, useAction, useSetting } from 'settings/store/hooks';
import { MssStatus } from 'settings/store/types';
import { t } from 'common/functions';
import { Link } from 'react-router-dom';
import checkSPFRecord from 'common/check_spf_record';
export default function SendWith() {
const isNewUser = useSelector('isNewUser')();
@@ -23,8 +22,7 @@ export default function SendWith() {
await setSetting(['mta', 'method'], 'MailPoet');
await setSetting(['mta', 'mailpoet_api_key'], key);
await setSetting(['signup_confirmation', 'enabled'], '1');
await saveSettings();
return checkSPFRecord();
return saveSettings();
};
return (