Skip to content

Instantly share code, notes, and snippets.

@mikepfeiffer
Created December 15, 2018 20:00
Show Gist options
  • Save mikepfeiffer/5639bf6032ab664bd07f31a2a4cb4525 to your computer and use it in GitHub Desktop.
Save mikepfeiffer/5639bf6032ab664bd07f31a2a4cb4525 to your computer and use it in GitHub Desktop.
Azure Function Code Sample
module.exports = async function (context, req) {
if (req.body.email) {
var email = {
from: {
email: req.body.email
},
subject: "Contact form submission from: " + req.body.name,
content: [{
type: 'text/plain',
value: req.body.message
}]
};
return {
res: {
status: 200
},
message: email
};
} else {
return {
res: {
status: 400
}
};
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment