nuxt-mail 3.0.16 → 3.0.20
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/README.md +34 -2
- package/dist/plugin.js +9 -5
- package/package.json +12 -8
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<!-- /TITLE -->
|
|
4
4
|
|
|
5
5
|
<!-- BADGES/ -->
|
|
6
|
-
<p>
|
|
6
|
+
<p>
|
|
7
7
|
<a href="https://npmjs.org/package/nuxt-mail">
|
|
8
8
|
<img
|
|
9
9
|
src="https://img.shields.io/npm/v/nuxt-mail.svg"
|
|
@@ -180,9 +180,41 @@ export default {
|
|
|
180
180
|
|
|
181
181
|
Also, the module does not work for static sites (via `nuxt generate`) because the module creates a server route.
|
|
182
182
|
|
|
183
|
+
## Setting up popular email services
|
|
184
|
+
|
|
185
|
+
### Gmail
|
|
186
|
+
|
|
187
|
+
You have to setup an [app-specific password](https://myaccount.google.com/apppasswords) to log into the SMTP server. Then, add the following config to your `nuxt-mail` config:
|
|
188
|
+
|
|
189
|
+
```js
|
|
190
|
+
export default {
|
|
191
|
+
modules: [
|
|
192
|
+
'@nuxtjs/axios',
|
|
193
|
+
['nuxt-mail', {
|
|
194
|
+
// ...
|
|
195
|
+
smtp: {
|
|
196
|
+
service: 'gmail',
|
|
197
|
+
auth: {
|
|
198
|
+
user: 'foo@gmail.com',
|
|
199
|
+
pass: '<app-specific password>',
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
}],
|
|
203
|
+
],
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
Missing something? Add your service here via a [pull request](https://github.com/dword-design/nuxt-mail/pulls).
|
|
208
|
+
|
|
183
209
|
## Debugging mail errors
|
|
184
210
|
|
|
185
|
-
If the mail doesn't get sent, you can debug the error using the browser developer tools. If a 500 error is thrown (check out the console output), you can find the error message in the Network tab. For Chrome users, open the Network tab, then find the "send" request. Open it and select the "Response" tab. There it should show the error message. In most cases, it is related to authentication with the SMTP server.
|
|
211
|
+
If the mail doesn't get sent, you can debug the error using the browser developer tools. If a `500` error is thrown (check out the console output), you can find the error message in the Network tab. For Chrome users, open the Network tab, then find the "send" request. Open it and select the "Response" tab. There it should show the error message. In most cases, it is related to authentication with the SMTP server.
|
|
212
|
+
|
|
213
|
+
## Open questions
|
|
214
|
+
|
|
215
|
+
### "Self signed certificate in certificate chain" error
|
|
216
|
+
|
|
217
|
+
There is [an issue](https://github.com/dword-design/nuxt-mail/issues/62) where the above error is thrown. If someone knows a solution for this, it is warmly welcome 😍.
|
|
186
218
|
|
|
187
219
|
<!-- LICENSE/ -->
|
|
188
220
|
## Contribute
|
package/dist/plugin.js
CHANGED
|
@@ -5,11 +5,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var _default = (context, inject) => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
8
|
+
var _default = (context, inject) => inject('mail', {
|
|
9
|
+
send: async config => {
|
|
10
|
+
try {
|
|
11
|
+
await context.app.$axios.$post('/mail/send', config);
|
|
12
|
+
} catch (error) {
|
|
13
|
+
throw new Error(error.response.data);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
});
|
|
13
17
|
|
|
14
18
|
exports.default = _default;
|
|
15
19
|
module.exports = exports.default;
|
package/package.json
CHANGED
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-mail",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.20",
|
|
4
4
|
"description": "Adds email sending capability to a Nuxt.js app. Adds a server route, an injected variable, and uses nodemailer to send emails.",
|
|
5
5
|
"keywords": [
|
|
6
|
-
"api",
|
|
7
|
-
"contact",
|
|
8
6
|
"email",
|
|
9
|
-
"
|
|
7
|
+
"express",
|
|
8
|
+
"frontend",
|
|
9
|
+
"inject",
|
|
10
|
+
"javascript",
|
|
10
11
|
"mail",
|
|
11
12
|
"nodemailer",
|
|
13
|
+
"npm",
|
|
14
|
+
"npm-package",
|
|
12
15
|
"nuxt",
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
16
|
+
"nuxt-module",
|
|
17
|
+
"nuxtjs",
|
|
18
|
+
"nuxtjs-module",
|
|
19
|
+
"server",
|
|
20
|
+
"webdevelopment"
|
|
17
21
|
],
|
|
18
22
|
"repository": "dword-design/nuxt-mail",
|
|
19
23
|
"funding": "https://github.com/sponsors/dword-design",
|