# Hey Mark, the very basic object from SNS

**URL:** https://forum.mautic.org/t/hey-mark-the-very-basic-object-from-sns/7428
**Category:** Product Support
**Created:** [February 8, 2017, 4:03am UTC](https://forum.mautic.org/t/hey-mark-the-very-basic-object-from-sns/7428 "2017-02-08T04:03:27Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![ozzy](https://avatars.discourse-cdn.com/v4/letter/o/b5e925/32.png) [@ozzy](https://forum.mautic.org/u/ozzy)
#### Post date: [February 8, 2017, 4:03am UTC](https://forum.mautic.org/t/hey-mark-the-very-basic-object-from-sns/7428/1 "2017-02-08T04:03:27Z")

</div>

Code:

$payload = \<\<\<PAYLOAD { "Type" : "Notification", "MessageId" : "7c2d7069-7db3-53c8-87d0-20476a630fb6", "TopicArn" : "arn:aws:sns:eu-west-1:918057160339:55hubs-mautic-test", "Message" : "{"notificationType":"Bounce","bounce":{"bounceType":"Permanent","bounceSubType":"General","bouncedRecipients":[{"emailAddress":"suppressionlist@simulator.amazonses.com","action":"failed","status":"5.1.1","diagnosticCode":"smtp; 550 5.1.1 : Recipient address rejected: User unknown in virtual alias table"}],"timestamp":"2016-08-17T07:43:12.776Z","feedbackId":"0102015697743d4c-619f1aa8-763f-4bea-8648-0b3bbdedd1ea-000000","reportingMTA":"dsn; a4-24.smtp-out.eu-west-1.amazonses.com"},"mail":{"timestamp":"2016-08-17T07:43:11.000Z","source":"bounce+bounce\_586c9783397f4@testsolution.co.za","sourceArn":"arn:aws:ses:eu-west-1:918057160339:identity/nope.com","sendingAccountId":"918057160339","messageId":"010201569774384f-81311784-10dd-48a8-921f-8316c145e64d-000000","destination":["nope@nope.com"]}}", "Timestamp" : "2016-08-17T07:43:12.822Z", "SignatureVersion" : "1", "Signature" : "GNWnMWfKx1PPDjUstq2Ln13+AJWEK/Qo8YllYC7dGSlPhC5nClop5+vCj0CG2XN7aN41GhsJJ1e+F4IiRxm9v2wwua6BC3mtykrXEi8VeGy2HuetbF9bEeBEPbtbeIyIXJhdPDhbs4anPJwcEiN/toCoANoPWJ3jyVTOaUAxJb2oPTrvmjMxMpVE59sSo7Mz2+pQaUJl3ma0UgAC/lrYghi6n4cwlDTfbbIW+mbV7/d/5YN/tjL9/sD3DOuf+1PpFFTPsOVseZWV8PQ0/MWB2BOrKOKQyF7msLNX5iTkmsvRrbYULPvpbx32LsIxfNVFZJmsnTe2/6EGaAXf3TVPZA==", "SigningCertURL" : "https://sns.eu-west-1.amazonaws.com/SimpleNotificationService-bb750dd426d95ee9390147a5624348ee.pem", "UnsubscribeURL" : "https://sns.eu-west-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:eu-west-1:918057160339:nope:1cddd2a6-bfa8-4eb5-b2b2-a7833eb5db9b" } PAYLOAD;

---

<div class="post-metadata">

### Author: ![ozzy](https://avatars.discourse-cdn.com/v4/letter/o/b5e925/32.png) [@ozzy](https://forum.mautic.org/u/ozzy)
#### Post date: [February 8, 2017, 4:03am UTC](https://forum.mautic.org/t/hey-mark-the-very-basic-object-from-sns/7428/2 "2017-02-08T04:03:27Z")

</div>

`$payload = <<<PAYLOAD
{
  "Type" : "Notification",
  "MessageId" : "7c2d7069-7db3-53c8-87d0-20476a630fb6",
  "TopicArn" : "arn:aws:sns:eu-west-1:918057160339:55hubs-mautic-test",
  "Message" : "{"notificationType":"Bounce","bounce":{"bounceType":"Permanent","bounceSubType":"General","bouncedRecipients":[{"emailAddress":"suppressionlist@simulator.amazonses.com","action":"failed","status":"5.1.1","diagnosticCode":"smtp; 550 5.1.1 <nope@nope.com>: Recipient address rejected: User unknown in virtual alias table"}],"timestamp":"2016-08-17T07:43:12.776Z","feedbackId":"0102015697743d4c-619f1aa8-763f-4bea-8648-0b3bbdedd1ea-000000","reportingMTA":"dsn; a4-24.smtp-out.eu-west-1.amazonses.com"},"mail":{"timestamp":"2016-08-17T07:43:11.000Z","source":"bounce+bounce_586c9783397f4@testsolution.co.za","sourceArn":"arn:aws:ses:eu-west-1:918057160339:identity/nope.com","sendingAccountId":"918057160339","messageId":"010201569774384f-81311784-10dd-48a8-921f-8316c145e64d-000000","destination":["nope@nope.com"]}}",
  "Timestamp" : "2016-08-17T07:43:12.822Z",
  "SignatureVersion" : "1",
  "Signature" : "GNWnMWfKx1PPDjUstq2Ln13+AJWEK/Qo8YllYC7dGSlPhC5nClop5+vCj0CG2XN7aN41GhsJJ1e+F4IiRxm9v2wwua6BC3mtykrXEi8VeGy2HuetbF9bEeBEPbtbeIyIXJhdPDhbs4anPJwcEiN/toCoANoPWJ3jyVTOaUAxJb2oPTrvmjMxMpVE59sSo7Mz2+pQaUJl3ma0UgAC/lrYghi6n4cwlDTfbbIW+mbV7/d/5YN/tjL9/sD3DOuf+1PpFFTPsOVseZWV8PQ0/MWB2BOrKOKQyF7msLNX5iTkmsvRrbYULPvpbx32LsIxfNVFZJmsnTe2/6EGaAXf3TVPZA==",
  "SigningCertURL" : "https://sns.eu-west-1.amazonaws.com/SimpleNotificationService-bb750dd426d95ee9390147a5624348ee.pem",
  "UnsubscribeURL" : "https://sns.eu-west-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:eu-west-1:918057160339:nope:1cddd2a6-bfa8-4eb5-b2b2-a7833eb5db9b"
}
PAYLOAD;`

---

<div class="post-metadata">

### Author: ![ozzy](https://avatars.discourse-cdn.com/v4/letter/o/b5e925/32.png) [@ozzy](https://forum.mautic.org/u/ozzy)
#### Post date: [February 8, 2017, 4:03am UTC](https://forum.mautic.org/t/hey-mark-the-very-basic-object-from-sns/7428/3 "2017-02-08T04:03:56Z")

</div>

I honestly suspect mautic is not retrieving the hashIds

---

<div class="post-metadata">

### Author: ![MarkLL](https://avatars.discourse-cdn.com/v4/letter/m/d9b06d/32.png) [@MarkLL](https://forum.mautic.org/u/MarkLL)
#### Post date: [February 8, 2017, 4:09am UTC](https://forum.mautic.org/t/hey-mark-the-very-basic-object-from-sns/7428/4 "2017-02-08T04:09:06Z")

</div>

not via webhooks anyway.

---

<div class="post-metadata">

### Author: ![MarkLL](https://avatars.discourse-cdn.com/v4/letter/m/d9b06d/32.png) [@MarkLL](https://forum.mautic.org/u/MarkLL)
#### Post date: [February 8, 2017, 4:13am UTC](https://forum.mautic.org/t/hey-mark-the-very-basic-object-from-sns/7428/5 "2017-02-08T04:13:48Z")

</div>

From the response above, I’m guessing it will come from `bounce_586c9783397f4` otherwise SES does not appear to include the hash. which it appears your code is using.

---

<div class="post-metadata">

### Author: ![MarkLL](https://avatars.discourse-cdn.com/v4/letter/m/d9b06d/32.png) [@MarkLL](https://forum.mautic.org/u/MarkLL)
#### Post date: [February 8, 2017, 4:16am UTC](https://forum.mautic.org/t/hey-mark-the-very-basic-object-from-sns/7428/6 "2017-02-08T04:16:28Z")

</div>

Inside `app/bundles/EmailBundle/Model/EmailModel.php:setDoNotContact()` is called if the HashID is used and that should record the correct email.

So If you find the HashID, use that, else add it to the email array would appear to be the way to go…

---

<div class="post-metadata">

### Author: ![MarkLL](https://avatars.discourse-cdn.com/v4/letter/m/d9b06d/32.png) [@MarkLL](https://forum.mautic.org/u/MarkLL)
#### Post date: [February 8, 2017, 4:27am UTC](https://forum.mautic.org/t/hey-mark-the-very-basic-object-from-sns/7428/7 "2017-02-08T04:27:37Z")

</div>

It also seems to be important that each user gets there own copy of the email. eg. won’t work for multiple recipients. But I think that’s how Mautic does it.

My SES is still in the sand box and I don’t have a public install of Mautic yet so it’s a bit hard to test. I’m writing a generic webhook listener in Laravel/Lumen to run some tests. Just not quite ready yet 🙂

---

<div class="post-metadata">

### Author: ![ozzy](https://avatars.discourse-cdn.com/v4/letter/o/b5e925/32.png) [@ozzy](https://forum.mautic.org/u/ozzy)
#### Post date: [February 8, 2017, 4:43am UTC](https://forum.mautic.org/t/hey-mark-the-very-basic-object-from-sns/7428/8 "2017-02-08T04:43:11Z")

</div>

I’ll try what you suggested and let you know, thanks.
