Skip to content

Instantly share code, notes, and snippets.

@crrmacarse
Created October 14, 2020 12:48
Show Gist options
  • Save crrmacarse/97e28780be104d48c62e6ed80235b38b to your computer and use it in GitHub Desktop.
Save crrmacarse/97e28780be104d48c62e6ed80235b38b to your computer and use it in GitHub Desktop.
import nodemailer from 'nodemailer'
import Env from '@ioc:Adonis/Core/Env'
export const emailConfig = {
rootUrl: Env.getOrFail('PUBLIC_URL') as string,
service: Env.getOrFail('SMPT_SERVICE') as string,
user: Env.getOrFail('SMPT_USER') as string,
pass: Env.getOrFail('SMPT_PASSWORD') as string,
}
const emailProvider = nodemailer.createTransport({
service: emailConfig.service,
auth: {
user: emailConfig.user,
pass: emailConfig.pass,
},
})
export const rootUrl = emailConfig.rootUrl
export default emailProvider
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment