Reduced email error messages (#16183)

fixes https://github.com/TryGhost/Team/issues/2487
This commit is contained in:
Simon Backx 2023-01-25 13:20:50 +01:00 committed by GitHub
parent 4b0ca9399d
commit 17e0c0b856
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 1 deletions

View File

@ -67,6 +67,7 @@ export default class FeatureService extends Service {
@feature('webmentions') webmentions;
@feature('outboundLinkTagging') outboundLinkTagging;
@feature('webmentionEmail') webmentionEmail;
@feature('emailErrors') emailErrors;
_user = null;

View File

@ -252,6 +252,19 @@
</div>
</div>
</div>
<div class="gh-expandable-block">
<div class="gh-expandable-header">
<div>
<h4 class="gh-expandable-title">Show email errors</h4>
<p class="gh-expandable-description">
This makes email errors visible in the UI.
</p>
</div>
<div class="for-switch">
<GhFeatureFlag @flag="emailErrors" />
</div>
</div>
</div>
</div>
</div>
{{/if}}

View File

@ -1,4 +1,6 @@
const mega = require('../../../../../../services/mega');
const labs = require('../../../../../../../shared/labs');
const config = require('../../../../../../../shared/config');
module.exports = (model, frame) => {
const jsonModel = model.toJSON ? model.toJSON(frame.options) : model;
@ -13,5 +15,11 @@ module.exports = (model, frame) => {
);
});
if (!labs.isSet('emailErrors') && !!(config.get('bulkEmail') && config.get('bulkEmail').mailgun)) {
if (jsonModel.status === 'failed') {
jsonModel.status = 'submitted';
}
}
return jsonModel;
};

View File

@ -26,7 +26,8 @@ const GA_FEATURES = [
// NOTE: this allowlist is meant to be used to filter out any unexpected
// input for the "labs" setting value
const BETA_FEATURES = [
'activitypub'
'activitypub',
'emailErrors'
];
const ALPHA_FEATURES = [