mailtrap-sdk
v1.0.1
Published
SDK client for Mailtrap. Here is link to API documentation [Mailtrap](https://api-docs.mailtrap.io/docs/mailtrap-api-docs/5tjdeg9545058-mailtrap-api)
Downloads
2
Readme
mailtrap-sdk
SDK client for Mailtrap. Here is link to API documentation Mailtrap
Usage example:
Install
npm i mailtrap-sdk
Code
import { MailtrapSDK } from 'mailtrap-sdk'
const accessToken = '<YOUR_TOKEN_HERE>'
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()