app.post('/send-email', (req, res) => {
// Set the task payload to the form submission.
const {to_name, from_name, to_email, date} = req.body;
const payload = {to_name, from_name, to_email};
createHttpTaskWithToken(
process.env.GOOGLE_CLOUD_PROJECT,
QUEUE_NAME,
QUEUE_LOCATION,
FUNCTION_URL,
SERVICE_ACCOUNT_EMAIL,
payload,
date
);
res.status(202).send('📫 Your postcard is in the mail! 💌');
});