From 3f3ecc53205ecc4b48d7c15708354024e8d519bc Mon Sep 17 00:00:00 2001 From: "Rodrigo Rodriguez (Pragmatismo)" Date: Sat, 4 Apr 2026 18:13:46 -0300 Subject: [PATCH] fix: make email tracking and draft saving non-fatal for bots without those tables --- src/basic/keywords/send_mail.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/basic/keywords/send_mail.rs b/src/basic/keywords/send_mail.rs index b9424f2f..fa78dec4 100644 --- a/src/basic/keywords/send_mail.rs +++ b/src/basic/keywords/send_mail.rs @@ -332,7 +332,9 @@ async fn execute_send_mail( ) -> Result { let message_id = Uuid::new_v4().to_string(); - track_email(state, user, &message_id, to, subject, "sent")?; + track_email(state, user, &message_id, to, subject, "sent").unwrap_or_else(|e| { + log::warn!("Email tracking skipped (table may not exist): {}", e); + }); if let Some(account_email) = using_account { let creds = get_account_credentials(&state.conn, &account_email, user.bot_id) @@ -367,7 +369,9 @@ async fn execute_send_mail( } } - save_email_draft(state, user, to, subject, body, attachments)?; + save_email_draft(state, user, to, subject, body, attachments).unwrap_or_else(|e| { + log::warn!("Email draft not saved (table may not exist): {}", e); + }); Ok(format!("Email saved as draft: {}", message_id)) }