Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/narekhovhannisyan/mailtrap-client

Challenge: Client for Mailtrap testing API.
https://github.com/narekhovhannisyan/mailtrap-client

client mailtrap mailtrap-io sdk

Last synced: 8 days ago
JSON representation

Challenge: Client for Mailtrap testing API.

Awesome Lists containing this project

README

        

# mailtrap-sdk

SDK client for Mailtrap. Here is link to API documentation [Mailtrap](https://api-docs.mailtrap.io/docs/mailtrap-api-docs/5tjdeg9545058-mailtrap-api)

## Usage example:

### Install

```
npm i mailtrap-sdk
```

### Code

```ts
import { MailtrapSDK } from 'mailtrap-sdk'

const accessToken = ''
const testInboxId = 0

const client = new MailtrapSDK({
accessToken,
testInboxId
})

const test = async () => {
try {
await client.send({
sender: {
email: '[email protected]',
name: 'sender'
},
recipient: {
email: '[email protected]',
name: 'recipient'
},
subject: 'mock-subject',
text: 'Mock text'
})
} catch (error) {
console.error(error)
}
}
test()

```

# Table of Contents

* [Contributing](doc/CONTRIBUTING.md)
* [Install](doc/INSTALL.md)
* [Test](doc/TEST.md)
* [Test Scripts](doc/TEST.md#test-scripts)