UNPKG

mandrill-inbound-parser

Version:
8 lines 288 B
exports.parse = function(inboundMsg) { if (inboundMsg.includes('mandrill_events%3D%5B%7B%22event%22%3A%22inbound')) { return decodeURIComponent(inboundMsg) .replace(/\+/g, ' ') .replace('mandrill_events=', ''); } return 'Not a valid inbound message from Mandrill'; }