Google Form Submit > Attach New Responses to Email and Send

被刻印的时光 ゝ 提交于 2019-12-12 01:06:33

问题


I have a script that turns a submitted form into a PDF and emails it automatically but I can't seem to get my head around if it is possible to implement a function i would like: -

  1. User fills in Google form
  2. Submits form
  3. This creates entirely new spreadsheet based on same headers from the form
  4. Emails thie spreadsheet as an .xlsx attachment automatically to a specific email address

Is this possible? I feel like I am missing a simple way to do this but I am having a moment of noobishness! :-)


回答1:


1, 2, 3 - all quite possible.

4 - Not as such. There's no support in Google Apps Script for converting a Sheet to Excel format. However you could produce a CSV file which would be understood by Excel or any other spreadsheet program, and email that as an attachment.

Generating a CSV is covered in one of the Apps Script tutorials. See Saving a selected Range to a CSV file from Tutorial: Interacting With Your Docs List.

An example of attaching files from Drive is provided in the documentation for MailApp.sendEmail().



来源:https://stackoverflow.com/questions/20251169/google-form-submit-attach-new-responses-to-email-and-send

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!