Generate & Send PDFs from Google Sheets thru SMTP

I looked at this conversation
How to Generate & Send PDFs from Google Sheets

and tried creating a similar flow, with a few more steps. It starts with a webhook to pull data from Retable to Google sheets, then will create the docs (using a doc template) then created the pdf and send it as attachment thru SMTP.

It sends the email but:

Hello @i.k ,

Where it adds [ and " ? in mail body or attachment name?

You have to pass file URL from Read File step in Attachment field of SMTP step. Currently, only the file ID is passed, which is why the file doesn’t contain any data.

It adds that in the mail body
dear

Thank you for your input. I suspect there might be an issue with mapping data from the webhook to the SMTP step. Could you please share the data from the webhook that you’re attempting to send in the SMTP step?

This is what’s pulled from Retable
r-1

I’ve recorded a video to share the results from the test runs

Thanks for the video.

You can skip the Upload File step, as the Save as PDF action already creates a new PDF file in the drive folder. For the SMTP step, you have to pass the output of the Read File step in the attachment field (refer to the image below). This will attach the PDF to the email.

It works now. I was wondering if there’s a way that it clears the previous content of the doc template (like a body.clear in apps script)? If not, does that mean I would need to assign a new doc template for every run?