Best answer

How to add an attachment to a gmail message?

  • 2 August 2021
  • 9 replies
  • 255 views

Userlevel 1
Badge

Hi, I have a zap that collects data from a webhook and creates a new row in a google sheet.

Then I need to send a copy of that google sheet to an email recipient.

The email is sending correctly but the attachment (google sheet) has no name and no file extension (see attached). 

Please, does anyone know how do I attach the file so that I can download it and open it?

Thank you 

 

icon

Best answer by Troy Tessalone 4 August 2021, 16:10

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

9 replies

Userlevel 7
Badge +14

Hi @mrmac2you 

Please post screenshots of how your Zap steps are configured, thanks.

Userlevel 1
Badge

Hi @Troy Tessalone I have a simple 3 step zap - it all works except that the attachment I am adding to the email does arrive in the recipients mailbox in any format that can be opened - the file name does not match any name of a file in my drive either.

I’ve attached the steps and the URL that I added to the attachments field in the last step.

Thank you 

Userlevel 7
Badge +14

@mrmac2you 

You need to use the File download URL, which is different than the file sharing URL.

Also, the file URL needs to be publicly accessible, so you may have to adjust the file sharing permissions in GDrive.

Best way to test is to open the file URL you are trying to use in a new private browser.

If the browser file attempts to download the file, then you are using the correct file URL.

Userlevel 7
Badge +14

@mrmac2you 

Check out this related article:

 

Userlevel 1
Badge

Thank you very much for getting back to me on this one @Troy Tessalone - I think I messed up the syntax so when I test it I just get a 404 error.

My drive does not give me a download link, only a share link which I modified using the guidance in the article 

 

https://drive.google.com/drive/u/0/my-drive/uc?export=download&id=<FILEID>

This is what I used 

 

Thank you 

Userlevel 7
Badge +14

@mrmac2you

You need to replace the FILE ID at the end of the link with the ID of the file, which would be the redacted value in the screenshot you provided.

 

Userlevel 1
Badge

@mrmac2you

You need to replace the FILE ID at the end of the link with the ID of the file, which would be the redacted value in the screenshot you provided.

 

My apologies @Troy Tessalone - I should have added that I was already replacing the fileid at the end.

I’m going to have to find a different way to do this, I have now spent too much time trying to get this one single step to work. 

I noticed that there is a comment in the following document saying that the method you described above only works for files NOT created in Google Drive. 

I created a new XLS and uploaded that to my drive but then Zapier is not able to see the sheet, even after changing permissions etc.

Thank you 

Userlevel 7
Badge +14

@mrmac2you 

You can do a GDrive Find File step and it will return many different URLs, one of which is the download URL for the file.

Userlevel 1
Badge

Thank you very much @Troy Tessalone - the “find” option has turned out to be the way forward.

I do appreciate you taking the time to guide me here.