Attach pdf to retool email resource from url

I use api2pdf to create pdfs. It will return a url of the file. Is there a way i can download and attach to an email using the retool email resource?

Hey @PadenM! You can definitely do this as long as you have the base64 encoded PDF data.

If you have this in your Retool app already, for use with api2pdf, then you can skip step 1 below. Otherwise the first step will use a REST request to get that data.

  1. Send a GET request to the url returned to retrieve the file data:

Since this returns all the information we need, you could just pass this along in the Retool Email resource query. If you want to modify any of it, you could create a JS query to do that as well.

  1. Sending along this info directly:

  2. You could also modify the file object with a JS query as well.

And then use that data in the Email query

Hope that helps!

Awesome thanks!

1 Like