在电子邮件中嵌入Google表单? [英] Embedded Google form in email?

查看:136
本文介绍了在电子邮件中嵌入Google表单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过Google应用程序脚本在电子邮件中嵌入了Google表单,但表单并未从Outlook和iPhone正确提交。它仅适用于Google Mail客户端?

I'm embedded Google form in email by Google apps script but the form doesn't submit correctly from Outlook and from iPhone. It works from Google Mail client only?

是否有解决iphone或outlook提交的问题?

Is there's away to solve this problem of submission from iphone or outlook?

感谢
Amany

Thanks Amany

推荐答案

要使用电子邮件中嵌入的表单,电子邮件客户端需要支持html表单。 Outlook有它自己的形式,但不支持html表单元素(参考资料)。我还没有找到iPhone的参考,但它可能也限制了对html的支持。 (我在手机上使用Gmail客户端......它支持表单)。

To use forms embedded in emails, the email client needs to support html forms. Outlook has its own forms, but does not support the html form element (reference). I haven't found a reference for iPhone, but it's likely that it also limits the html support. (I use the gmail client on my phone... it supports forms.)

如果您使用通过电子邮件发送表单并在电子表格中跟踪回复,那么您可以扩展您的脚本,为其电子邮件客户端中没有HTML表单支持的用户提供 doGet 函数。

If you're using the code from Send form by email and track responses in spreadsheet, then you can extend your script to provide a doGet function for users that don't have HTML Forms support in their email clients.

以前的要点已经更新了这些更改。 (实际上,要点已经具有 doGet()函数。)

The previous gist has been updated with these changes. (Actually, the gist already had the doGet() function.)

通过添加 doGet()函数来扩展此代码,该函数将托管您嵌入到电子邮件中的完全相同的表单。

Extend this code by adding a doGet() function, which will host the exact same form that you're embedding in the email.

/**
 * GET handler to provide alternate online form.
 */
function doGet() {
  // Build survey body
  var template = HtmlService.createTemplateFromFile('emailTemplate');
  template.scriptUrl = ScriptApp.getService().getUrl();
  template.serialNumber = getGUID();  // Generate serial number for this response
  var app = template.evaluate();
  return app;
}

sendSurvey() / code>函数:

Make the following modification to the sendSurvey() function:

var plainText = 'Please complete this survey online at: ' + scriptUrl;
html += '<p>Alternatively, you may <A href="' + scriptUrl + '"> complete this survey online.</A>';

// Send email form
GmailApp.sendEmail(recipient, subject, plainText, {htmlBody:html} );

现在,在他们的电子邮件客户端中没有HTML支持的收件人将收到一封纯文本消息,粘贴到浏览器中,而没有< FORM> 支持的HTML客户端将有可点击的链接到在线表单。

Now, recipients without HTML support in their email client will have a plain text message with an address they can paste into a browser, while HTML clients without <FORM> support will have a clickable link to the online form.

这篇关于在电子邮件中嵌入Google表单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆