pub trait WebhookPayloadBuilder: Send + Sync {
// Required method
fn build_payload(
&self,
title: &str,
body_template: &str,
variables: &HashMap<String, String>,
) -> Value;
}
Expand description
Trait for building webhook payloads.
Required Methods§
Sourcefn build_payload(
&self,
title: &str,
body_template: &str,
variables: &HashMap<String, String>,
) -> Value
fn build_payload( &self, title: &str, body_template: &str, variables: &HashMap<String, String>, ) -> Value
Builds a webhook payload by formatting the template and applying channel-specific rules.
§Arguments
title
- The raw title of the message.body_template
- The message body template with variables like${...}
.variables
- The map of variables to substitute into the template.
§Returns
A serde_json::Value
representing the payload.