|
8 | 8 |
|
9 | 9 | This is an API for the temporary email service [TempMail.lol](https://tempmail.lol).
|
10 | 10 |
|
11 |
| -## If you are using a BananaCrumbs ID/Token and have not migrated, install version 3.1.0 instead of 4.x.x! |
12 |
| - |
13 |
| -## Upgrading from 3.1.0 |
14 |
| - |
15 |
| -The key difference between 3.1.0 and 4.0.0 is the fact that the constructor only accepts an API Key, and not a BananaCrumbs ID. |
16 |
| - |
17 |
| -The custom domain method has changed as well as the createInbox method's parameters. |
18 |
| - |
19 |
| -## Upgrading from 2.0.3 |
20 |
| - |
21 |
| -The version 3.0.0+ is vastly different from the old version of the API. Please read the changes before using the new version of the API. |
22 |
| - |
23 |
| -Version 2.0.3 still works, but does not have support for custom domains or TempMail Plus. Note that v2 support may be dropped at any time, so please |
24 |
| -upgrade your applications as soon as possible. |
25 |
| - |
26 | 11 | ## Installation
|
27 | 12 | ```bash
|
28 | 13 | npm i tempmail.lol
|
@@ -117,33 +102,21 @@ const emails = tempmail.checkInbox("<TOKEN>").then((emails) => {
|
117 | 102 |
|
118 | 103 | #### Note: you will need to be a TempMail Plus/Ultra subscriber to use custom domains!
|
119 | 104 |
|
120 |
| -#### Old Custom Domains (v1) |
121 |
| -```js |
122 |
| -tempmail.checkCustomDomainLegacy("example.com", "token").then(emails => { |
123 |
| - emails.forEach(e => { |
124 |
| - console.log("Email from: " + e.from + " to " + e.to); |
125 |
| - }); |
126 |
| -}); |
127 |
| -``` |
128 |
| - |
129 |
| -You can obtain a token by visiting https://tempmail.lol/custom.html |
| 105 | +To setup Custom Domains, visit your account on https://tempmail.lol/account and follow the instructions on https://tempmail.lol/custom |
130 | 106 |
|
131 |
| -Custom domains will NOT alert you if the token is invalid. |
| 107 | +After setting up Custom Domains, they can be checked the same way you make normal domains (note: only your account can access the domain!) |
132 | 108 |
|
133 |
| -#### New Custom Domains (v2) |
134 | 109 | ```js
|
135 |
| -tempmail.checkV2CustomDomain("example.com").then(emails => { |
136 |
| - emails.forEach(e => { |
137 |
| - console.log("Email from: " + e.from + " to " + e.to); |
138 |
| - }); |
| 110 | +tempmail.createInbox({ |
| 111 | + community: false, |
| 112 | + domain: "example.com", //replace with your custom domain |
| 113 | + prefix: "optional", //this will be the ENTIRE beginning of the email. "optional" results in "optional@example.com". |
139 | 114 | });
|
140 | 115 | ```
|
141 | 116 |
|
142 |
| -To setup this, visit your account on https://tempmail.lol/account and migrate if you have not already. |
143 |
| - |
144 | 117 | ### Webhooks
|
145 | 118 |
|
146 |
| -You can set up a webhook to be called when an email is received. |
| 119 | +You can set up a webhook to be called when an email is received. You must have Custom Domains setup beforehand. |
147 | 120 |
|
148 | 121 | ```js
|
149 | 122 | tempmail.setWebhook("https://example.com/webhook").then(() => {
|
|
0 commit comments