I noticed today that when receiving a webhook from Sendgrid for Mail Activity, the payload is a JSON Array, not a JSON Object. This get’s received by SimpleQ fine, BUT, when the message is processed, the actual payload element sent to the subscriber is just an empty JSON Object. I tracked it down to the params being sent to the ‘deliver staticDSN message’ script.
To fix this, adjust the $params variable being send in both the ‘flush queue’ and ‘ban Retry’ scripts to this:
Let (
[
payload = MESSAGEQUEUE::message
; payload_json_type = JSONGetElementType ( payload ; "" )
; channel = MESSAGEQUEUE::channel
; message_object = JSONSetElement ( "{}"
; [ "payload" ; payload ; payload_json_type ]
; [ "channel" ; channel ; JSONString ]
)
]
;
JSONSetElement ( "{}" ;
[ "message" ; message_object ; JSONObject];
[ "listener.listener" ; SUBSCRIBER::listener ; JSONObject];
[ "listener.type" ; "staticDSN" ; JSONString ]
)
//Close Let
)
Hope this helps!