เริ่มต้นใช้งานส่วนเสริมของเครื่องมือแก้ไข Google ฟอร์ม
เริ่มต้นใช้งานนี้จะสร้างส่วนเสริมของเครื่องมือแก้ไข Google ฟอร์มที่ใช้ทริกเกอร์เพื่อส่งอีเมลเมื่อผู้ใช้ตอบแบบฟอร์ม
วัตถุประสงค์
- ตั้งค่าสคริปต์
- เรียกใช้สคริปต์
ข้อกำหนดเบื้องต้น
หากต้องการใช้ตัวอย่างนี้ คุณต้องมีข้อกําหนดเบื้องต้นต่อไปนี้
- บัญชี Google (บัญชี Google Workspace อาจต้องได้รับอนุมัติจากผู้ดูแลระบบ)
- เว็บเบราว์เซอร์ที่มีการเข้าถึงอินเทอร์เน็ต
ตั้งค่าสคริปต์
- สร้างแบบฟอร์ม Google ฟอร์มที่ forms.new
- คลิกเพิ่มเติม more_vert
> เครื่องมือแก้ไขสคริปต์
- คลิกโปรเจ็กต์ที่ไม่มีชื่อ
- เปลี่ยนชื่อโปรเจ็กต์ Apps Script การแจ้งเตือนแบบฟอร์ม แล้วคลิกเปลี่ยนชื่อ
- คลิกเพิ่มไฟล์ add
> HTML ตั้งชื่อไฟล์เป็น
sidebar
- ทำซ้ำขั้นตอนที่ 5 เพื่อสร้างไฟล์ HTML อีก 4 ไฟล์ชื่อ
about
,
authorizationEmail
, creatorNotification
และ respondentNotification
เมื่อเสร็จแล้ว คุณควรมีไฟล์สคริปต์ 1 ไฟล์และไฟล์ HTML 5 ไฟล์
แทนที่เนื้อหาของไฟล์แต่ละไฟล์ด้วยโค้ดที่เกี่ยวข้องต่อไปนี้ แล้วคลิกบันทึก 
เรียกใช้สคริปต์
- กลับไปที่แบบฟอร์มแล้วรีเฟรชหน้า
- เพิ่มคำถามแบบข้อความคำตอบสั้นๆ ลงในแบบฟอร์ม ในคำถามที่ไม่มีชื่อ ให้ป้อนอีเมล คุณสร้างคำถามแบบฟอร์มอื่นๆ หรือไม่ก็ได้
- คลิกส่วนเสริม extension
> การแจ้งเตือนแบบฟอร์ม
ระบบอาจใช้เวลาหลายวินาทีจึงจะแสดงส่วนเสริม
extension
- ในกล่องโต้ตอบ ให้คลิกกำหนดค่าการแจ้งเตือน
- ให้สิทธิ์ส่วนเสริมเมื่อได้รับข้อความแจ้ง
- คลิกส่วนเสริม extension
> การแจ้งเตือนแบบฟอร์ม
> กำหนดค่าการแจ้งเตือน
- ในส่วนเสริม ให้เลือกช่องแจ้งเตือนฉัน แล้วป้อนอีเมล
- ป้อน 1 สำหรับส่งการแจ้งเตือนหลังจากทุก
- คลิกบันทึก
- หากต้องการส่งคำตอบ ให้คลิกแสดงตัวอย่าง visibility
- กรอกข้อมูลในแบบฟอร์ม และคลิกส่ง
- โปรดตรวจสอบการแจ้งเตือนในอีเมล
ขั้นตอนถัดไป
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-02-14 UTC
[null,null,["อัปเดตล่าสุด 2025-02-14 UTC"],[[["This Google Forms add-on automates email notifications to form creators and/or respondents upon submission."],["Customizable settings allow control over notification frequency, recipient emails, and content."],["The add-on utilizes Google Apps Script triggers to execute functions when the form is opened, installed, or submitted."],["Users configure notification preferences through a sidebar accessible within the Google Form."],["The script manages authorization to access Google services for sending emails and interacting with form data."]]],["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"]]