story-kit: merge 322_story_whatsapp_24_hour_messaging_window_and_template_support
This commit is contained in:
@@ -372,6 +372,10 @@ pub async fn run_bot(
|
||||
Arc::new(crate::whatsapp::WhatsAppTransport::new(
|
||||
config.whatsapp_phone_number_id.clone().unwrap_or_default(),
|
||||
config.whatsapp_access_token.clone().unwrap_or_default(),
|
||||
config
|
||||
.whatsapp_notification_template
|
||||
.clone()
|
||||
.unwrap_or_else(|| "pipeline_notification".to_string()),
|
||||
))
|
||||
}
|
||||
_ => {
|
||||
@@ -1396,7 +1400,7 @@ mod tests {
|
||||
ambient_rooms: Arc::new(std::sync::Mutex::new(HashSet::new())),
|
||||
agents: Arc::new(AgentPool::new_test(3000)),
|
||||
htop_sessions: Arc::new(TokioMutex::new(HashMap::new())),
|
||||
transport: Arc::new(crate::whatsapp::WhatsAppTransport::new("test-phone".to_string(), "test-token".to_string())),
|
||||
transport: Arc::new(crate::whatsapp::WhatsAppTransport::new("test-phone".to_string(), "test-token".to_string(), "pipeline_notification".to_string())),
|
||||
};
|
||||
// Clone must work (required by Matrix SDK event handler injection).
|
||||
let _cloned = ctx.clone();
|
||||
|
||||
@@ -80,6 +80,13 @@ pub struct BotConfig {
|
||||
/// and configure it in the Meta webhook settings).
|
||||
#[serde(default)]
|
||||
pub whatsapp_verify_token: Option<String>,
|
||||
/// Name of the approved Meta message template used for pipeline
|
||||
/// notifications when the 24-hour messaging window has expired.
|
||||
///
|
||||
/// The template must be registered in the Meta Business Manager before
|
||||
/// use. Defaults to `"pipeline_notification"`.
|
||||
#[serde(default)]
|
||||
pub whatsapp_notification_template: Option<String>,
|
||||
}
|
||||
|
||||
fn default_transport() -> String {
|
||||
|
||||
Reference in New Issue
Block a user