From 60ef82196e014d39b0f497a9b8a88048d6e9792b Mon Sep 17 00:00:00 2001 From: hugocasa Date: Mon, 28 Sep 2026 17:18:48 +0200 Subject: [PATCH] fix: keep smtp_clicktracking_off when syncing instance config (#11372) * fix: keep smtp_clicktracking_off when syncing instance config Co-Authored-By: Claude Opus 5.5 * test: name smtp regression test after what it guards Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Claude Opus 5.5 --- backend/windmill-common/src/instance_config.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/backend/windmill-common/src/instance_config.rs b/backend/windmill-common/src/instance_config.rs index 8c8720c77a..264916d522 100644 --- a/backend/windmill-common/src/instance_config.rs +++ b/backend/windmill-common/src/instance_config.rs @@ -477,6 +477,8 @@ pub struct SmtpSettings { pub smtp_tls_implicit: Option, #[serde(skip_serializing_if = "Option::is_none")] pub smtp_disable_tls: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub smtp_clicktracking_off: Option, } // --------------------------------------------------------------------------- @@ -2282,6 +2284,20 @@ mod tests { assert_eq!(original.custom_tags, reconstructed.custom_tags); } + #[test] + fn smtp_settings_keep_clicktracking_off() { + let smtp = serde_json::json!({ + "smtp_host": "smtp.example.com", + "smtp_port": 587, + "smtp_tls_implicit": false, + "smtp_disable_tls": false, + "smtp_clicktracking_off": true, + }); + let settings: GlobalSettings = + serde_json::from_value(serde_json::json!({ "smtp_settings": smtp })).unwrap(); + assert_eq!(settings.to_settings_map()["smtp_settings"], smtp); + } + // ----------------------------------------------------------------------- // Serialization edge cases // -----------------------------------------------------------------------