-
Notifications
You must be signed in to change notification settings - Fork 71
Suppressions
Igor Balos edited this page Apr 7, 2020
·
3 revisions
For these API requests you will need to use a server API token. Once you obtain it, you will need to use server API client.
server_token = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
client = Postmark::ApiClient.new(server_token)
suppressions = client.dump_suppressions('outbound')
suppressions.first
# => {:email_address=>"[email protected]", :suppression_reason=>"HardBounce", :origin=>"Recipient", :created_at=>"2019-08-20T05:53:40-04:00"}
You can create new suppressions by providing a message stream on a server and array of email addresses to suppress.
client.create_suppressions('outbound', ['[email protected]', '[email protected]'])
# => [{:email_address=>"[email protected]", :status=>"Suppressed"}, {:email_address=>"[email protected]", :status=>"Suppressed"}]
client.delete_suppressions('outbound', ['[email protected]', '[email protected]'])
# => [{:email_address=>"[email protected]", :status=>"Deleted"}, {:email_address=>"[email protected]", :status=>"Deleted"}]
For additional information about the capabilities of the Postmark API, see Postmark Developers Documentation.
- Email sending
- Test email sending
- Bounces
- Templates
- Templates push
- Server
- Servers
- Message Streams
- Webhooks
- Messages
- Domains
- Sender Signatures
- Stats
- Trigger Tags
- Suppressions
- Data Removals
- Trigger Inbound Rules
- Parsing Inbound
- Using Postmark with Mail library
- Accessing Postmark Message ID
- Error Handling
- Integration Testing
- Troubleshooting
- Known issues and how to resolve them