fix: remove unused get_smtp_config, add missing imports
Some checks failed
BotServer CI/CD / build (push) Failing after 5m31s
Some checks failed
BotServer CI/CD / build (push) Failing after 5m31s
This commit is contained in:
parent
8fcd57bc78
commit
cb8a3fa75a
1 changed files with 5 additions and 13 deletions
|
|
@ -10,6 +10,11 @@ use std::sync::Arc;
|
||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
|
|
||||||
use crate::core::shared::state::AppState;
|
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)]
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
pub struct EmailCampaignPayload {
|
pub struct EmailCampaignPayload {
|
||||||
|
|
@ -55,19 +60,6 @@ pub struct CampaignMetrics {
|
||||||
pub bounce_rate: f64,
|
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 {
|
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_url = format!("{}/api/marketing/track/open/{}", base_url, token);
|
||||||
let pixel = format!(
|
let pixel = format!(
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue