How to attach file from Retool Storage in SMTP Query Library?

Hi,

I want to attach a file from Retool Storage in the SMTP Query Library. How can I do that?

I must send a default contract for all e-mails sent for this query library.

Here is the guideline:
Retool Storage quickstart | Retool Docs

Hey @candidosales! You can't attach the file in the Query Library, but you can set this up so that the default contract gets attached when you send this email from inside the app.

Define a variable in the QL query

Retrieve the required data from Retool Storage in the app (set to run on inputs change so that it runs on app load)

Import the QL query in the app and use the data returned from the Retool Storage query in the variable field

The attachment should be sent every time that query is run.

@joeBumbaca , exactly!! Thanks!

I going to try it :slight_smile: and I'll be back with the feedback.

1 Like

@joeBumbaca , How can I create tabs for my queries?

It's like, Could you execute two queries in the same step?

In your screenshots, it's like can I aggregate multiple tabs/queries per step?

@joeBumbaca ,

I created a query to get the document before sending the e-mail. It's working! Thanks so much!

1 Like

@candidosales Those tabs are the default organization of the code section in the editor. You can keep a query there by double clicking on it's name. Additional queries selected to inspect will open up along side the others.

You can create a JS query that triggers multiple other queries, we have some docs on query.trigger here.

Or you can use the success / failure conditions on the queries to run others when those conditions are met.

1 Like