I’ve given Gatsby functions a test drive since they work with Netlify. I’ve got the majority of the functionality for my lambda function working, but I’m hung up on one thing…including additional files that the function can use.
My function is designed to accept a POST request from a contact form on a website and then send an HTML email to an email address. To create the body of the email, I’m using EJS so that I can have an HTML template, fill in some variables received from the contact form, and then send it through Mailgun.
functions └── sendmail ├── email_templates │ └── contact.ejs └── sendmail.ts
When I implement this with Netlify, I use the included_files property as described in this article.
I do it like this in netlify.toml.
[functions."sendmail"] included_files = ["functions/sendmail/email_templates/*.ejs"]
However, I can’t seem to get those included_files working with the Gatsby function.
Does anyone know if the “included_files” property works with Gatsby functions?