fastify-mailer icon indicating copy to clipboard operation
fastify-mailer copied to clipboard

Hi, Does it's work with google OAuth2?

Open Kathou99 opened this issue 2 years ago • 0 comments

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

Kathou99 avatar Nov 15 '22 02:11 Kathou99