Subscribe to receiving events. Receive real-time notifications when messages arrive, security issues are detected, or agents are triggered.
Nuntly emits webhook events for receiving activity so your application can react in real time. You subscribe to these events through the same webhook configuration used for sending events.
Emitted when a received message fails one or more security checks (SPF, DKIM, or spam). The message is stored and the thread is marked as spam. Virus-infected emails are rejected at the gateway and never reach this stage.
Use the same signature verification flow as sending events. See handle webhook events for the full implementation pattern.Here is a condensed example handling receiving events:
// Inside your webhook handler (after signature verification)const event = JSON.parse(payload);switch (event.type) { case 'message.received': console.log(`New message from ${event.data.from}: ${event.data.subject}`); break; case 'message.security.flagged': console.log(`Flagged message from ${event.data.from}: ${event.data.subject}`); break; case 'message.agent.triggered': console.log(`Agent ${event.data.agentId} triggered for message ${event.data.messageId}`); // Trigger your AI agent processing break; case 'message.sent': console.log(`Message sent to ${event.data.toAddresses.map(a => a.address).join(', ')}`); break;}