This script runs on Google Apps Script, and it handles:
- Adding new form submissions to the
db_actifsheet - Sending a bi-monthly summary email of newly paid EPFL students to the manager
- Sending confirmation emails to students after EPFL has activated their access rights
- A student submits the form.
onFormSubmit(e)runs automatically.- A new row is added to
db_actif. - When the student pays, the payment information is entered in
salles_piano_paiement. - On the 1st and 15th of each month,
sendBiMonthlyReport()sends an internal summary email with newly paid EPFL students whosesummary_sentvalue is stillFALSE. - After the summary email is sent successfully, the script updates:
summary_sent = TRUE
- The manager uses this summary email to request access rights from EPFL.
- Once EPFL has activated the access rights, the manager changes:
access_granted: FALSE -> TRUE
onEdit(e)detects this change and sends the confirmation email to the student.- After the confirmation email is sent successfully, the script updates:
mail_sent = TRUE
| Column | Meaning |
|---|---|
salles_piano_paiement |
Payment date or payment confirmation. If this field is filled, the student can be included in the next summary email. |
summary_sent |
Indicates whether the student has already been included in the internal bi-monthly summary email. This prevents the same student from being listed multiple times. |
access_granted |
Indicates whether EPFL has actually activated the student's access rights. Changing this from FALSE to TRUE triggers the confirmation email. |
mail_sent |
Indicates whether the confirmation email has already been sent to the student. This prevents duplicate confirmation emails. |
| Type | Function Name | Description |
|---|---|---|
| On form submit | onFormSubmit |
Adds new form submissions to db_actif |
| On edit | onEdit |
Sends the confirmation email when access_granted is changed from FALSE to TRUE |
| Time-driven | sendBiMonthlyReport |
Sends a summary email of newly paid EPFL students on the 1st and 15th of each month |
For students who were already fully processed before this automation was introduced, set the three status columns to:
| Column | Value |
|---|---|
summary_sent |
TRUE |
access_granted |
TRUE |
mail_sent |
TRUE |
This marks them as already processed and prevents duplicate summary entries or confirmation emails.
Click the row number on the left, then right click and select "Delete row" (not "Clear row").
Warning
Do not add empty rows at the end of the db_actif sheet. They may be interpreted as valid data.
- Go to Extensions > Apps Script, then open the
Code.jsfile. - The
htmlBodyinsideonEditis the content of the confirmation email sent to students. - The
bodyinsidesendBiMonthlyReportis the content of the internal summary email.

