fix: log EmailService::send_email errors instead of silently discarding
All checks were successful
BotServer CI/CD / build (push) Successful in 4m26s

This commit is contained in:
Rodrigo Rodriguez (Pragmatismo) 2026-04-04 19:03:19 -03:00
parent dde6ac236e
commit 61ae0cac82

View file

@ -350,7 +350,7 @@ async fn execute_send_mail(
let email_service = EmailService::new(Arc::new(state.clone()));
if email_service
match email_service
.send_email(
to,
subject,
@ -361,12 +361,15 @@ async fn execute_send_mail(
} else {
Some(attachments.clone())
},
)
.is_ok()
{
trace!("Email sent successfully: {}", message_id);
) {
Ok(msg_id) => {
info!("Email sent successfully: {} to {}", msg_id, to);
return Ok(format!("Email sent: {}", message_id));
}
Err(e) => {
error!("EmailService::send_email failed: {}", e);
}
}
}
save_email_draft(state, user, to, subject, body, attachments).unwrap_or_else(|e| {