如何自动发送,自动生成的Google表单链接/URL

发布于 2025-02-10 00:37:15 字数 236 浏览 2 评论 0原文

使用Google Apps脚本,我编写了一些代码,这些代码将自动生成Google表单和链接到表格的电子表格以收集响应。同样,在应用程序脚本中使用触发器,我将此脚本设置为自动每周生成表单。一切都按预期工作。

我希望该自动生成的表单的URL不用打开表单并使用“发送”按钮将链接/URL作为电子邮件发送,而是希望该URL在生成后自动发送到特定的电子邮件。到目前为止,搜索很多都找不到任何线索。这甚至可以,如果是这样,请确实帮助找到解决方案。 tia。

using google apps script i wrote some code that will auto generate google form and a spreadsheet linked to the form to collect responses. also using triggers in apps script i set this script to auto generate a form every week. Everything is working as expected.

Instead of opening the form and using 'send' button to send the link/url as e-mail, i want the url of this auto generated form to be sent to a specific email automatically, as soon as it gets generated. searched a lot couldn't find any leads so far. Is this even possible, if so please do help in finding the solution. TIA.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

把回忆走一遍 2025-02-17 00:37:15

我相信您的目标如下。

  • 您需要创建一个新的Google表单并检索创建的Google表单的已发布链接。而且,您想将其作为电子邮件发送。
  • 您想使用Google Apps脚本来实现此目标。

在这种情况下,以下示例脚本怎么样?

示例脚本:

function myFunction() {
  const form = FormApp.create("sample form"); // Create a new Google Form.
  
  // Retrieve published URL.
  const url = form.getPublishedUrl();
  
  // Send the URL as an email.
  MailApp.sendEmail({
    to: "###", // Please set the email address.
    subject: "sample subject",
    body: url
  });
}
  • 运行此示例脚本时,创建了新的Google表单,并且已发布的U​​RL作为电子邮件发送。

  • 这是一个简单的示例脚本。因此,请为您的实际情况进行修改。

参考:

I believe your goal is as follows.

  • You want to create a new Google Form and retrieve the published link of the created Google Form. And, you want to send it as an email.
  • You want to achieve this using Google Apps Script.

In this case, how about the following sample script?

Sample script:

function myFunction() {
  const form = FormApp.create("sample form"); // Create a new Google Form.
  
  // Retrieve published URL.
  const url = form.getPublishedUrl();
  
  // Send the URL as an email.
  MailApp.sendEmail({
    to: "###", // Please set the email address.
    subject: "sample subject",
    body: url
  });
}
  • When this sample script is run, a new Google Form is created and the published URL is sent as an email.

  • This is a simple sample script. So, please modify this for your actual situation.

References:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文