# ChatPulse .NET SDK (Preview)

Official C# SDK for ChatPulse Email + WhatsApp APIs.

## Install (local source)

```bash
dotnet add reference ./ChatPulse.Sdk.csproj
```

## Quick start

```csharp
using ChatPulse.Sdk;
using ChatPulse.Sdk.Models;

var cp = new ChatPulseClient("cp_live_123");

await cp.Emails.SendAsync(new EmailSendRequest
{
    From = "Acme <hello@acme.com>",
    To = new[] { "user@example.com" },
    Subject = "Your receipt from Acme",
    Html = "<h1>Thank you!</h1>",
    Tags = new[] { "receipt", "q3" }
});

await cp.WhatsApp.Messages.SendAsync(new WhatsAppMessageSendRequest
{
    SessionId = "sess_abc123",
    To = "+1234567890",
    Type = "template",
    Template = new TemplatePayload
    {
        Name = "otp_verification",
        Components = new object[] { new { type = "body", parameters = new[] { "123456" } } }
    }
});
```

## Notes

- API base URL defaults to `https://getchatpulse.in/api/v1`.
- For local/self-hosted, pass a custom base URL to `ChatPulseClient`.
- Current ChatPulse backend supports `/messages/send` as text payload. Template sends are mapped to text until a native template endpoint is exposed.
