Closed jameskbride closed 3 months ago
Hi @janjaali! Thanks for creating sendGrid-mock 😄 Let me know what you think of this PR; it would be great to be able to test event webhook integration with basic support for delivered
events.
Hi @jameskbride, thanks for your contribution. I didn't have this weekend a chance to look into your PR. Trying to have a look this week.
Looks great! Would you be so kind and add some words about this new feature in https://github.com/jameskbride/sendgrid-mock/blob/be2894273b91b069600f209c2d724e57dc0be5da/README.md#L30?
Done, thanks @janjaali!
Released with https://github.com/janjaali/sendGrid-mock/releases/tag/v1.10.0. Thanks again for your contribution!
Awesome, appreciate the quick release!
This PR adds the ability to send
delivered
events to a user-defined webhook.Context
Sendgrid has the ability to send events to a user-specified webhook. These events can be used to indicate if a message has been delivered, processed, dropped, bounced, etc. It would be useful during development to have the
delivered
events sent to a webhook to be able to test the webhook integration.Changes
EVENT_DELIVERY_URL
. When this environment variable is set sendgrid-mock will senddelivered
events to the specified URL whenaddMail()
is called.axios
as a dependency, which is used to send the event to a webhook.delivered
event.Testing
Use the following Python script to start a mini test server:
EVENT_DELIVERY_URL
set:v3/mail/send
:EVENT_DELIVERY_URL
set.v3/mail/send
.Out of Scope
delivered
. We would need to have some condition (or randomness?) to know when to return other Sendgrid-supported events.