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/app/livechat/server/hooks/offlineMessage.js

21 lines
537 B

import { callbacks } from '../../../callbacks';
import { settings } from '../../../settings';
import { Livechat } from '../lib/Livechat';
callbacks.add('livechat.offlineMessage', (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,
};
Livechat.sendRequest(postData);
}, callbacks.priority.MEDIUM, 'livechat-send-email-offline-message');