diff --git a/assets/js/src/common/sender_email_address_warning.jsx b/assets/js/src/common/sender_email_address_warning.jsx index 7e6b4a4a13..fa8db6958c 100644 --- a/assets/js/src/common/sender_email_address_warning.jsx +++ b/assets/js/src/common/sender_email_address_warning.jsx @@ -53,16 +53,17 @@ const badDomains = [ ]; const SenderEmailAddressWarning = ({ emailAddress }) => { - const domain = emailAddress.split('@').pop().toLowerCase(); - if (badDomains.indexOf(domain) > -1) { + const emailAddressDomain = emailAddress.split('@').pop().toLowerCase(); + if (badDomains.indexOf(emailAddressDomain) > -1) { + const userHostDomain = window.location.hostname.replace('www.', ''); return (

{MailPoet.I18n.t('senderEmailAddressWarning1')}

{ReactStringReplace( MailPoet.I18n.t('senderEmailAddressWarning2'), - /(%userDomain|%originalSender|.*<\/em>)/, + /(%suggested|%originalSender|.*<\/em>)/, (match) => { - if (match === '%userDomain') return 'user domain'; // TODO replace with the real domain + if (match === '%suggested') return `info@${userHostDomain}`; if (match === '%originalSender') return { emailAddress }; return {match.replace(/<\/?em>/g, '')}; } diff --git a/views/layout.html b/views/layout.html index 4097a6578c..162ffdf758 100644 --- a/views/layout.html +++ b/views/layout.html @@ -67,8 +67,8 @@ jQuery('.toplevel_page_mailpoet-newsletters.menu-top-last') <%= localize({ 'ajaxFailedErrorMessage': __('An error has happened while performing a request, the server has responded with response code %d'), 'senderEmailAddressWarning1': _x('You might not reach the inbox of your subscribers if you use this email address.', 'In the last step, before sending a newsletter. URL: ?page=mailpoet-newsletters#/send/2'), - 'senderEmailAddressWarning2': _x('Use an address like s%userDomain for the Sender and put %originalSender in the the Reply-to field below.', 'In the last step, before sending a newsletter. URL: ?page=mailpoet-newsletters#/send/2'), - 'senderEmailAddressWarning3': __('Read more.'), + 'senderEmailAddressWarning2': _x('Use an address like %suggested for the Sender and put %originalSender in the the Reply-to field below.', 'In the last step, before sending a newsletter. URL: ?page=mailpoet-newsletters#/send/2'), + 'senderEmailAddressWarning3': _x('Read more.'), }) %> <% block translations %><% endblock %>