Create a CSV file to attachment into an email

Thank you very much in advance for all the help.

My goal is to attach a CSV file to an email. I think what I need to achieve for that is that what is generated by the CSV module is a file and not simply a text, so that I can “attach” it.
My problem is that I don’t know how to generate that CSV FILE.
On the other hand, I think the way to attach it, once you have the file and not the text, would be to map it, but I’m not sure.

My scenario is composed of an HTTP module that makes a query bringing a list of countries with their areas in KM2, subsequently an Iterator, a Router (which in this case is not relevant because the other routes are disabled) a Create CSV module ( advanced) and a Send an Email module.

CSV module configuration:

Configuración del módulo de Send an Email:

If I attach the text, I get this error and the email is not sent, which I assume is because I did not attach a file itself.


Hello Cecilia,

Welcome to the make community!

If you want to send the CSV by email, you can deselect the “map” option under attachments, and directly name the file with a .csv terminator. (example.csv), then use the “text” variable from the CSV module as the data.

This works for me, hope it helps!

5 Likes

Hey @Cecilia_Manzano

If you want to send CSV file by Gmail you have to map the file name & data from the previous modules.

Below is the screenshot which works for me

3 Likes

Thank you Brett!!, i could with your solution.

2 Likes