send_campaign
Send an email campaign immediately to all contacts or specific segments using the Keila newsletter API. Confirm campaign ID before sending to ensure correct delivery.
Instructions
Send a campaign immediately to all contacts (or segment contacts).
WARNING: This sends real emails. Make sure the campaign content and recipient list are correct before calling this.
Args: campaign_id: The campaign ID (e.g. "mc_12345").
Returns: Delivery queued confirmation.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| campaign_id | Yes |
Implementation Reference
- mcp_server.py:186-200 (handler)MCP tool registration for send_campaign in mcp_server.py.
@mcp.tool() def send_campaign(campaign_id: str) -> dict: """ Send a campaign immediately to all contacts (or segment contacts). WARNING: This sends real emails. Make sure the campaign content and recipient list are correct before calling this. Args: campaign_id: The campaign ID (e.g. "mc_12345"). Returns: Delivery queued confirmation. """ return _client.send_campaign(campaign_id) - client.py:161-166 (handler)Actual implementation of send_campaign using the Keila API.
def send_campaign(self, campaign_id: str) -> dict: """Send a campaign immediately.""" resp = self.session.post(f"{self.url}/api/v1/campaigns/{campaign_id}/actions/send", headers=self._headers(), timeout=30) resp.raise_for_status() return resp.json()