mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Fixed sending email preview from post preview modal
refs https://github.com/TryGhost/Team/issues/459 - fixed incorrect tracked variable name for the email preview address - fixed incorrect access of `this.post` instead of `this.args.post` - re-throw any error that is encountered so the cause is not silently lost
This commit is contained in:
parent
b3980142ca
commit
28a2ff8259
1 changed files with 5 additions and 6 deletions
|
@ -27,14 +27,12 @@ export default class ModalPostPreviewEmailComponent extends Component {
|
||||||
|
|
||||||
@tracked html = '';
|
@tracked html = '';
|
||||||
@tracked subject = '';
|
@tracked subject = '';
|
||||||
@tracked emailPreviewAddress = '';
|
@tracked previewEmailAddress = '';
|
||||||
@tracked sendPreviewEmailError = '';
|
@tracked sendPreviewEmailError = '';
|
||||||
|
|
||||||
get mailgunIsEnabled() {
|
get mailgunIsEnabled() {
|
||||||
return this.config.get('mailgunIsConfigured') ||
|
return this.config.get('mailgunIsConfigured') ||
|
||||||
this.settings.get('mailgunApiKey') &&
|
!!(this.settings.get('mailgunApiKey') && this.settings.get('mailgunDomain') && this.settings.get('mailgunBaseUrl'));
|
||||||
this.settings.get('mailgunDomain') &&
|
|
||||||
this.settings.get('mailgunBaseUrl');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@action
|
@action
|
||||||
|
@ -53,8 +51,8 @@ export default class ModalPostPreviewEmailComponent extends Component {
|
||||||
@task({drop: true})
|
@task({drop: true})
|
||||||
*sendPreviewEmailTask() {
|
*sendPreviewEmailTask() {
|
||||||
try {
|
try {
|
||||||
const resourceId = this.post.id;
|
const resourceId = this.args.post.id;
|
||||||
const testEmail = this.emailPreviewAddress.trim();
|
const testEmail = this.previewEmailAddress.trim();
|
||||||
|
|
||||||
if (!validator.isEmail(testEmail)) {
|
if (!validator.isEmail(testEmail)) {
|
||||||
this.sendPreviewEmailError = 'Please enter a valid email';
|
this.sendPreviewEmailError = 'Please enter a valid email';
|
||||||
|
@ -86,6 +84,7 @@ export default class ModalPostPreviewEmailComponent extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.sendPreviewEmailError = message;
|
this.sendPreviewEmailError = message;
|
||||||
|
throw error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue