diff --git a/assets/js/src/newsletter_editor/components/save.js b/assets/js/src/newsletter_editor/components/save.js index cdbfe1631a..f620549896 100644 --- a/assets/js/src/newsletter_editor/components/save.js +++ b/assets/js/src/newsletter_editor/components/save.js @@ -249,13 +249,19 @@ Module.SaveView = Marionette.View.extend({ validateNewsletter: function (jsonObject) { var body = ''; var newsletter = App.getNewsletter(); + var content; if (!App._contentContainer.isValid()) { this.showValidationError(App._contentContainer.validationError); return; } if (jsonObject && jsonObject.body && jsonObject.body.content) { + content = jsonObject.body.content; body = JSON.stringify(jsonObject.body.content); + if (!content.blocks || !Array.isArray(content.blocks) || (content.blocks.length === 0)) { + this.showValidationError(MailPoet.I18n.t('newsletterIsEmpty')); + return; + } } if (App.getConfig().get('validation.validateUnsubscribeLinkPresent') && body.indexOf('[link:subscription_unsubscribe_url]') < 0 diff --git a/views/newsletter/editor.html b/views/newsletter/editor.html index 21ff08e274..9bd5cc53af 100644 --- a/views/newsletter/editor.html +++ b/views/newsletter/editor.html @@ -309,6 +309,7 @@ 'failedToFetchRenderedPosts': __('Failed to fetch rendered posts'), 'shortcodesWindowTitle': __('Select a shortcode'), 'unsubscribeLinkMissing': __('All emails must include an "Unsubscribe" link. Add a footer widget to your email to continue.'), + 'newsletterIsEmpty': __('Poet, please add prose to your masterpiece before you send it to your followers.'), 'emailAlreadySent': __('This email has already been sent. It can be edited, but not sent again. Duplicate this email if you want to send it again.'), 'automatedLatestContentMissing': _x('Please add an “Automatic Latest Content” widget to the email from the right sidebar.', '(Please reuse the current translation used for the string “Automatic Latest Content”) This Error message is displayed when a user tries to send a “Post Notification” email without any “Automatic Latest Content” widget inside'), 'newsletterPreviewEmailMissing': __('Enter an email address to send the preview newsletter to.'),