Skip to content

Commit ffeca33

Browse files
authored
update readme
update readme
2 parents 3070480 + 4636e1f commit ffeca33

File tree

1 file changed

+84
-51
lines changed

1 file changed

+84
-51
lines changed

README.md

Lines changed: 84 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,44 @@
1+
# Mailtrap Node.js client - Official
2+
13
![TypeScript](https://img.shields.io/npm/types/mailtrap?logo=typescript&logoColor=white&label=%20)
24
[![test](https://github.com/railsware/mailtrap-nodejs/actions/workflows/test.yml/badge.svg)](https://github.com/railsware/mailtrap-nodejs/actions/workflows/test.yml)
35
[![NPM](https://shields.io/npm/v/mailtrap?logo=npm&logoColor=white)](https://www.npmjs.com/package/mailtrap)
46
[![downloads](https://shields.io/npm/d18m/mailtrap)](https://www.npmjs.com/package/mailtrap)
57

6-
# Official Mailtrap Node.js client
8+
9+
## Prerequisites
10+
11+
To get the most out of this official Mailtrap.io Node.js SDK:
12+
- [Create a Mailtrap account](https://mailtrap.io/signup)
13+
- [Verify your domain](https://mailtrap.io/sending/domains)
14+
15+
## Supported functionality
716

817
This NPM package offers integration with the [official API](https://api-docs.mailtrap.io/) for [Mailtrap](https://mailtrap.io).
918

10-
Quickly add email sending functionality to your Node.js application with Mailtrap.
19+
Quickly integrate Mailtrap with your Node.js app.
20+
21+
Currently, with this SDK you can:
22+
- Email API/SMTP
23+
- Send an email (Transactional and Bulk streams)
24+
- Send an email with a template
25+
- Send a batch of emails (Transactional and Bulk streams)
26+
- Email Sandbox (Testing)
27+
- Send an email
28+
- Send an email with a template
29+
- Message management
30+
- Inbox management
31+
- Project management
32+
- Contact management
33+
- Contacts CRUD
34+
- Lists CRUD
35+
- General
36+
- Templates CRUD
37+
- Suppressions management (find and delete)
38+
- Account access management
39+
- Permissions management
40+
- List accounts you have access to
41+
1142

1243
## Installation
1344

@@ -20,6 +51,7 @@ yarn add mailtrap
2051
npm install mailtrap
2152
```
2253

54+
2355
## Usage
2456

2557
### Minimal
@@ -51,79 +83,81 @@ client
5183
.catch(console.error);
5284
```
5385

54-
Refer to the [`examples`](examples) folder for the source code of this and other advanced examples.
86+
## Nodemailer Transport
5587

56-
### General API
88+
> NOTE: [Nodemailer](https://www.npmjs.com/package/nodemailer) is needed as a dependency.
5789
58-
- [List User & Invite account accesses](examples/general/account-accesses.ts)
59-
- [Remove account access](examples/general/accounts.ts)
60-
- [Permissions](examples/general/permissions.ts)
90+
```sh
91+
yarn add nodemailer
6192

62-
### Contacts API
93+
# or, if you are using NPM:
94+
npm install nodemailer
95+
```
6396

64-
- [Contacts](examples/contacts/everything.ts)
97+
If you're using TypeScript, install `@types/nodemailer` as a `devDependency`.
6598

66-
### Contact Lists API
99+
```sh
100+
yarn add --dev @types/nodemailer
67101

68-
- [Contact Lists](examples/contact-lists/everything.ts)
102+
# or, if you are using NPM:
103+
npm install -D @types/nodemailer
104+
```
69105

70-
### Templates API
106+
You can provide Mailtrap-specific keys like `category`, `customVariables`, `templateUuid`, and `templateVariables`.
71107

72-
- [Templates](examples/templates/everything.ts)
108+
See transport usage below:
73109

74-
### Sending API
110+
- [Transport](examples/sending/transport.ts)
75111

76-
- [Advanced](examples/sending/everything.ts)
77-
- [Minimal](examples/sending/minimal.ts)
78-
- [Send email using template](examples/sending/template.ts)
79-
- [Suppressions](examples/sending/suppressions.ts)
80-
- [Nodemailer transport](examples/sending/transport.ts)
112+
## Examples
81113

82-
### Batch Sending API
114+
Refer to the [`examples`](examples) folder for the source code of this and other advanced examples.
83115

84-
- [Transactional emails](examples/batch/transactional.ts)
85-
- [Bulk emails](examples/batch/bulk.ts)
86-
- [Sandbox emails](examples/batch/sandbox.ts)
87-
- [Emails from template](examples/batch/template.ts)
116+
### Contacts API
88117

89-
### Email testing API
118+
- [Contacts](examples/contacts/everything.ts)
90119

91-
- [Attachments](examples/testing/attachments.ts)
92-
- [Inboxes](examples/testing/inboxes.ts)
93-
- [Messages](examples/testing/messages.ts)
94-
- [Projects](examples/testing/projects.ts)
95-
- [Send mail using template](examples/testing/template.ts)
120+
### Contact Lists API
96121

97-
### Bulk sending API
122+
- [Contact Lists](examples/contact-lists/everything.ts)
98123

99-
- [Send mail](examples/bulk/send-mail.ts)
100-
- [Nodemailer Transport](examples/bulk/transport.ts)
124+
### Sending API
101125

102-
### Nodemailer Transport
126+
- [Advanced](examples/sending/everything.ts)
127+
- [Minimal](examples/sending/minimal.ts)
128+
- [Send email using template](examples/sending/template.ts)
129+
- [Suppressions management](examples/sending/suppressions.ts)
130+
- [Nodemailer transport](examples/sending/transport.ts)
103131

104-
> NOTE: [Nodemailer](https://www.npmjs.com/package/nodemailer) is needed as a dependency.
132+
### Batch Sending API
105133

106-
```sh
107-
yarn add nodemailer
134+
- [Transactional emails](examples/batch/transactional.ts)
135+
- [Bulk emails](examples/batch/bulk.ts)
136+
- [Sandbox emails](examples/batch/sandbox.ts)
137+
- [Emails from template](examples/batch/template.ts)
108138

109-
# or, if you are using NPM:
110-
npm install --s nodemailer
111-
```
139+
### Bulk Sending API
112140

113-
If you're using Typescript, install `@types/nodemailer` as a `devDependency`.
141+
- [Send mail](examples/bulk/send-mail.ts)
142+
- [Nodemailer Transport](examples/bulk/transport.ts)
114143

115-
```sh
116-
yarn add --dev @types/nodemailer
144+
### Templates API
117145

118-
# or, if you are using NPM:
119-
npm install --s-dev @types/nodemailer
146+
- [Templates](examples/templates/everything.ts)
120147

121-
You can provide Mailtrap specific keys like `category`, `customVariables`, `templateUuid` and `templateVariables`.
148+
### Email Sandbox (Testing) API
122149

123-
```
124-
See transport usage below:
150+
- [Attachments](examples/testing/attachments.ts)
151+
- [Inboxes](examples/testing/inboxes.ts)
152+
- [Messages](examples/testing/messages.ts)
153+
- [Projects](examples/testing/projects.ts)
154+
- [Send mail using template](examples/testing/template.ts)
125155

126-
- [Transport](examples/sending/transport.ts)
156+
### General API
157+
158+
- [List User & Invite account accesses](examples/general/account-accesses.ts)
159+
- [Remove account access](examples/general/accounts.ts)
160+
- [Permissions](examples/general/permissions.ts)
127161

128162
## Development
129163

@@ -141,9 +175,8 @@ The package is available as open source under the terms of the [MIT License](htt
141175

142176
## Code of Conduct
143177

144-
Everyone interacting in the Mailtrap project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](CODE_OF_CONDUCT.md).
178+
Everyone interacting in the Mailtrap project's codebases, issue trackers, chat rooms, and mailing lists is expected to follow the [code of conduct](CODE_OF_CONDUCT.md).
145179

146180
## Compatibility with previous releases
147181

148182
Versions of this package up to 2.0.2 were an [unofficial client](https://github.com/vchin/mailtrap-client) developed by [@vchin](https://github.com/vchin). Package version 3 is a completely new package.
149-

0 commit comments

Comments
 (0)