From 693216c29ed248d0d1650d7791509bf3926742ab Mon Sep 17 00:00:00 2001 From: Simon Backx Date: Fri, 20 Jan 2023 18:36:33 +0100 Subject: [PATCH] Improved failed email error messages refs https://ghost.slack.com/archives/C02G9E68C/p1673570945616369?thread_ts=1672700158.659209&cid=C02G9E68C Fixed a typo in the error messages and made the errors more clear. Also hide the email configuration part when there is no email configuration. --- .../editor/modals/publish-flow/complete-with-email-error.hbs | 4 +++- .../editor/modals/publish-flow/complete-with-email-error.js | 2 ++ ghost/email-service/lib/batch-sending-service.js | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ghost/admin/app/components/editor/modals/publish-flow/complete-with-email-error.hbs b/ghost/admin/app/components/editor/modals/publish-flow/complete-with-email-error.hbs index 7555be3294..ee39f5731f 100644 --- a/ghost/admin/app/components/editor/modals/publish-flow/complete-with-email-error.hbs +++ b/ghost/admin/app/components/editor/modals/publish-flow/complete-with-email-error.hbs @@ -11,8 +11,10 @@

{{this.emailErrorMessage}} + {{#unless this.config.mailgunIsConfigured}}

- Please verify your email settings if the error persists. + If the error persists, please verify your email settings. + {{/unless}}

{{#if this.retryErrorMessage}} diff --git a/ghost/admin/app/components/editor/modals/publish-flow/complete-with-email-error.js b/ghost/admin/app/components/editor/modals/publish-flow/complete-with-email-error.js index 75d4a271f6..a1264748c1 100644 --- a/ghost/admin/app/components/editor/modals/publish-flow/complete-with-email-error.js +++ b/ghost/admin/app/components/editor/modals/publish-flow/complete-with-email-error.js @@ -2,6 +2,7 @@ import Component from '@glimmer/component'; import EmailFailedError from 'ghost-admin/errors/email-failed-error'; import {CONFIRM_EMAIL_MAX_POLL_LENGTH, CONFIRM_EMAIL_POLL_LENGTH} from '../../publish-management'; import {htmlSafe} from '@ember/template'; +import {inject} from 'ghost-admin/decorators/inject'; import {isServerUnreachableError} from 'ghost-admin/services/ajax'; import {task, timeout} from 'ember-concurrency'; import {tracked} from '@glimmer/tracking'; @@ -13,6 +14,7 @@ function isString(str) { export default class PublishFlowCompleteWithEmailError extends Component { @tracked newEmailErrorMessage; @tracked retryErrorMessage; + @inject config; get emailErrorMessage() { return this.newEmailErrorMessage || this.args.emailErrorMessage; diff --git a/ghost/email-service/lib/batch-sending-service.js b/ghost/email-service/lib/batch-sending-service.js index ba0baa42ec..65601f3d55 100644 --- a/ghost/email-service/lib/batch-sending-service.js +++ b/ghost/email-service/lib/batch-sending-service.js @@ -4,8 +4,8 @@ const errors = require('@tryghost/errors'); const tpl = require('@tryghost/tpl'); const messages = { - emailErrorPartialFailure: 'The email was only partially send', - emailError: 'Email failed to send' + emailErrorPartialFailure: 'An error occurred, and your newsletter was only partially sent. Please retry sending the remaining emails.', + emailError: 'An unexpected error occurred, please retry sending your newsletter.' }; /**