Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/narekhovhannisyan/mailtrap-client
- Owner: narekhovhannisyan
- Created: 2023-07-04T11:10:58.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-12-18T21:31:59.000Z (11 months ago)
- Last Synced: 2024-09-22T22:39:27.065Z (about 2 months ago)
- Topics: client, mailtrap, mailtrap-io, sdk
- Language: TypeScript
- Homepage: https://mailtrap.io/
- Size: 67.4 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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 = 0const 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)