# Parsing AWS SNS messages on Mautic

**URL:** <https://forum.mautic.org/t/parsing-aws-sns-messages-on-mautic/33192>\
**Category:** Product Support\
**Created:** [August 21, 2024, 11:01am UTC](https://forum.mautic.org/t/parsing-aws-sns-messages-on-mautic/33192 "2024-08-21T11:01:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jgomes\_87](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/jgomes_87/32/12636_2.png) [@jgomes\_87](https://forum.mautic.org/u/jgomes_87)\
**Post date:** [August 21, 2024, 11:01am UTC](https://forum.mautic.org/t/parsing-aws-sns-messages-on-mautic/33192/1 "2024-08-21T11:01:38Z")

</div>

**Your software**

- My Mautic version is: 5.1.0
- Using AWS SES and SNS
- Using the plugin [https://github.com/pabloveintimilla/mautic-amazon-ses](https://github.com/pabloveintimilla/mautic-amazon-ses)

**Your problem**  
Using this plugin, I’m trying to parse the payload that comes from an AWS SNS topic in Mautic to get the bounces/complaints and tag the contact with that info. However, according to the AWS documentation [https://docs.aws.amazon.com/ses/latest/dg/notification-contents.html](https://docs.aws.amazon.com/ses/latest/dg/notification-contents.html), the `notificationType` is the field that indicates whether it’s a bounce or a complaint. But it seems that this plugin is treating the type as “Notification,” and only inside the “Message” we have the “notificationType.”  
Has anyone here who is using this plugin faced this issue as well?  
Any thoughts about this topic?

**AWS payload**

{  
“Type”: “Notification”,  
“Message”: {  
“notificationType”: “Bounce”,  
“bounce”: {  
“feedbackId”: “0100019173f23467-c378b544-ae07-4410-9d46-fc2cb18c2c48-000000”,  
“bounceType”: “Permanent”,  
“bounceSubType”: “General”,  
“bouncedRecipients”: [  
{  
“emailAddress”: “[bounce@simulator.amazonses.com](mailto:bounce@simulator.amazonses.com)”,  
“action”: “failed”,  
“status”: “5.1.1”,  
“diagnosticCode”: “smtp; 550 5.1.1 user unknown”  
}  
],  
“timestamp”: “2024-08-21T07:58:58.000Z”,  
“remoteMtaIp”: “52.7.8.245”,  
“reportingMTA”: “dns; [a48-121.smtp-out.amazonses.com](http://a48-121.smtp-out.amazonses.com)”  
},  
“mail”: {  
“timestamp”: “2024-08-21T07:58:58.260Z”,  
“source”: “xxxx”,  
“sourceArn”: “xxxxx”,  
“sourceIp”: “94.63.xxx.xxx”,  
“callerIdentity”: “root”,  
“sendingAccountId”: “983084435241”,  
“messageId”: “0100019173f232d4-4d4c06b8-43cc-4cf8-84d3-df4cc745b33f-000000”,  
“destination”: [  
“[bounce@simulator.amazonses.com](mailto:bounce@simulator.amazonses.com)”  
],  
“headersTruncated”: false,  
“headers”: [  
{  
“name”: “From”,  
“value”: “xxxxx”  
},  
{  
“name”: “To”,  
“value”: “[bounce@simulator.amazonses.com](mailto:bounce@simulator.amazonses.com)”  
},  
{  
“name”: “Subject”,  
“value”: “xxxx”  
},  
{  
“name”: “MIME-Version”,  
“value”: “1.0”  
},  
{  
“name”: “Content-Type”,  
“value”: “multipart/alternative; boundary="----=\_Part\_266922\_295198094.1724227138260"”  
}  
],  
“commonHeaders”: {  
“from”: [  
“xxxx”  
],  
“to”: [  
“[bounce@simulator.amazonses.com](mailto:bounce@simulator.amazonses.com)”  
],  
“subject”: “xxxx”  
}  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [August 21, 2024, 3:32pm UTC](https://forum.mautic.org/t/parsing-aws-sns-messages-on-mautic/33192/2 "2024-08-21T15:32:56Z")

</div>

The plugin works for me.

`protected array $allowdTypes = ['Type', 'eventType', 'notificationType'];`

It is checking all kind of types.  
What is the error you are facing?

---

<div class="post-metadata">

**Author:** ![jgomes\_87](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/jgomes_87/32/12636_2.png) [@jgomes\_87](https://forum.mautic.org/u/jgomes_87)\
**Post date:** [August 21, 2024, 6:52pm UTC](https://forum.mautic.org/t/parsing-aws-sns-messages-on-mautic/33192/3 "2024-08-21T18:52:51Z")

</div>

“Actually, I’m not getting any error or exception; it’s just that bounces and complaints are being discarded because the plugin considers bounces and complaints as ‘Notification,’ and only within the ‘Message’ does it see the ‘NotificationType.’ Am I seeing this incorrectly?”

---

<div class="post-metadata">

**Author:** ![jgomes\_87](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/jgomes_87/32/12636_2.png) [@jgomes\_87](https://forum.mautic.org/u/jgomes_87)\
**Post date:** [August 21, 2024, 6:54pm UTC](https://forum.mautic.org/t/parsing-aws-sns-messages-on-mautic/33192/4 "2024-08-21T18:54:35Z")

</div>

by the way, what is the Mautic version that you have with this plugin?

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [August 23, 2024, 6:22am UTC](https://forum.mautic.org/t/parsing-aws-sns-messages-on-mautic/33192/5 "2024-08-23T06:22:14Z")

</div>

Hi, I’m using Mautic 5.03, Mautic 5.1 with this plugin.  
You can check my plugin as well, that I created when there was nothing better, check if that works for you:

> **[GitHub - jos0405/mauticawsmailer](https://github.com/jos0405/mauticawsmailer)**
>
> Contribute to jos0405/mauticawsmailer development by creating an account on GitHub.
