Pre-filled email address input in post preview modal for current user

no issue

- when viewing the email preview in the post preview modal having your email address pre-filled makes sending yourself an email preview much quicker as there's no need to type anything
This commit is contained in:
Kevin Ansfield 2021-03-10 09:35:10 +00:00
parent a274ac3912
commit a8abc3a366
2 changed files with 8 additions and 1 deletions

View File

@ -12,7 +12,7 @@
<div class="gh-post-preview-email-footer">
<span class="mr3 nowrap fw6 f8 darkgrey">Send a test newsletter</span>
<div class="gh-post-preview-email-input {{if this.sendPreviewEmailError "error"}}">
<div class="gh-post-preview-email-input {{if this.sendPreviewEmailError "error"}}" {{did-insert this.initPreviewEmailAddress}}>
<Input
@value={{this.previewEmailAddress}}
class="gh-input gh-post-preview-email-input"

View File

@ -23,6 +23,7 @@ export default class ModalPostPreviewEmailComponent extends Component {
@service ajax;
@service config;
@service ghostPaths;
@service session;
@service settings;
@tracked html = '';
@ -48,6 +49,12 @@ export default class ModalPostPreviewEmailComponent extends Component {
}
}
@action
async initPreviewEmailAddress() {
const user = await this.session.user;
this.previewEmailAddress = user.email;
}
@task({drop: true})
*sendPreviewEmailTask() {
try {