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
// Notes: | |
// - this file needs to live in the NextJS pages/api/ folder | |
// - you'll need to install the 'node-mailjet' NPM package and add + change the environment variables seen below (MailJet onboarding process gives you this info) | |
export default function handler(req, res) { | |
const form = req.body | |
if (!form || !form.email || !form.phone) | |
return res.status(400).json({ message: 'The form was not filled out properly.', error: 400 }) | |
const Mailjet = require('node-mailjet') |