Files
inbound-email/services/webhookService.js
T
mherrlein 93f7d78c27
Docker / build (push) Canceled after 0s
Add webhook bearer token support
2026-09-02 15:17:05 +02:00

16 lines
354 B
JavaScript

const axios = require('axios');
const config = require('../config');
function sendToWebhook(data) {
const headers = config.WEBHOOK_BEARER_TOKEN
? { Authorization: `Bearer ${config.WEBHOOK_BEARER_TOKEN}` }
: undefined;
return axios.post(config.WEBHOOK_URL, data, {
timeout: 5000,
headers
});
}
module.exports = { sendToWebhook };