MailSlurp allows the creation of email webhooks that forward emails, attachments, and new contacts directly to your server URL via HTTP/S POST. When a server responds with a 200 or 201 within 30 seconds the webhook is marked as successfully processed. If not the webhook is marked as unsuccessful and is put into a queue to be retried again every few minutes until successfully processed.

How can we test this process

Manual endpoint testing

We could use a tool like ngrok to create HTTP endpoints that redirect to a local server we are running.

Automated endpoint testing

For automated testing we can use MailSlurp library to setup real http endpoints that can respond with a set of responses we configure. This means we can simulate functional or non-functional webhooks and see how MailSlurp handles each.

Test webhook example

Let's see how to use the MailSlurp test webhooks library:

Testing failed webhooks

Now what about testing a failed result: