|
3 | 3 | <!-- /TITLE --> |
4 | 4 |
|
5 | 5 | <!-- BADGES/ --> |
6 | | - <p> |
7 | | - <a href="https://npmjs.org/package/nuxt-mail"> |
8 | | - <img |
9 | | - src="https://img.shields.io/npm/v/nuxt-mail.svg" |
10 | | - alt="npm version" |
11 | | - > |
12 | | - </a><img src="https://img.shields.io/badge/os-linux%20%7C%C2%A0macos%20%7C%C2%A0windows-blue" alt="Linux macOS Windows compatible"><a href="https://github.com/dword-design/nuxt-mail/actions"> |
13 | | - <img |
14 | | - src="https://github.com/dword-design/nuxt-mail/workflows/build/badge.svg" |
15 | | - alt="Build status" |
16 | | - > |
17 | | - </a><a href="https://codecov.io/gh/dword-design/nuxt-mail"> |
18 | | - <img |
19 | | - src="https://codecov.io/gh/dword-design/nuxt-mail/branch/master/graph/badge.svg" |
20 | | - alt="Coverage status" |
21 | | - > |
22 | | - </a><a href="https://david-dm.org/dword-design/nuxt-mail"> |
23 | | - <img src="https://img.shields.io/david/dword-design/nuxt-mail" alt="Dependency status"> |
24 | | - </a><img src="https://img.shields.io/badge/renovate-enabled-brightgreen" alt="Renovate enabled"><br/><a href="https://gitpod.io/#https://github.com/dword-design/nuxt-mail"> |
25 | | - <img |
26 | | - src="https://gitpod.io/button/open-in-gitpod.svg" |
27 | | - alt="Open in Gitpod" |
28 | | - width="114" |
29 | | - > |
30 | | - </a><a href="https://www.buymeacoffee.com/dword"> |
31 | | - <img |
32 | | - src="https://www.buymeacoffee.com/assets/img/guidelines/download-assets-sm-2.svg" |
33 | | - alt="Buy Me a Coffee" |
34 | | - width="114" |
35 | | - > |
36 | | - </a><a href="https://paypal.me/SebastianLandwehr"> |
37 | | - <img |
38 | | - src="https://sebastianlandwehr.com/images/paypal.svg" |
39 | | - alt="PayPal" |
40 | | - width="163" |
41 | | - > |
42 | | - </a><a href="https://www.patreon.com/dworddesign"> |
43 | | - <img |
44 | | - src="https://sebastianlandwehr.com/images/patreon.svg" |
45 | | - alt="Patreon" |
46 | | - width="163" |
47 | | - > |
48 | | - </a> |
| 6 | +<p> |
| 7 | + <a href="https://npmjs.org/package/nuxt-mail"> |
| 8 | + <img |
| 9 | + src="https://img.shields.io/npm/v/nuxt-mail.svg" |
| 10 | + alt="npm version" |
| 11 | + > |
| 12 | + </a><img src="https://img.shields.io/badge/os-linux%20%7C%C2%A0macos%20%7C%C2%A0windows-blue" alt="Linux macOS Windows compatible"><a href="https://github.com/dword-design/nuxt-mail/actions"> |
| 13 | + <img |
| 14 | + src="https://github.com/dword-design/nuxt-mail/workflows/build/badge.svg" |
| 15 | + alt="Build status" |
| 16 | + > |
| 17 | + </a><a href="https://codecov.io/gh/dword-design/nuxt-mail"> |
| 18 | + <img |
| 19 | + src="https://codecov.io/gh/dword-design/nuxt-mail/branch/master/graph/badge.svg" |
| 20 | + alt="Coverage status" |
| 21 | + > |
| 22 | + </a><a href="https://david-dm.org/dword-design/nuxt-mail"> |
| 23 | + <img src="https://img.shields.io/david/dword-design/nuxt-mail" alt="Dependency status"> |
| 24 | + </a><img src="https://img.shields.io/badge/renovate-enabled-brightgreen" alt="Renovate enabled"><br/><a href="https://gitpod.io/#https://github.com/dword-design/nuxt-mail"> |
| 25 | + <img |
| 26 | + src="https://gitpod.io/button/open-in-gitpod.svg" |
| 27 | + alt="Open in Gitpod" |
| 28 | + width="114" |
| 29 | + > |
| 30 | + </a><a href="https://www.buymeacoffee.com/dword"> |
| 31 | + <img |
| 32 | + src="https://www.buymeacoffee.com/assets/img/guidelines/download-assets-sm-2.svg" |
| 33 | + alt="Buy Me a Coffee" |
| 34 | + width="114" |
| 35 | + > |
| 36 | + </a><a href="https://paypal.me/SebastianLandwehr"> |
| 37 | + <img |
| 38 | + src="https://sebastianlandwehr.com/images/paypal.svg" |
| 39 | + alt="PayPal" |
| 40 | + width="163" |
| 41 | + > |
| 42 | + </a><a href="https://www.patreon.com/dworddesign"> |
| 43 | + <img |
| 44 | + src="https://sebastianlandwehr.com/images/patreon.svg" |
| 45 | + alt="Patreon" |
| 46 | + width="163" |
| 47 | + > |
| 48 | + </a> |
49 | 49 | </p> |
50 | 50 | <!-- /BADGES --> |
51 | 51 |
|
@@ -164,53 +164,6 @@ export default { |
164 | 164 | </script> |
165 | 165 | ``` |
166 | 166 |
|
167 | | -## Nuxt 2 |
168 | | - |
169 | | -For Nuxt 2, you need to install [@nuxtjs/axios](https://www.npmjs.com/package/@nuxtjs/axios) and add it to your module list before `nuxt-mail`: |
170 | | - |
171 | | -```js |
172 | | -// nuxt.config.js |
173 | | -export default { |
174 | | - modules: [ |
175 | | - [ |
176 | | - '@nuxtjs/axios', |
177 | | - ['nuxt-mail', { /* ... */ }], |
178 | | - }], |
179 | | - ], |
180 | | -} |
181 | | -``` |
182 | | - |
183 | | -Then you can use the injected variable like so: |
184 | | - |
185 | | -```html |
186 | | -<script> |
187 | | -export default { |
188 | | - methods: { |
189 | | - sendEmail() { |
190 | | - this.$mail.send({ |
191 | | - from: 'John Doe', |
192 | | - subject: 'Incredible', |
193 | | - text: 'This is an incredible test message', |
194 | | - }) |
195 | | - }, |
196 | | - }, |
197 | | -} |
198 | | -</script> |
199 | | -``` |
200 | | - |
201 | | -### Note about production use |
202 | | - |
203 | | -When you use `nuxt-mail` in production and you configured a reverse proxy that hides your localhost behind a domain, you need to tell `@nuxt/axios` which base URL you are using. Otherwise `nuxt-mail` won't find the send route. Refer to [@nuxt/axios options](https://axios.nuxtjs.org/options) on how to do that. The easiest option is to set the `API_URL` environment variable, or set something else in your `nuxt.config.js`: |
204 | | - |
205 | | -```js |
206 | | -// nuxt.config.js |
207 | | -export default { |
208 | | - axios: { |
209 | | - baseURL: process.env.BASE_URL, |
210 | | - }, |
211 | | -} |
212 | | -``` |
213 | | - |
214 | 167 | ## Multiple message configs |
215 | 168 |
|
216 | 169 | It is also possible to provide multiple message configurations by changing the `message` config into an array. |
|
0 commit comments