-
Notifications
You must be signed in to change notification settings - Fork 33
Suppressions
Igor Balos edited this page Feb 3, 2020
·
1 revision
You can easily manage suppression email addresses with suppressions API.
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.
const serverToken = "xxxx-xxxxx-xxxx-xxxxx-xxxxxx"
let postmark = require("postmark")
let client = new postmark.ServerClient(serverToken);
To retrieve suppressions, all you need to do is get suppressions with client for a specific message stream.
const messageStream = 'outbound'
client.getSuppressions(messageStream).then( result => {
console.log(result.Suppressions[0].EmailAddress);
});
client.createSuppressions('outbound', {
Suppressions: [
{EmailAddress: '[email protected]'},
{EmailAddress: '[email protected]'},
{EmailAddress: '[email protected]'}]
}).then( result => {
console.log(result.Suppressions[0].Status);
console.log(result.Suppressions[0].EmailAddress);
}).catch(error => {
console.log(error);
});
client.deleteSuppressions('outbound', {
Suppressions: [
{EmailAddress: '[email protected]'},
{EmailAddress: '[email protected]'},
{EmailAddress: '[email protected]'}]
}).then( result => {
console.log(result.Suppressions[0].Status);
console.log(result.Suppressions[0].EmailAddress);
console.log(result.Suppressions[0].Message);
});
For additional information about the capabilities of the Postmark API, see Postmark Developers Documentation.
- Overview
- Migration from older version
- Getting started
- Email sending
- Bounces
- Templates
- Templates Push
- Server
- Servers
- Message Streams
- Webhooks
- Messages
- Domains
- Sender Signatures
- Stats
- Trigger Inbound Rules
- Suppressions
- Data Removal
- Embedding images in emails
- Error Handling
- Handling Web Hooks
- Mocking requests
- Troubleshooting
- Known issues and how to resolve them