I am using the email integration functionality to send mail via Mailgun. Everything was working fine until I tried to include a file attachment. While it worked fine locally using the Netlify CLI, it does not work in production and gives the following error:
Feb 13, 05:34:32 PM: INIT_START Runtime Version: nodejs:16.v11 Runtime Version ARN: arn:aws:lambda:us-east-1::runtime:ee071345fbee0f4751fcbcd47a5784052d8f7d4256ca7f31e6056b294cee515c
Feb 13, 05:34:32 PM: 41f7e13b ERROR Invoke Error {“errorType”:“Error”,“errorMessage”:“ENOENT: no such file or directory, open ‘./assets/downloads/price-sheet-studio-539.pdf’”,“code”:“ENOENT”,“errno”:-2,“syscall”:“open”,“path”:“./assets/downloads/price-sheet-studio-539.pdf”,“stack”:[“Error: ENOENT: no such file or directory, open ‘./assets/downloads/price-sheet-studio-539.pdf’”," at Object.openSync (node:fs:585:3)“,” at Object.readFileSync (node:fs:453:35)“,” at Runtime.handler (/var/task/netlify/functions/submission-created.js:5591:34)“,” at Runtime.handleOnceNonStreaming (file:///var/runtime/index.mjs:1089:29)"]}
Feb 13, 05:34:32 PM: 41f7e13b Duration: 6.65 ms Memory Usage: 63 MB Init Duration: 177.93 ms
My site name is “studio-539-flowers.netlify.app” and I don’t have any build settings in place. I have tried a bunch of changes to the filename and path and also tried a full URL reference (https://studio-539-flowers.netlify.app/assets/downloads/price-sheet-studio-539.pdf) and nothing fixed it.