Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nuxt-mailer

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nuxt-mailer - npm Package Compare versions

Comparing version 0.5.0 to 0.6.0

2

dist/module.json
{
"name": "nuxt-mailer",
"configKey": "mailer",
"version": "0.5.0"
"version": "0.6.0"
}
{
"name": "nuxt-mailer",
"version": "0.5.0",
"version": "0.6.0",
"license": "MIT",

@@ -5,0 +5,0 @@ "type": "module",

@@ -8,4 +8,74 @@ # Nuxt Module

Install
```bash
npm install nuxt-mailer
```
```
Add nuxt-mailer to nuxt.config modules array
```js
export default defineNuxtConfig({
modules: ['nuxt-mailer']
})
```
Example usage:
> server/app/email/emailSender.ts
```ts
import { useMailer } from '#mailer'
import { EmailTemplate } from './types/emailTypes'
export async function sendEmail(template: EmailTemplate , to: string, from: string, subject: string) {
const mailer = useMailer()
const username = process.env.MAIL_USERNAME as string
const password = process.env.MAIL_PASSWORD as string
const gmailTranport = mailer.customTranporter({
service: 'gmail',
auth: {
user: username,
pass: password
}
})
console.log('username: ', username)
console.log('password: ', password)
console.log('from: ',from)
console.log('to: ',to)
console.log('html: ', template.html)
console.log('text: ', template.text)
console.log('subject: ', subject)
await mailer.sendMail({
requestId: 'test-key',
options: {
from: from,
to: to,
subject: subject,
text: template.text,
html: template.html
},
transporter: gmailTranport
})
}
```
> server/app/email/verifyEmail.ts
```ts
import verifyEmailTemplate from './templates/verifyEmailTemplate'
import { sendEmail } from './emailSender'
export default async function sendVerificationEmail(email: string) {
const template = verifyEmailTemplate('coolbeans', 'support@fullstackjack.dev', 'Avantage Support', 'Avantage')
sendEmail(template, email, 'jack@fullstackjack.dev', 'Avantage email verification')
}
```
My wife is giving me that "you better get off your laptop and celebrate Christmas" stare
I'll post more examples after the holidays. . .
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc