diff --git a/app/javascript/dashboard/components/widgets/WootWriter/Editor.vue b/app/javascript/dashboard/components/widgets/WootWriter/Editor.vue
index 09a256a94..f18adc418 100644
--- a/app/javascript/dashboard/components/widgets/WootWriter/Editor.vue
+++ b/app/javascript/dashboard/components/widgets/WootWriter/Editor.vue
@@ -23,6 +23,7 @@
@change="onFileChange"
/>
+
diff --git a/app/javascript/dashboard/components/widgets/conversation/MessageSignatureMissingAlert.vue b/app/javascript/dashboard/components/widgets/conversation/MessageSignatureMissingAlert.vue
new file mode 100644
index 000000000..81e4531af
--- /dev/null
+++ b/app/javascript/dashboard/components/widgets/conversation/MessageSignatureMissingAlert.vue
@@ -0,0 +1,28 @@
+
+
+
+ {{ $t('CONVERSATION.FOOTER.MESSAGE_SIGNATURE_NOT_CONFIGURED') }}
+
+ {{ $t('CONVERSATION.FOOTER.CLICK_HERE') }}
+
+
+
+
+
+
+
+
diff --git a/app/javascript/dashboard/components/widgets/conversation/ReplyBox.vue b/app/javascript/dashboard/components/widgets/conversation/ReplyBox.vue
index 870531444..dbe70c979 100644
--- a/app/javascript/dashboard/components/widgets/conversation/ReplyBox.vue
+++ b/app/javascript/dashboard/components/widgets/conversation/ReplyBox.vue
@@ -90,17 +90,9 @@
:remove-attachment="removeAttachment"
/>
-
-
- {{ $t('CONVERSATION.FOOTER.MESSAGE_SIGNATURE_NOT_CONFIGURED') }}
-
- {{ $t('CONVERSATION.FOOTER.CLICK_HERE') }}
-
-
-
+ />
+ >
+
+
+
+
+
+
+
{{ $t('NEW_CONVERSATION.FORM.MESSAGE.ERROR') }}
@@ -162,6 +182,7 @@ import Thumbnail from 'dashboard/components/widgets/Thumbnail.vue';
import WootMessageEditor from 'dashboard/components/widgets/WootWriter/Editor.vue';
import ReplyEmailHead from 'dashboard/components/widgets/conversation/ReplyEmailHead.vue';
import CannedResponse from 'dashboard/components/widgets/conversation/CannedResponse.vue';
+import MessageSignatureMissingAlert from 'dashboard/components/widgets/conversation/MessageSignatureMissingAlert';
import InboxDropdownItem from 'dashboard/components/widgets/InboxDropdownItem.vue';
import WhatsappTemplates from './WhatsappTemplates.vue';
import alertMixin from 'shared/mixins/alertMixin';
@@ -169,6 +190,11 @@ import { INBOX_TYPES } from 'shared/mixins/inboxMixin';
import { ExceptionWithMessage } from 'shared/helpers/CustomErrors';
import { getInboxSource } from 'dashboard/helper/inbox';
import { required, requiredIf } from 'vuelidate/lib/validators';
+import {
+ appendSignature,
+ removeSignature,
+} from 'dashboard/helper/editorHelper';
+import uiSettingsMixin from 'dashboard/mixins/uiSettings';
export default {
components: {
@@ -178,8 +204,9 @@ export default {
CannedResponse,
WhatsappTemplates,
InboxDropdownItem,
+ MessageSignatureMissingAlert,
},
- mixins: [alertMixin],
+ mixins: [alertMixin, uiSettingsMixin],
props: {
contact: {
type: Object,
@@ -219,7 +246,15 @@ export default {
uiFlags: 'contacts/getUIFlags',
conversationsUiFlags: 'contactConversations/getUIFlags',
currentUser: 'getCurrentUser',
+ messageSignature: 'getMessageSignature',
}),
+ sendWithSignature() {
+ const { send_with_signature: isEnabled } = this.uiSettings;
+ return isEnabled;
+ },
+ signatureToApply() {
+ return this.messageSignature;
+ },
emailMessagePayload() {
const payload = {
inboxId: this.targetInbox.id,
@@ -259,6 +294,14 @@ export default {
}
return this.inboxes.length === 0 && !this.uiFlags.isFetchingInboxes;
},
+ isSignatureEnabledForInbox() {
+ return this.isAnEmailInbox && this.sendWithSignature;
+ },
+ signatureToggleTooltip() {
+ return this.sendWithSignature
+ ? this.$t('CONVERSATION.FOOTER.DISABLE_SIGN_TOOLTIP')
+ : this.$t('CONVERSATION.FOOTER.ENABLE_SIGN_TOOLTIP');
+ },
inboxes() {
const inboxList = this.contact.contactableInboxes || [];
return inboxList.map(inbox => ({
@@ -298,8 +341,23 @@ export default {
this.showCannedResponseMenu = false;
}
},
+ targetInbox() {
+ this.setSignature();
+ },
+ },
+ mounted() {
+ this.setSignature();
},
methods: {
+ setSignature() {
+ if (this.messageSignature) {
+ if (this.isSignatureEnabledForInbox) {
+ this.message = appendSignature(this.message, this.signatureToApply);
+ } else {
+ this.message = removeSignature(this.message, this.signatureToApply);
+ }
+ }
+ },
onCancel() {
this.$emit('cancel');
},
@@ -370,6 +428,12 @@ export default {
);
return classByType;
},
+ toggleMessageSignature() {
+ this.updateUISettings({
+ send_with_signature: !this.sendWithSignature,
+ });
+ this.setSignature();
+ },
},
};