mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-02 12:08:01 +00:00
feat: Event to capture the message signature feature (#7760)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
This commit is contained in:
@@ -725,6 +725,15 @@ export default {
|
|||||||
this.sendMessage(messagePayload);
|
this.sendMessage(messagePayload);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
sendMessageAnalyticsData(isPrivate) {
|
||||||
|
// Analytics data for message signature is enabled or not in channels
|
||||||
|
return isPrivate
|
||||||
|
? this.$track(CONVERSATION_EVENTS.SENT_PRIVATE_NOTE)
|
||||||
|
: this.$track(CONVERSATION_EVENTS.SENT_MESSAGE, {
|
||||||
|
channelType: this.channelType,
|
||||||
|
signatureEnabled: this.sendWithSignature,
|
||||||
|
});
|
||||||
|
},
|
||||||
async onSendReply() {
|
async onSendReply() {
|
||||||
const undefinedVariables = getUndefinedVariablesInMessage({
|
const undefinedVariables = getUndefinedVariablesInMessage({
|
||||||
message: this.message,
|
message: this.message,
|
||||||
@@ -758,6 +767,7 @@ export default {
|
|||||||
bus.$emit(BUS_EVENTS.SCROLL_TO_MESSAGE);
|
bus.$emit(BUS_EVENTS.SCROLL_TO_MESSAGE);
|
||||||
bus.$emit(BUS_EVENTS.MESSAGE_SENT);
|
bus.$emit(BUS_EVENTS.MESSAGE_SENT);
|
||||||
this.removeFromDraft();
|
this.removeFromDraft();
|
||||||
|
this.sendMessageAnalyticsData(messagePayload.private);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const errorMessage =
|
const errorMessage =
|
||||||
error?.response?.data?.error || this.$t('CONVERSATION.MESSAGE_ERROR');
|
error?.response?.data?.error || this.$t('CONVERSATION.MESSAGE_ERROR');
|
||||||
|
|||||||
@@ -10,8 +10,6 @@ import {
|
|||||||
isOnUnattendedView,
|
isOnUnattendedView,
|
||||||
} from './helpers/actionHelpers';
|
} from './helpers/actionHelpers';
|
||||||
import messageReadActions from './actions/messageReadActions';
|
import messageReadActions from './actions/messageReadActions';
|
||||||
import AnalyticsHelper from '../../../helper/AnalyticsHelper';
|
|
||||||
import { CONVERSATION_EVENTS } from '../../../helper/AnalyticsHelper/events';
|
|
||||||
import messageTranslateActions from './actions/messageTranslateActions';
|
import messageTranslateActions from './actions/messageTranslateActions';
|
||||||
// actions
|
// actions
|
||||||
const actions = {
|
const actions = {
|
||||||
@@ -250,11 +248,6 @@ const actions = {
|
|||||||
status: MESSAGE_STATUS.PROGRESS,
|
status: MESSAGE_STATUS.PROGRESS,
|
||||||
});
|
});
|
||||||
const response = await MessageApi.create(pendingMessage);
|
const response = await MessageApi.create(pendingMessage);
|
||||||
AnalyticsHelper.track(
|
|
||||||
pendingMessage.private
|
|
||||||
? CONVERSATION_EVENTS.SENT_PRIVATE_NOTE
|
|
||||||
: CONVERSATION_EVENTS.SENT_MESSAGE
|
|
||||||
);
|
|
||||||
commit(types.ADD_MESSAGE, {
|
commit(types.ADD_MESSAGE, {
|
||||||
...response.data,
|
...response.data,
|
||||||
status: MESSAGE_STATUS.SENT,
|
status: MESSAGE_STATUS.SENT,
|
||||||
|
|||||||
Reference in New Issue
Block a user