fix: message signature
This commit is contained in:
parent
6ab1898992
commit
eb7503cb3e
@ -128,6 +128,8 @@ const newMessagePayload = () => {
|
|||||||
currentUser: props.currentUser,
|
currentUser: props.currentUser,
|
||||||
attachedFiles,
|
attachedFiles,
|
||||||
directUploadsEnabled: props.isDirectUploadsEnabled,
|
directUploadsEnabled: props.isDirectUploadsEnabled,
|
||||||
|
sendWithSignature: props.sendWithSignature,
|
||||||
|
messageSignature: props.messageSignature,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import { INBOX_TYPES } from 'dashboard/helper/inbox';
|
import { INBOX_TYPES } from 'dashboard/helper/inbox';
|
||||||
import { getInboxIconByType } from 'dashboard/helper/inbox';
|
import { getInboxIconByType } from 'dashboard/helper/inbox';
|
||||||
|
import { appendSignature } from 'dashboard/helper/editorHelper';
|
||||||
import camelcaseKeys from 'camelcase-keys';
|
import camelcaseKeys from 'camelcase-keys';
|
||||||
import ContactAPI from 'dashboard/api/contacts';
|
import ContactAPI from 'dashboard/api/contacts';
|
||||||
|
|
||||||
@ -129,12 +130,29 @@ export const prepareNewMessagePayload = ({
|
|||||||
currentUser,
|
currentUser,
|
||||||
attachedFiles = [],
|
attachedFiles = [],
|
||||||
directUploadsEnabled = false,
|
directUploadsEnabled = false,
|
||||||
|
sendWithSignature = false,
|
||||||
|
messageSignature = '',
|
||||||
}) => {
|
}) => {
|
||||||
|
let finalMessage = message;
|
||||||
|
if (sendWithSignature && messageSignature) {
|
||||||
|
const { signature_position, signature_separator } =
|
||||||
|
currentUser?.ui_settings || {};
|
||||||
|
const signatureSettings = {
|
||||||
|
position: signature_position || 'top',
|
||||||
|
separator: signature_separator || 'blank',
|
||||||
|
};
|
||||||
|
finalMessage = appendSignature(
|
||||||
|
message,
|
||||||
|
messageSignature,
|
||||||
|
signatureSettings
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
const payload = {
|
const payload = {
|
||||||
inboxId: targetInbox.id,
|
inboxId: targetInbox.id,
|
||||||
sourceId: targetInbox.sourceId,
|
sourceId: targetInbox.sourceId,
|
||||||
contactId: Number(selectedContact.id),
|
contactId: Number(selectedContact.id),
|
||||||
message: { content: message },
|
message: { content: finalMessage },
|
||||||
assigneeId: currentUser.id,
|
assigneeId: currentUser.id,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -1162,21 +1162,6 @@ export default {
|
|||||||
@play="recordingAudioState = 'playing'"
|
@play="recordingAudioState = 'playing'"
|
||||||
@pause="recordingAudioState = 'paused'"
|
@pause="recordingAudioState = 'paused'"
|
||||||
/>
|
/>
|
||||||
<div
|
|
||||||
v-if="shouldShowSignaturePreview && signaturePosition === 'top'"
|
|
||||||
class="signature-preview px-2 py-1 text-slate-500 dark:text-slate-400 text-sm opacity-70 select-none border-b border-slate-100 dark:border-slate-700"
|
|
||||||
>
|
|
||||||
<div class="text-xs text-slate-400 dark:text-slate-500 mb-1">
|
|
||||||
{{ $t('CONVERSATION.FOOTER.SIGNATURE_LABEL_TOP') }}
|
|
||||||
</div>
|
|
||||||
<div v-dompurify-html="formattedSignature" />
|
|
||||||
<div
|
|
||||||
v-if="signatureSeparator === '--'"
|
|
||||||
class="text-slate-400 dark:text-slate-500 mt-1"
|
|
||||||
>
|
|
||||||
{{ signatureSeparator }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<WootMessageEditor
|
<WootMessageEditor
|
||||||
v-model="message"
|
v-model="message"
|
||||||
:editor-id="editorStateId"
|
:editor-id="editorStateId"
|
||||||
@ -1200,21 +1185,6 @@ export default {
|
|||||||
@toggle-variables-menu="toggleVariablesMenu"
|
@toggle-variables-menu="toggleVariablesMenu"
|
||||||
@clear-selection="clearEditorSelection"
|
@clear-selection="clearEditorSelection"
|
||||||
/>
|
/>
|
||||||
<div
|
|
||||||
v-if="shouldShowSignaturePreview && signaturePosition === 'bottom'"
|
|
||||||
class="signature-preview px-2 py-1 mt-2 text-slate-500 dark:text-slate-400 text-sm opacity-70 select-none border-t border-slate-100 dark:border-slate-700"
|
|
||||||
>
|
|
||||||
<div class="text-xs text-slate-400 dark:text-slate-500 mb-1">
|
|
||||||
{{ $t('CONVERSATION.FOOTER.SIGNATURE_LABEL_BOTTOM') }}
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
v-if="signatureSeparator === '--'"
|
|
||||||
class="text-slate-400 dark:text-slate-500 mb-1"
|
|
||||||
>
|
|
||||||
{{ signatureSeparator }}
|
|
||||||
</div>
|
|
||||||
<div v-dompurify-html="formattedSignature" />
|
|
||||||
</div>
|
|
||||||
<QuotedEmailPreview
|
<QuotedEmailPreview
|
||||||
v-if="shouldShowQuotedPreview"
|
v-if="shouldShowQuotedPreview"
|
||||||
:quoted-email-text="quotedEmailText"
|
:quoted-email-text="quotedEmailText"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user