fix: remove unused get_smtp_config, add missing imports
Some checks failed
BotServer CI/CD / build (push) Failing after 5m31s

This commit is contained in:
Rodrigo Rodriguez (Pragmatismo) 2026-04-04 22:52:32 -03:00
parent 8fcd57bc78
commit cb8a3fa75a

View file

@ -10,6 +10,11 @@ use std::sync::Arc;
use uuid::Uuid;
use crate::core::shared::state::AppState;
use crate::core::shared::schema::{
email_tracking, marketing_campaigns, marketing_recipients,
};
use crate::email::EmailService;
use crate::marketing::campaigns::CrmCampaign;
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EmailCampaignPayload {
@ -55,19 +60,6 @@ pub struct CampaignMetrics {
pub bounce_rate: f64,
}
fn get_smtp_config(state: &AppState, bot_id: Uuid) -> Result<(String, u16, String, String, String), String> {
let secrets = crate::core::secrets::SecretsManager::from_env()
.map_err(|e| format!("Vault not available: {}", e))?;
let (smtp_host, smtp_port, smtp_user, smtp_pass, smtp_from) =
secrets.get_email_config_for_bot_sync(&bot_id);
if smtp_from.is_empty() {
return Err("SMTP not configured: set email credentials in Vault".into());
}
Ok((smtp_host, smtp_port, smtp_from, smtp_user, smtp_pass))
}
fn inject_tracking_pixel(html: &str, token: Uuid, base_url: &str) -> String {
let pixel_url = format!("{}/api/marketing/track/open/{}", base_url, token);
let pixel = format!(