Note, you won’t see the logs because the function sends emails asynchronously but returns without waiting until the emails are sent.
If you want to see the logs, the function should return a promise that resolves when the both emails are sent. You can use async syntax for simplicity:
I keep getting this error: "Failed to load wix data hooks: Cannot find module ‘backend/Submissions’. Is there another module I should install?
Also, is there a way to attach a file attachment on a form submission to an email?
You will need to upload the file, get the URL of the file and then use nodejs-base64-encode (NPM) to encode the URL of the file inside a request.get() function using the request-promise NPM.
Use the SendGrid NPM example (link provided by @givemeawhisky in the above comments)