Google フォーム エディタ アドオンのクイックスタート
このクイックスタートでは、ユーザーがフォームに回答したときにトリガーを使用してメールを送信する Google フォーム エディタ アドオンを作成します。
目標
- スクリプトを設定します。
- スクリプトを実行します。
前提条件
このサンプルを使用するには、次の前提条件を満たしている必要があります。
- Google アカウント(Google Workspace アカウントの場合、管理者の承認が必要となる可能性があります)。
- インターネットに接続できるウェブブラウザ。
スクリプトを設定する
- forms.new で Google フォームを作成します。
- その他アイコン more_vert
> [スクリプト エディタ] をクリックします。
- [無題のプロジェクト] をクリックします。
- Apps Script プロジェクトの名前を Forms notifications に変更して、[名前を変更] をクリックします。
- ファイルの追加アイコン add
> [HTML] をクリックします。ファイル名を
sidebar
とします。
- 手順 5 を繰り返して、
about
、authorizationEmail
、creatorNotification
、respondentNotification
という名前の HTML ファイルを 4 つ作成します。完了すると、スクリプト ファイルが 1 つと HTML ファイルが 5 つ作成されます。
各ファイルの内容を次の対応するコードに置き換えて、[保存]
をクリックします。
スクリプトを実行する
- フォームに戻り、ページを更新します。
- フォームに記述式のテキスト質問を追加します。[無題の質問] に「メールアドレス」と入力します。必要に応じて、他のフォームの質問を作成することもできます。
- アドオン extension
> [フォーム通知] をクリックします。アドオン extension が表示されるまでに数秒かかることがあります。
- ダイアログで [通知を設定] をクリックします。
- メッセージが表示されたら、アドオンを承認します。
- アドオン アイコン extension
> [フォーム通知] > [通知を設定] をクリックします。
- アドオンで [通知を受け取る] チェックボックスをオンにして、メールアドレスを入力します。
- [Send notifications after every] に「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"]]