From 4ea2e4829e604009fc9c449bd44aab4f20e16e6a Mon Sep 17 00:00:00 2001 From: "J.-S. Caux" <J.S.Caux@uva.nl> Date: Fri, 23 Oct 2020 19:27:38 +0200 Subject: [PATCH] Auto-fill From field in message composer if account is selected --- .../apimail/assets/vue/components/MessageComposer.vue | 6 ++++-- .../static/apimail/assets/vue/components/MessagesTable.vue | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/apimail/static/apimail/assets/vue/components/MessageComposer.vue b/apimail/static/apimail/assets/vue/components/MessageComposer.vue index 341848109..17cc1bdbe 100644 --- a/apimail/static/apimail/assets/vue/components/MessageComposer.vue +++ b/apimail/static/apimail/assets/vue/components/MessageComposer.vue @@ -457,6 +457,10 @@ export default { }, mounted () { this.fetchCurrentAccounts() + if (this.accountSelected) { + this.form.from_account = this.accountSelected.pk + this.form.headers_added['Reply-To'] = this.accountSelected.email + } if (this.draftmessage) { this.currentdraft_uuid = this.draftmessage.uuid this.form.from_account = this.draftmessage.from_account @@ -468,9 +472,7 @@ export default { this.form.attachments = this.draftmessage.attachment_files } else if (this.originalmessage) { - this.form.from_account = this.accountSelected.pk this.form.body_html = ('<br><br><blockquote>') - this.form.headers_added['Reply-To'] = this.accountSelected.email this.form.headers_added['In-Reply-To'] = this.originalmessage.data['Message-Id'] if (this.originalmessage.data['References']) { this.form.headers_added['References'] = ( diff --git a/apimail/static/apimail/assets/vue/components/MessagesTable.vue b/apimail/static/apimail/assets/vue/components/MessagesTable.vue index d91314bdb..b6c54863e 100644 --- a/apimail/static/apimail/assets/vue/components/MessagesTable.vue +++ b/apimail/static/apimail/assets/vue/components/MessagesTable.vue @@ -18,7 +18,10 @@ no-close-on-escape no-close-on-backdrop > - <message-composer></message-composer> + <message-composer + :accountSelected="accountSelected" + > + </message-composer> <template v-slot:modal-footer="{ close, }"> <b-button variant="danger" class="px-2 py-1" @click="close()"> Close -- GitLab