Created
October 14, 2020 12:48
-
-
Save crrmacarse/97e28780be104d48c62e6ed80235b38b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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