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 express, { Request, Response, NextFunction } from 'express'; | |
import { check, validationResult, ValidationChain } from 'express-validator'; | |
import bodyParser from 'body-parser'; | |
import next from 'next'; | |
const postMail = async (req: Request, res: Response): Promise<void> => { | |
// Use nodemailer to post the email. Setup mailer() with nodemailer | |
// and call it to Post an Email and return response | |
const mailResponse = await mailer(req.body); | |
res.json(mailResponse); |