fastify-mailer
fastify-mailer copied to clipboard
Hi, Does it's work with google OAuth2?
Hi, How I can make this work?
I did not find the way to do in OAuth2 :)
This code is from my last server with express
const transport = nodemailer.createTransport({
service:'gmail',
auth: {
type: 'OAuth2',
user: process.env.USER,
clientId: process.env.CLIENT_ID,
clientSecret: process.env.CLIENT_SECRET ,
refreshToken: process.env.REFRESH_TOKEN,
accessToken: process.env.ACCESS_TOKEN
}
});
transport.use('compile', hbs({
viewEngine: 'express-handlebars', //TEST
viewPath: './views/'
}));
nodemailer.sendMail({mail_options}, (err, info) => {
if (err){
reply.code(500).send({
success:false,
data: 'Une erreur sait produite lors de l\'envoie du mail...!'
})
Thank