Send Confirmation Email with Google Forms / Spreadsheets
I know that Google Spreadsheets includes a mass mailout option with its MailApp.sendEmail function, but, as far as I know, it can only run once a form is opened, or by manually clicking "run".
I have a Google form which includes an area for someone to put their email address. Is there a simple solution to send this data to its Google Spreadsheet and send it as a confirmation to the specified email address? It would be great if I could somehow incorporate MailApp.sendEmail into the form, instead of into the spreadsheet (which would be after the fact and manual, instead of instant and automatic).
Also, note that I w开发者_运维知识库ill be posting with jQuery.
Any ideas?
I created a php script to process the php form fields and send them back to google. On the php code you can add add captcha, field validation, email confirmation messages, even attachments. http://www.jazzerup.com/blog/item/googleforms
The solution is to have multiple actions with Javascript. I found this on http://www.codeproject.com/KB/scripting/multiact.aspx. Here's the code:
<form name=Form1 action= "login1.php" method=post>
Username <input type="text" name="username">
Password <input type="password" name="password">
<input type="submit" value="Send" name="button1"
onclick="return OnButton1();">
<script language="javascript">
<!--
function OnButton1()
{
document.Form1.action = "login2.php" // First target
document.Form1.target = "iframe1"; // Open in a iframe
document.Form1.submit(); // Submit the page
document.Form1.action = "page3.php" // Second target
document.Form1.target = "iframe2"; // Open in a iframe
document.Form1.submit(); // Submit the page
return true;
}
-->
</script>
<div style="visibility:hidden">
<iframe NAME="iframe1" WIDTH="40" HEIGHT="40"></iframe>
<iframe NAME="iframe2" WIDTH="40" HEIGHT="40"></iframe>
</div>
One of the iframes can point to a Google form and one can point to your own PHP file that can handle the data (i.e. send an email to the person). Doing it this way can also allow you to handle the "Thank you" page too, instead of sending them to Google's thank you page.
精彩评论