diff --git a/assets/js/src/common/check_spf_record.jsx b/assets/js/src/common/check_spf_record.jsx index f73fb405f1..4d3fc3d840 100644 --- a/assets/js/src/common/check_spf_record.jsx +++ b/assets/js/src/common/check_spf_record.jsx @@ -1,13 +1,9 @@ import MailPoet from 'mailpoet'; import _ from 'underscore'; -const getErrorMessage = (domainName, senderAddress) => `
${MailPoet.I18n.t('spfCheckMsgWhy').replace('%s', _.escape(domainName))}
-${MailPoet.I18n.t('spfCheckMsgEdit').replace('%s', 'include:spf.sendingservice.net')}
-
- v=spf1 include:spf.protection.outlook.com include:sendgrid.net include:spf.sendingservice.net -all
-
${MailPoet.I18n.t('spfCheckMsgAllow').replace('%s', _.escape(senderAddress))}
+const getErrorMessage = (senderAddress) => `${MailPoet.I18n.t('spfCheckMsgWhy').replace('%s', _.escape(senderAddress))}
+${MailPoet.I18n.t('spfCheckMsgEdit').replace('%s', 'include:spf.sendingservice.net')}
`; const checkSPFRecord = () => MailPoet.Ajax.post({ @@ -16,9 +12,9 @@ const checkSPFRecord = () => MailPoet.Ajax.post({ action: 'checkSPFRecord', data: {}, }).fail((response) => { - if (response.meta.domain_name && response.meta.sender_address) { + if (response.meta.sender_address) { MailPoet.Notice.error( - getErrorMessage(response.meta.domain_name, response.meta.sender_address), + getErrorMessage(response.meta.sender_address), { static: true, scroll: true, id: 'spf_check_error' } ); } diff --git a/lib/API/JSON/v1/Services.php b/lib/API/JSON/v1/Services.php index e1b71b3c36..2c381eef77 100644 --- a/lib/API/JSON/v1/Services.php +++ b/lib/API/JSON/v1/Services.php @@ -50,7 +50,7 @@ class Services extends APIEndpoint { if (!$result) { return $this->errorResponse( [APIError::BAD_REQUEST => WPFunctions::get()->__('SPF check has failed.', 'mailpoet')], - ['sender_address' => $sender_address, 'domain_name' => $domain_name] + ['sender_address' => $sender_address] ); } diff --git a/tests/integration/API/JSON/v1/ServicesTest.php b/tests/integration/API/JSON/v1/ServicesTest.php index 8abbfd8953..4102cb2861 100644 --- a/tests/integration/API/JSON/v1/ServicesTest.php +++ b/tests/integration/API/JSON/v1/ServicesTest.php @@ -37,7 +37,6 @@ class ServicesTest extends \MailPoetTest { $response = $services_endpoint->checkSPFRecord([]); expect($response->status)->equals(APIResponse::STATUS_NOT_FOUND); expect($response->meta['sender_address'])->equals($email); - expect($response->meta['domain_name'])->equals('example.com'); } function testItRespondsWithSuccessIfSPFCheckPasses() { diff --git a/views/layout.html b/views/layout.html index a59ab903e0..aeac7dcac3 100644 --- a/views/layout.html +++ b/views/layout.html @@ -84,11 +84,10 @@ jQuery('.toplevel_page_mailpoet-newsletters.menu-top-last') 'senderEmailAddressWarning3': _x('Read more.'), 'mailerSendingResumedNotice': __('Sending has been resumed.'), - 'spfCheckTitle': _x('Oops! You might not receive your own emails.', 'DNS SPF Record check'), - 'spfCheckMsgWhy': _x("Why? You have an SPF entry for %s, but it's incomplete.", 'DNS SPF Record check'), - 'spfCheckMsgEdit': _x('If you send with MailPoet, edit the SPF record in your DNS and add %s to it, so it looks like this:', 'DNS SPF Record check'), - 'spfCheckMsgAllow': _x('This will allow MailPoet to send emails from %s addresses.', 'DNS SPF Record check'), - 'spfCheckReadMore': _x('Read more about SPF', 'DNS SPF Record check'), + 'spfCheckTitle': _x('Improve your deliverability!', 'DNS SPF Record check'), + 'spfCheckMsgWhy': _x("Your email is set to be sent from %s and we noticed that you have an SPF record for this domain. It means some subscribers may not receive your emails.", 'DNS SPF Record check'), + 'spfCheckMsgEdit': _x("Since you're sending with the MailPoet Sending Service, you need to add %s to the existing SPF entry in your DNS records. This will allow MailPoet to send on your behalf for optimal deliverability.", 'DNS SPF Record check'), + 'spfCheckReadMore': _x('Read the Guide', 'DNS SPF Record check'), }) %> <% block translations %><% endblock %>