Email Marketing Agent

AI agent for creating, managing, and optimizing email marketing campaigns with personalization and analytics

Available Skills

createCampaign

#1

Create a new email marketing campaign with personalized content and targeting

email marketing campaigns automation analytics personalization

analyzePerformance

#2

Analyze email campaign performance and provide optimization recommendations

email marketing campaigns automation analytics personalization

optimizeSubjectLine

#3

Generate and test optimized subject lines using AI and A/B testing

email marketing campaigns automation analytics personalization

Integration Examples

// A2A Java Client Example
// Source: https://github.com/a2aproject/a2a-samples/tree/main/samples/java/client

import com.google.a2a.client.*;
import com.google.a2a.model.*;
import java.util.List;
import java.util.Map;
import java.util.UUID;

public class AgentClientExample {
    public static void main(String[] args) {
        // Create client pointing to your agent
        A2AClient client = new A2AClient("https://email-marketing.example.com/a2a");
        
        try {
            // Get agent card
            System.out.println("=== Getting Agent Card ===");
            AgentCard agentCard = client.getAgentCard();
            System.out.println("Agent: " + agentCard.name());
            System.out.println("Description: " + agentCard.description());
            System.out.println("Version: " + agentCard.version());
            System.out.println("Skills: " + agentCard.skills());
            
            // Send a task to the agent
            TextPart textPart = new TextPart("Your input text here", null);
            
            Message message = new Message(
                UUID.randomUUID().toString(),  // messageId
                "message",                     // kind
                "user",                        // role
                List.of(textPart),            // parts
                null, null, null, null        // contextId, taskId, etc.
            );
            
            TaskSendParams params = new TaskSendParams(
                "createCampaign-task",
                null,  // sessionId
                message,
                null,  // pushNotification
                null,  // historyLength
                Map.of()  // metadata
            );
            
            JSONRPCResponse response = client.sendTask(params);
            Task task = (Task) response.result();
            System.out.println("Task ID: " + task.id());
            System.out.println("Status: " + task.status().state());
            
        } catch (A2AClientException e) {
            System.err.println("A2A Client Error: " + e.getMessage());
            e.printStackTrace();
        }
    }
}

View full Java examples on GitHub

# A2A Python Client Example
# Source: https://github.com/a2aproject/a2a-samples/tree/main/samples/python

import asyncio
import httpx
from uuid import uuid4
from a2a.client import A2ACardResolver, A2AClient
from a2a.types import (
    AgentCard,
    Message,
    MessageSendParams,
    Part,
    Role,
    SendStreamingMessageRequest,
    TextPart,
)

class AgentClient:
    def __init__(self, agent_url: str):
        self.agent_url = agent_url
    
    async def get_agent_card(self) -> AgentCard:
        """Get the agent card information."""
        async with httpx.AsyncClient() as httpx_client:
            card_resolver = A2ACardResolver(httpx_client, self.agent_url)
            return await card_resolver.get_agent_card()
    
    async def send_message(self, message_text: str):
        """Send a message to the agent and get streaming response."""
        async with httpx.AsyncClient() as httpx_client:
            # Get agent card first
            agent_card = await self.get_agent_card()
            client = A2AClient(httpx_client, agent_card=agent_card)
            
            # Create message
            message = MessageSendParams(
                message=Message(
                    role=Role.user,
                    parts=[Part(TextPart(text=message_text))],
                    messageId=uuid4().hex,
                    taskId=uuid4().hex,
                )
            )
            
            # Send streaming message
            streaming_request = SendStreamingMessageRequest(
                id=str(uuid4().hex),
                params=message
            )
            
            async for chunk in client.send_message_streaming(streaming_request):
                if hasattr(chunk.root, 'result') and hasattr(chunk.root.result, 'status'):
                    message = chunk.root.result.status.message
                    if message and message.parts:
                        yield message.parts[0].root.text

async def main():
    """Example usage of the agent client."""
    client = AgentClient("https://email-marketing.example.com/a2a")
    
    # Get agent information
    agent_card = await client.get_agent_card()
    print(f"Agent: {agent_card.name}")
    print(f"Description: {agent_card.description}")
    
    # Send a message and stream the response
    async for response_chunk in client.send_message("Your input text here"):
        print(response_chunk, end='', flush=True)

if __name__ == '__main__':
    asyncio.run(main())

View full Python examples on GitHub

Agent Configuration

Complete JSON configuration for this agent:

{
  "capabilities": {
    "pushNotifications": false,
    "streaming": false
  },
  "defaultInputModes": [
    "application/json",
    "text/plain"
  ],
  "defaultOutputModes": [
    "application/json",
    "text/html"
  ],
  "description": "AI agent for creating, managing, and optimizing email marketing campaigns with personalization and analytics",
  "filename": "email-marketing-agent.json",
  "name": "Email Marketing Agent",
  "protocolVersion": "0.2.6",
  "provider": {
    "organization": "Marketing Automation Team",
    "url": "https://example.com"
  },
  "skills": [
    {
      "description": "Create a new email marketing campaign with personalized content and targeting",
      "examples": [
        "Example usage of createCampaign",
        "How to use createCampaign skill",
        "createCampaign demonstration"
      ],
      "id": "createCampaign",
      "name": "createCampaign",
      "tags": [
        "email",
        "marketing",
        "campaigns",
        "automation",
        "analytics",
        "personalization"
      ]
    },
    {
      "description": "Analyze email campaign performance and provide optimization recommendations",
      "examples": [
        "Example usage of analyzePerformance",
        "How to use analyzePerformance skill",
        "analyzePerformance demonstration"
      ],
      "id": "analyzePerformance",
      "name": "analyzePerformance",
      "tags": [
        "email",
        "marketing",
        "campaigns",
        "automation",
        "analytics",
        "personalization"
      ]
    },
    {
      "description": "Generate and test optimized subject lines using AI and A/B testing",
      "examples": [
        "Example usage of optimizeSubjectLine",
        "How to use optimizeSubjectLine skill",
        "optimizeSubjectLine demonstration"
      ],
      "id": "optimizeSubjectLine",
      "name": "optimizeSubjectLine",
      "tags": [
        "email",
        "marketing",
        "campaigns",
        "automation",
        "analytics",
        "personalization"
      ]
    }
  ],
  "slug": "email-marketing-agent",
  "url": "https://email-marketing.example.com/a2a",
  "version": "3.1.2"
}

Agent Details

Version v3.1.2
Provider Marketing Automation Team
Capabilities
Skills Count 3 available