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 つのスクリプト ファイルと 5 つの HTML ファイルが作成されます。
各ファイルの内容を次の対応するコードに置き換え、[保存]
をクリックします。
respondentNotification.html
スクリプトを実行する
- フォームに戻ってページを更新します。
- フォームに記述式の質問を追加します。[無題の質問] に「メールアドレス」と入力します。必要に応じて、他のフォームの質問を作成できます。
- アドオン アイコン extension
> [フォームの通知] をクリックします。アドオン extension が表示されるまでに数秒かかることがあります。
- ダイアログで、[通知を構成] をクリックします。
- メッセージが表示されたら、アドオンを承認します。
- もう一度、アドオン extension
> [フォームの通知]
> [通知を設定] をクリックします。
- アドオンで [通知を受け取る] チェックボックスをオンにして、メールアドレスを入力します。
- [Send notifications after every] に「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,[]]