From 6d433265621ab9431f1d122b97372ba8613360d0 Mon Sep 17 00:00:00 2001 From: Moritz Graf Date: Sat, 25 Apr 2026 15:18:33 +0200 Subject: [PATCH] Fully working and finalized mail forwarding sync --- mail_forwarding/README.md | 2 ++ mail_forwarding/src/Code.js | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/mail_forwarding/README.md b/mail_forwarding/README.md index 06f2d1c..7adf199 100644 --- a/mail_forwarding/README.md +++ b/mail_forwarding/README.md @@ -58,6 +58,8 @@ Once configured, you need to create an Apps Script project in your Google Accoun clasp push ``` +> **⚠️ Important:** `clasp push` only uploads the code. It does **not** install or update the background triggers. You must always re-run the `setup` function in the Apps Script IDE after a push to ensure the triggers are active and up to date. + ## Step 4: Initialization The code is now in the cloud, but the background triggers need to be activated and the Admin SDK authorized. diff --git a/mail_forwarding/src/Code.js b/mail_forwarding/src/Code.js index cddd22f..87ae8d8 100644 --- a/mail_forwarding/src/Code.js +++ b/mail_forwarding/src/Code.js @@ -67,7 +67,12 @@ function setup() { .onChange() .create(); - console.log("Setup complete. The 'syncForwardings' trigger has been installed."); + // Verify and log the installed triggers so we can confirm the setup is correct + const installedTriggers = ScriptApp.getProjectTriggers(); + console.log(`Setup complete. ${installedTriggers.length} trigger(s) are now active:`); + for (const trigger of installedTriggers) { + console.log(` - Function: ${trigger.getHandlerFunction()}, Event: ${trigger.getEventType()}, Source: ${trigger.getTriggerSource()}`); + } } /**