Created
December 15, 2018 20:00
-
-
Save mikepfeiffer/5639bf6032ab664bd07f31a2a4cb4525 to your computer and use it in GitHub Desktop.
Azure Function Code Sample
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
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