เริ่มต้นใช้งานส่วนเสริมของเครื่องมือแก้ไข Google ฟอร์ม
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
คู่มือเริ่มต้นฉบับย่อนี้จะสร้างส่วนเสริมของเอดิเตอร์ Google ฟอร์มที่ใช้ทริกเกอร์เพื่อ
ส่งอีเมลเมื่อผู้ใช้ตอบแบบฟอร์ม
วัตถุประสงค์
- ตั้งค่าสคริปต์
- เรียกใช้สคริปต์
ข้อกำหนดเบื้องต้น
หากต้องการใช้ตัวอย่างนี้ คุณต้องมีข้อกำหนดเบื้องต้นต่อไปนี้
- บัญชี Google (บัญชี Google Workspace อาจต้องได้รับการอนุมัติจากผู้ดูแลระบบ)
- เว็บเบราว์เซอร์ที่มีสิทธิ์เข้าถึงอินเทอร์เน็ต
ตั้งค่าสคริปต์
- สร้างแบบฟอร์ม Google ฟอร์มที่ forms.new
- คลิกเพิ่มเติม more_vert
> โปรแกรมแก้ไขสคริปต์
- คลิกโปรเจ็กต์ที่ไม่มีชื่อ
- เปลี่ยนชื่อโปรเจ็กต์ Apps Script เป็น Forms notifications แล้วคลิกเปลี่ยนชื่อ
- คลิกเพิ่มไฟล์ add
> HTML ตั้งชื่อไฟล์
sidebar
- ทำซ้ำขั้นตอนที่ 5 เพื่อสร้างไฟล์ HTML อีก 4 ไฟล์ชื่อ
about
,
authorizationEmail
, creatorNotification
และ respondentNotification
เมื่อเสร็จแล้ว คุณควรมีไฟล์สคริปต์ 1 ไฟล์และไฟล์ HTML 5 ไฟล์
แทนที่เนื้อหาของแต่ละไฟล์ด้วยโค้ดที่สอดคล้องต่อไปนี้ จากนั้นคลิกบันทึก 
respondentNotification.html
เรียกใช้สคริปต์
- กลับไปที่แบบฟอร์มแล้วรีเฟรชหน้าเว็บ
- เพิ่มคำถามแบบข้อความคำตอบสั้นๆ ลงในแบบฟอร์ม ในคำถามที่ไม่มีชื่อ
ให้ป้อนอีเมล คุณเลือกสร้างคำถามอื่นๆ ในแบบฟอร์มได้
- คลิกส่วนเสริม extension
> การแจ้งเตือน
ของแบบฟอร์ม ส่วนเสริม
extensionอาจใช้เวลาหลายวินาทีจึงจะปรากฏ
- ในกล่องโต้ตอบ ให้คลิกกำหนดค่าการแจ้งเตือน
- ให้สิทธิ์ส่วนเสริมเมื่อได้รับข้อความแจ้ง
- อีกครั้ง ให้คลิกส่วนเสริม extension
> การแจ้งเตือนของแบบฟอร์ม
> กำหนดค่าการแจ้งเตือน
- ในส่วนเสริม ให้เลือกช่องแจ้งเตือนฉัน แล้วป้อนอีเมล
- สำหรับส่งการแจ้งเตือนหลังจากทุกๆ ให้ป้อน 1
- คลิกบันทึก
- หากต้องการส่งคำตอบ ให้คลิกแสดงตัวอย่าง visibility
- กรอกข้อมูลในแบบฟอร์ม และคลิกส่ง
- โปรดตรวจสอบอีเมลเพื่อดูการแจ้งเตือน
ขั้นตอนถัดไป
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[null,null,["อัปเดตล่าสุด 2025-07-25 UTC"],[[["\u003cp\u003eThis Google Forms add-on automates email notifications to form creators and/or respondents upon submission.\u003c/p\u003e\n"],["\u003cp\u003eCustomizable settings allow control over notification frequency, recipient emails, and content.\u003c/p\u003e\n"],["\u003cp\u003eThe add-on utilizes Google Apps Script triggers to execute functions when the form is opened, installed, or submitted.\u003c/p\u003e\n"],["\u003cp\u003eUsers configure notification preferences through a sidebar accessible within the Google Form.\u003c/p\u003e\n"],["\u003cp\u003eThe script manages authorization to access Google services for sending emails and interacting with form data.\u003c/p\u003e\n"]]],["This Google Forms add-on automates email notifications upon form submissions. It notifies the form creator when a set number of responses are received and sends a custom message to respondents. Users configure notification frequency, recipient emails, and custom messages via a sidebar. The add-on manages authorization, sends re-authorization requests, and respects email quotas. Key actions include saving settings, managing triggers, handling form submissions, sending notifications, and validating user inputs. The code structure comprises the script (`code.gs`) and the HTML code (`sidebar.html`, `about.html`, `authorizationEmail.html`, `creatorNotification.html`, `respondentNotification.html`).\n"],null,[]]