How to use the postmark.AccountClient function in postmark

To help you get started, we’ve selected a few postmark examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wildbit / postmark-cli / src / commands / servers / list.ts View on Github external
const listCommand = (accountToken: string, args: ServerListArguments): void => {
  const { count, offset, name, showTokens, requestHost } = args
  const command: CommandResponse = new CommandResponse()
  command.initResponse('Fetching servers...')
  const client = new AccountClient(accountToken)
  if (requestHost !== undefined && requestHost !== '') {
    client.clientOptions.requestHost = requestHost
  }

  getServers(client, count, offset, name)
    .then(response => {
      if (args.json) {
        return command.response(serverJson(response, showTokens))
      }

      return command.response(serverTable(response, showTokens))
    })
    .catch(error => {
      return command.errorResponse(error)
    })
}

postmark

Official Node.js client library for the Postmark HTTP API - https://www.postmarkapp.com

MIT
Latest version published 1 month ago

Package Health Score

80 / 100
Full package analysis