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 <noreply@anthropic.com>

* test: name smtp regression test after what it guards

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
hugocasa
2026-09-28 17:18:48 +02:00
committed by GitHub
co-authored by Claude Opus 5.5
parent 990a726409
commit 60ef82196e
@@ -477,6 +477,8 @@ pub struct SmtpSettings {
pub smtp_tls_implicit: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub smtp_disable_tls: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub smtp_clicktracking_off: Option<bool>,
}
// ---------------------------------------------------------------------------
@@ -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
// -----------------------------------------------------------------------