Retool email resource not attaching files within modules

In my retool module, I am using the FileInput component to select a pdf file and then using Retool's email resource to send an email with that file attachment.

If I do this directly from within a retool app or the module itself, the email is sent with the file attached as expected. However, from the parent app (within which the module is placed), the email is sent without the file attached.

This seems like a bug to me or am I missing something?

Hello @Rafat_Rashid Welcome to the Retool Community,

This issue is likely due to the FileInput component's scope in the module. The selected file is not automatically accessible by the parent app.

  1. Pass FileInput Value to Parent – In the module, go to State β†’ Outputs and add the FileInput’s value as an output. Use it in the parent app.
  2. Check File Availability in Parent – Log moduleName.fileInputValue in the parent app to verify access.
  3. Convert File to Base64 – Use await utils.getBase64(fileInput.value[0]) before sending.
  4. Use Retool Storage – Upload the file to Retool Storage first, then attach its URL in the email.
1 Like

Thank you for your response.

There is no interaction between the parent app and the module other than the module being part of the app. Everything is happening inside the module.

I did reach out to Retool support on this and looks like it is a bug on their end. This was their response:

I was able to reproduce this and it's definitely a bug on our end. I've went ahead and put in a request to get this fixed. While there's no timeline set yet for the fix, it seems like the best workaround is to put the fileUpload component into the Parent app > pass the fileUpload.value to the Module > send the email containing the passed PDF from Parent app.

They were very prompt with responding so very happy about that.

Thank you for your suggestions as well.

1 Like

Thanks for sharing the update you got!