Amazon SES bounce reporting help

We are testing out Mautic and we have integrated it with Amazon SES. Once we send out the email Amazon hits the callback url, the responses are processed appropriately with one omission - the email_id is not saved to the lead_donotcontact table (the channel_id column). This means there is no bounce reporting etc which is a challenge for us.



Is anyone using Mautic + Amazon SES encountering this issue or is there a known work around?



I am on the latest version on mautic.



I submitted an issue on github but got no help.

We are testing out Mautic and we have integrated it with Amazon SES. Once we send out the email Amazon hits the callback url, the responses are processed appropriately with one omission - the email_id is not saved to the lead_donotcontact table (the channel_id column). This means there is no bounce reporting etc which is a challenge for us.

Is anyone using Mautic + Amazon SES encountering this issue or is there a known work around?

I am on the latest version on mautic.

I submitted an issue on github but got no help.

Yes I did, object returns properly but somehow Mautic does not retrieve the hashId from the response so as to populate that email_id column. So if you go to the contact you see that the bounced status has been applied, however from the stats in the email in itself there are no reports.

Hey @ozzy I get exactly what you are saying!

Would you happen to have an example of the returned data captured somewhere you can PM me?

Currently there is no lookup for which email caused the bounce / complaint. I’m looking to add this but my SES is still not completely setup so need some “real” data to see if there is something we can use to find the offending email.

Looking at the code, we just need to pass an array for the channel paramater, to the leadModel->addDncForLead() method call.

I did here issue it somehow slipped unnoticed.

@MarkLL I will PM you shortly. So In the AmazonTransport class, they have set a response structure required from the SNS object. But nowhere in the conditions that follow do they retrieve and set the hashIds

// Data structure that Mautic expects to be returned from this callback $rows = [ DoNotContact::BOUNCED => [ 'hashIds' => [], 'emails' => [], ], DoNotContact::UNSUBSCRIBED => [ 'hashIds' => [], 'emails' => [], ], ];

I did a small hack like the following in e.g. bounced condition:

[code]
// if bounce permanent in processJsonPayload method
$hashId = $this->retrieveHashId($message[‘mail’][‘source’]);
$rows[DoNotContact::BOUNCED][‘hashIds’][$hashId] = $message[‘bounce’][‘bouncedRecipients’][0][‘diagnosticCode’];

// get mautic email with hashId and return hashId
public function retrieveHashId($toEmail){
if (preg_match(‘#^(.?)+(.?)@(.*?)$#’, $toEmail, $parts)) {
if (strstr($parts[2], ‘‘)) {
// Has an ID hash so use it to find the lead
$words = explode(’
’, $parts[2]);
$hashId = array_pop($words);
return $hashId;
}
}

    return null;
}[/code]

However out of 3 bounces it only ever records the email_id for whichever one was the processed first and the rest are ignored.