简体   繁体   English

如何在Google表格中自动填写受访者的电子邮件地址?

[英]How to autofill respondent's email addresses in Google Forms?

So, I would like that when I send an email via a Google Form (now it is possible to embed the whole form automatically in the message - I usually do this) the email of the recipient would already be filled within the appropriate field. 所以,我希望当我通过Google表单发送电子邮件时(现在可以在邮件中自动嵌入整个表单 - 我通常这样做)收件人的电子邮件已经填写在相应的字段中。 It should still be possible for the respondent(s) to change it in case They wish to use a different address for receiving a comfirmation email. 如果被访者希望使用不同的地址接收确认电子邮件,则应该仍然可以对其进行更改。

In the case of multiple recipients, each recipient should obviously have Their own email address autofilled. 对于多个收件人,每个收件人显然应该自己填写自己的电子邮件地址。

Visually (being a freshling, I haven't got the reputation to directly embed the image): 视觉上(作为一个新鲜的,我没有直接嵌入图像的声誉):

The highlighted part in the image should automatically be filled, based on the email address the form was sent to. 图像中突出显示的部分应根据表单发送到的电子邮件地址自动填充。

I'm sure that this should be done trough scripts, but Im not adept enough with scripting yet. 我确信这应该通过脚本来完成,但我还不熟悉脚本。 I found this , but that doesn't quite do, mostly because I don't wat to use pre-defined contact lists. 我发现了这一点 ,但事实并非如此,主要是因为我没有使用预先定义的联系人列表。

Did I manage to be clear enough? 我是否设法足够清楚了? :) This is my first question, I hope I managed to put it on a par with expectations. :)这是我的第一个问题,我希望我能把它与期望相提并论。

First of all open script editor of the form and paste the following code: 首先打开表单的脚本编辑器并粘贴以下代码:

function myFunction() {
      var form = FormApp.openById(YOUR_FORM_ID);
      var items = form.getItems();
      var url = form.createResponse().withItemResponse(items[1].asTextItem().createResponse(Session.getActiveUser().getEmail())).toPrefilledUrl());  //items[1] is the input question for email ID

      Logger.log(url);
    }

Now, run this code and check your logs( Ctrl + Enter ) and you will be able to see a URL. 现在,运行此代码并检查日志( Ctrl + Enter ),您将能够看到一个URL。 Paste that in your browser and you will get prefilled and link. 将其粘贴到浏览器中,您将获得预填充和链接。 Hope it helps. 希望能帮助到你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何限制用户在RS Forms Joomla中注册公司电子邮件地址以外的公共电子邮件地址 - How to restrict users from Registering public email addresses other than company email address in RS Forms Joomla 如何通过电子邮件以PDF格式发送Google表单的回复? - How to send Response of Google forms as a PDF by Email? Orbeon表单-单个电子邮件地址控件中的多个电子邮件地址 - Orbeon Forms - Multiple email addresses in a single email address control 将电子邮件从多个电子邮件表单发送到多个电子邮件地址 - Send emails from several email forms to several email addresses 如何在Paypal上自动填写电子邮件字段? - How can I autofill the email field on paypal? 如何为网站创建电子邮件地址 - How to create email addresses for a website 如何在名称列表和电子邮件地址列表中匹配名称和电子邮件地址? - How to match names and email addresses in a list of names and a list of email addresses? 当前验证表单中电子邮件地址的最佳实践是什么? - What are the current best practices for validating email addresses in forms? 使用 Google 表格中某列中的电子邮件地址发送电子邮件 - Send an email using email addresses from a column in Google sheets 两个联系表格,发送到两个不同的电子邮件地址 - Two contact forms, send to two different email addresses
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM