Closed jameskbride closed 3 months ago
Hi @janjaali, I have another events-related PR when you get a chance. This one adds event support for category
and custom_args
. Let me know what you think, and any feedback is welcome. Thanks!
Hii @jameskbride, thanks for your contribution. I will try to have a look this week.
Released with https://github.com/janjaali/sendGrid-mock/releases/tag/v1.12.0. Thanks for contribution 👍.
Released with https://github.com/janjaali/sendGrid-mock/releases/tag/v1.12.0. Thanks for contribution 👍.
Great, thanks @janjaali!
Context
78 previously added support for basic
delivered
events, but did not include commonly used properties such ascategory
andcustom_args
. This PR adds support for:category
from the sendcategories
custom_args
from the send request at the root levelcustom_args
from the send request at thepersonalization
levelChanges
categories
for/v3/mail/send
.custom_args
at the root level.custom_args
at thepersonalization
level.MailHandler.sendDeliveryEvents
function to apply these properties to events.Testing
Use the following Python script to start a mini server to receive events:
Start the application with the
EVENT_DELIVERY_URL
set:Categories
categories
:"category": []
property is received."categories": ["first", "second"]
property."category": ["first", "second"]
property is received.Custom Args
key3
property.smtp-id
is not the key specified in the root levelcustom_args
. This is a generated value.key1
,key2
,key with spaces
with values taken from thepersonalization
.v3/mail/send
requests can continue to be made withoutcustom_args
at either the root or personalization levels.