The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/apps/meteor/app/livechat/server/hooks/offlineMessage.ts

26 lines
589 B

import { callbacks } from '../../../../lib/callbacks';
import { settings } from '../../../settings/server';
import { Livechat } from '../lib/LivechatTyped';
callbacks.add(
'livechat.offlineMessage',
async (data) => {
if (!settings.get('Livechat_webhook_on_offline_msg')) {
return data;
}
const postData = {
type: 'LivechatOfflineMessage',
sentAt: new Date(),
visitor: {
name: data.name,
email: data.email,
},
message: data.message,
};
await Livechat.sendRequest(postData);
},
callbacks.priority.MEDIUM,
'livechat-send-email-offline-message',
);