spatie / mailcoach-support

Questions and support for Mailcoach
https://mailcoach.app
31 stars 2 forks source link

SES-Feedback using 'notificationType' instead of 'eventType' #217

Closed jeffjacobsen closed 4 years ago

jeffjacobsen commented 4 years ago

I've seen this error a few times recently when trying to run ProcessSesWebhookJob:

ErrorException: Undefined index: eventType in /home/forge/patternjam.com/releases/20200620011533/vendor/spatie/laravel-mailcoach-ses-feedback/src/SesEvents/Click.php:11

Looking in the webhook_calls table, it appears that on a few occasions we have received a message that has a notificationType instead of an eventType:

"Message":"{\"notificationType\":\"Complaint\",\"complaint\":{\"complaintSubType\"...

If I manually edit the payload and change notificationType to eventType I can rerun the job in the queue. It's only happened about 50 times in over 17,000 feedback messages.

Is this due to something configured wrong at AWS, or is this something that ses-feedback could check for?

riasvdv commented 4 years ago

It's only happened about 50 times in over 17,000 feedback messages.

Could you check for me that those 50 are all complaints? AWS might just be using a different format for those

jeffjacobsen commented 4 years ago

They not only all seem to be complaints, but they all tend to be from only a few email providers (comcast.net, sbcglobal.net, aol.com) Complaints from others (such as gmail) are always in the correct format.

I've also noticed that in some cases there are 2 feedback messages coming together, with one in the correct format and one in the wrong format, but otherwise the same complaint, so it may be ok to just ignore any notifications without an eventType.

{"Type":"Notification","Message":"{\"notificationType\":\"Complaint\"...

{"Type":"Notification","Message":"{\"eventType\":\"Complaint\"...
riasvdv commented 4 years ago

Okay, we'll opt to ignoring messages without EventType then, thanks for helping us research, I've created an issue on the ses-feedback package to implement it https://github.com/spatie/laravel-mailcoach-ses-feedback/issues/11

riasvdv commented 4 years ago

Fixed in 2.2.1