How to trigger a script in Google Spreadsheet with .NET?

Is there a Google App Script that can attach Google Docs and send them as a scheduled email?

  • I have a script that creates and regularly updates Google Analytics dashboard as a Google spreadsheet. I would like to be able to email this spreadsheet to colleagues daily. Is there a App script that does this?

  • Answer:

    Not sure what you mean by emailing the spreadsheet to colleagues, but if you want to include the data from the spreadsheet in an email to colleagues, you can use this script: function groupEmail() {   var summarySS = SpreadsheetApp.openById('INSERT SPREADSHEET KEY HERE');   var peopleToEmail = [', '];   var relevantSheet = summarySS.getSheetByName('Sheet1');   var data = relevantSheet.getDataRange().getValues();   var emailBody = '<table>';   for (i in data) {     emailBody = emailBody + '<tr>';     for (j in data[i]) {       emailBody = emailBody + '<td>' + data[i][j] + '</td>';     }     emailBody = emailBody + '</td>';   }   emailBody = emailBody + '</table>';   for (i in peopleToEmail) {     GmailApp.sendEmail(peopleToEmail[i], "Ladies and Gentlemen, the Data!", "", {htmlBody:emailBody});   }  } All you need to do is update the spreadsheet key (which is the alphanumeric string in the spreadsheet's URL after "key="), add the email addresses that you want to sent it to in the peopleToEmail array, and change the subject. Then just run it once manually.  Google will ask for authorization to access Gmail. Allow that, then set up a trigger to run whenever you want. If you don't already use triggers, you can find them by clicking the stopwatch-type icon on the Script Editor. Of course, you can also change the relevant sheet or, if you know a little HTML, the formatting of the table in your email body. I hope that helps.

Finn Smith at Quora Visit the source

Was this solution helpful to you?

Other answers

You can use this https://chrome.google.com/webstore/detail/spreadsheet-mailer/nfefgbkeihioeamkeoeecjdaepfnoole. This does exactly the same job as you need. You can send a spreadsheet as an attachment instantly and can also schedule recurring emails. The attachments can be PDF, XLS, XLSX, CSV etc.

Hari Das

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.