coopflow / fastify-mailer Goto Github PK
View Code? Open in Web Editor NEWNodemailer instance initialization and encapsulation in fastify framework.
License: MIT License
Nodemailer instance initialization and encapsulation in fastify framework.
License: MIT License
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
Could not find a declaration file for module 'fastify-mailer'
I'm try this plugin and I use ES6.
if I do:
import * as zio from 'fastify-mailer'
or
import { fastifyMailer } from 'fastify-mailer'
or
import zio from 'fastify-mailer'
I get:
Error: Unexpected token (Note that you need @rollup/plugin-json to import JSON files)
// ...
{
2: "name": "nodemailer",
^
3: "version": "6.6.1",
the error seams on nodemailer but is due to my try to use import for fastify-mailer.
if I use require(), all go well.
Someone know the right ES6 syntax for import
this plugin?
best regards,
Leonardo
P.S.
reading manual is not help me.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.