how to check activation of email before sending it in Postmark

145 Views Asked by At

I create a project using Golang. and I have function to send emails that use Postmark . But I got this error "422 You tried to send to recipient(s) that have been marked as inactive. Found inactive addresses: .... . Inactive recipients are ones that have generated a hard bounce, a spam complaint, or a manual suppression.".

How can i check if the address is active or not, before try to send it ? . There is no mention of that on postmark documentation.

1

There are 1 best solutions below

0
Vadim Kononov On

Use Postmark's Suppression dump API.

/message-streams/{stream_id}/suppressions/dump

It doesn't give you the option to check one email at a time, but you can get the entire suppression list downloaded locally and check for inactive recipients offline.

Here's an example response from Postmark:

{  
  "Suppressions":[
    {  
      "EmailAddress":"[email protected]",
      "SuppressionReason":"ManualSuppression",
      "Origin": "Recipient",
      "CreatedAt":"2019-12-17T08:58:33-05:00"
    },
    {  
      "EmailAddress":"[email protected]",
      "SuppressionReason":"HardBounce",
      "Origin": "Recipient",
      "CreatedAt":"2019-12-17T08:58:33-05:00"
    },
    {  
      "EmailAddress":"[email protected]",
      "SuppressionReason":"SpamComplaint",
      "Origin": "Recipient",
      "CreatedAt":"2019-12-17T08:58:33-05:00"
    }
  ]
}