mailgun.js 12.6.0 → 12.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AMD/definitions.amd.js +1 -1
- package/CHANGELOG.md +7 -0
- package/CJS/definitions.cjs +1 -1
- package/ESM/definitions.browser.js +1 -1
- package/ESM/definitions.node.js +1 -1
- package/README.md +6 -6
- package/package.json +1 -1
- package/version.md +1 -1
package/AMD/definitions.amd.js
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [12.6.1](https://github.com/mailgun/mailgun.js/compare/v12.6.0...v12.6.1) (2026-01-12)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Other changes
|
|
9
|
+
|
|
10
|
+
* Remove "key-" prefix from examples ([d0b2e90](https://github.com/mailgun/mailgun.js/commits/d0b2e90691c6c480814dd34cc70a90d060fdadae))
|
|
11
|
+
|
|
5
12
|
## [12.6.0](https://github.com/mailgun/mailgun.js/compare/v12.5.0...v12.6.0) (2026-01-08)
|
|
6
13
|
|
|
7
14
|
|
package/CJS/definitions.cjs
CHANGED
package/ESM/definitions.node.js
CHANGED
package/README.md
CHANGED
|
@@ -41,7 +41,7 @@ npm install mailgun.js
|
|
|
41
41
|
|
|
42
42
|
## Setup Client
|
|
43
43
|
|
|
44
|
-
The next step is to import the module and instantiate a mailgun client by calling `new Mailgun(formData)` and then using `mailgun.client` setup the client with basic auth credentials `(username: 'api', key: '
|
|
44
|
+
The next step is to import the module and instantiate a mailgun client by calling `new Mailgun(formData)` and then using `mailgun.client` setup the client with basic auth credentials `(username: 'api', key: 'MAILGUN_API_KEY')`.
|
|
45
45
|
|
|
46
46
|
NOTE: starting from version 3.0 you need to pass FormData (we need this to keep library universal). For node.js you can use built-in FormData or `form-data` library.
|
|
47
47
|
|
|
@@ -53,12 +53,12 @@ Once the package is installed, you can import the library using `import` or `req
|
|
|
53
53
|
```js
|
|
54
54
|
const Mailgun = require('mailgun.js');
|
|
55
55
|
const mailgun = new Mailgun(FormData); // or const formData = require('form-data');
|
|
56
|
-
const mg = mailgun.client({username: 'api', key: process.env.MAILGUN_API_KEY || '
|
|
56
|
+
const mg = mailgun.client({username: 'api', key: process.env.MAILGUN_API_KEY || 'MAILGUN_API_KEY'});
|
|
57
57
|
```
|
|
58
58
|
```js
|
|
59
59
|
import Mailgun from 'mailgun.js';
|
|
60
60
|
const mailgun = new Mailgun(FormData); // or import formData from 'form-data';
|
|
61
|
-
const mg = mailgun.client({username: 'api', key: process.env.MAILGUN_API_KEY || '
|
|
61
|
+
const mg = mailgun.client({username: 'api', key: process.env.MAILGUN_API_KEY || 'MAILGUN_API_KEY'});
|
|
62
62
|
```
|
|
63
63
|
|
|
64
64
|
Be aware that there are four bundles available for usage. All of them are conditionally exported by package.json and separated by environment (Browser/Node.js):
|
|
@@ -155,7 +155,7 @@ const mailgun = new Mailgun(FormData);
|
|
|
155
155
|
|
|
156
156
|
const mg = mailgun.client({
|
|
157
157
|
username: 'api',
|
|
158
|
-
key: process.env.MAILGUN_API_KEY || '
|
|
158
|
+
key: process.env.MAILGUN_API_KEY || 'MAILGUN_API_KEY',
|
|
159
159
|
useFetch: true,
|
|
160
160
|
});
|
|
161
161
|
```
|
|
@@ -170,7 +170,7 @@ Example:
|
|
|
170
170
|
|
|
171
171
|
const mg = mailgun.client({
|
|
172
172
|
username: 'api',
|
|
173
|
-
key: process.env.MAILGUN_API_KEY || '
|
|
173
|
+
key: process.env.MAILGUN_API_KEY || 'MAILGUN_API_KEY',
|
|
174
174
|
proxy: {
|
|
175
175
|
protocol: 'https' // 'http' ,
|
|
176
176
|
host: '127.0.0.1', // use your proxy host here
|
|
@@ -190,7 +190,7 @@ Primary accounts can make API calls on behalf of their subaccounts. [API documen
|
|
|
190
190
|
```js
|
|
191
191
|
import Mailgun from 'mailgun.js';
|
|
192
192
|
const mailgun = new Mailgun(FormData); // or import FormData from 'form-data'
|
|
193
|
-
const mg = mailgun.client({username: 'api', key: process.env.MAILGUN_API_KEY || '
|
|
193
|
+
const mg = mailgun.client({username: 'api', key: process.env.MAILGUN_API_KEY || 'MAILGUN_API_KEY'});
|
|
194
194
|
mg.setSubaccount('subaccount-id');
|
|
195
195
|
// then, if you need to reset it back to the primary account:
|
|
196
196
|
mg.resetSubaccount();
|
package/package.json
CHANGED
package/version.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
12.6.
|
|
1
|
+
12.6.1
|