Recieving both eventType and notificationType from Amazon SNS

36 Views Asked by At

I have configured Amazon SNS event publishing to get email's Open, Click, Bounce, Complaint events.

In documentation Amazon says after setting it up I will get a JSON object with eventType and other fields.

Problem is that I am getting both event and notification JSON objects to the same endpoint that I have configured for event publishing.

There are 2 requests coming to my configured endpoint

  • eventType-Bounce
  • notificationType-Bounce

Example for eventType-Bounce:

{
   "Type":"Notification",
   "MessageId":"someMessageID",
   "TopicArn":"arn:aws:sns:eu-west-1:someId:ses-bounces-topic",
   "Subject":"Amazon SES Email Event Notification",
   "Message":"{\"eventType\":\"Bounce\",\"bounce\".......

Example for notificationType-Bounce:

{
    "Type": "Notification",
    "MessageId": "someMessageID",
    "TopicArn": "arn:aws:sns:eu-west-1:someId:ses-bounces-topic",
    "Message": "{\"notificationType\":\"Bounce\",\"bounce\".......

MessageId is same for both objects which means it is sending 2 event for 1 email.

In Documentation it says eventType can be named as notificationType if you didn't set up event publishing which I did:

enter image description here

0

There are 0 best solutions below