diff --git a/packages/js/email-editor/src/components/preview/send-preview-email.tsx b/packages/js/email-editor/src/components/preview/send-preview-email.tsx index c7a3845e9b..1d3609fc32 100644 --- a/packages/js/email-editor/src/components/preview/send-preview-email.tsx +++ b/packages/js/email-editor/src/components/preview/send-preview-email.tsx @@ -4,7 +4,7 @@ import { Button, Modal, TextControl } from '@wordpress/components'; import { useDispatch, useSelect } from '@wordpress/data'; import { check, Icon } from '@wordpress/icons'; -import { __ } from '@wordpress/i18n'; +import { __, sprintf } from '@wordpress/i18n'; import { useEffect, useRef, @@ -13,13 +13,23 @@ import { } from '@wordpress/element'; import { ENTER } from '@wordpress/keycodes'; import { isEmail } from '@wordpress/url'; +import { applyFilters } from '@wordpress/hooks'; /** * Internal dependencies */ -import { SendingPreviewStatus, storeName } from '../../store'; +import { + SendingPreviewStatus, + storeName, + editorCurrentPostType, +} from '../../store'; import { recordEvent, recordEventOnce } from '../../events'; +const sendingMethodConfigurationLink = applyFilters( + 'mailpoet_email_editor_check_sending_method_configuration_link', + 'admin.php?page=mailpoet-settings#mta' +) as string; + function RawSendPreviewEmail() { const sendToRef = useRef( null ); @@ -34,6 +44,7 @@ function RawSendPreviewEmail() { isSendingPreviewEmail, sendingPreviewStatus, isModalOpened, + errorMessage, } = useSelect( ( select ) => select( storeName ).getPreviewState(), [] ); const handleSendPreviewEmail = () => { @@ -66,33 +77,48 @@ function RawSendPreviewEmail() { > { sendingPreviewStatus === SendingPreviewStatus.ERROR ? (
+ { __( + 'Sorry, we were unable to send this email.', + 'mailpoet' + ) } +
+ + + { errorMessage && + sprintf( + // translators: %s is an error message. + __( 'Error: %s', 'mailpoet' ), + errorMessage + ) } + +