DEV Community

Discussion on: Using Netlify lambda functions to send emails from a GatsbyJS site

Collapse
wispyco profile image
Wispy

I'm stuck on the hookState.js part, where do I place that in my gatsby App, same with the onChange.js and submitForm.js. And how do I write my form in order for it to be triggered by the submitForm.js code.

Collapse
wispyco profile image
Wispy

I figured out where to put the code, I had a functional component so I was confused as to how to do forms, because the example's I found used classes. Anyways. I am get the following error from Netlfiy Lambda. Any Ideas?

RangeError [ERR_HTTP_INVALID_STATUS_CODE]: Invalid status code: undefined

Collapse
wispyco profile image
Wispy

I had to add require('dotenv').config(); in my sendmail.js file, because the env variables were not being found. If anyone runs into the same issue. thanks for the tut!