Skip to content

Commit

Permalink
fix: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
dword-design committed Mar 13, 2021
1 parent 696e106 commit a2d5272
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,29 +75,29 @@ export default {

The `smtp` options are required and directly passed to [nodemailer](https://nodemailer.com/smtp/). Refer to their documentation for available options. Also note that the module only works for `universal` mode, not `spa` mode, because we need the server route (see the [Nuxt.js documentation](https://nuxtjs.org/docs/2.x/configuration-glossary/configuration-mode) for details about the mode).

The module adds a `/mail/send` post route, which can be invoked via `$axios`:
The module injects the `$mail` variable, which we now use to send emails:
```js
// Inside a component
this.$axios.$post('/mail/send', {
this.$mail.send({
from: 'John Doe',
subject: 'Incredible',
text: 'This is an incredible test message',
to: 'johndoe@gmail.com',
})
```

The module also injects the `$mail` variable, which makes it even easier:
You can also directly call the generated `/mail/send` post route:
```js
// Inside a component
this.$mail.send({
this.$axios.$post('/mail/send', {
from: 'John Doe',
subject: 'Incredible',
text: 'This is an incredible test message',
to: 'johndoe@gmail.com',
})
```

Note that the options are passed to [nodemailer](https://nodemailer.com/message/). Refer to the documentation for available config options.
Note that the data are passed to [nodemailer](https://nodemailer.com/message/). Refer to the documentation for available config options.

<!-- LICENSE/ -->
## License
Expand Down

0 comments on commit a2d5272

Please sign in to comment.