Novu’s .NET SDK provides simple, yet comprehensive notification management, and delivery capabilities through multiple channels that you can implement using code that integrates seamlessly with your C#/.NET application.
using Novu.DTO;
using Novu.Models;
using Novu;
...
var novuConfiguration = new NovuClientConfiguration
{
Url = "https://novu-api.my-domain.com/v1",
ApiKey = "12345",
};
var novu = new NovuClient(novuConfiguration);
public class OnboardEventPayload
{
[JsonProperty("username")]
public string Username { get; set; }
[JsonProperty("welcomeMessage")]
public string WelcomeMessage { get; set; }
}
var onboardingMessage = new OnboardEventPayload
{
Username = "jdoe",
WelcomeMessage = "Welcome to novu-dotnet"
};
var payload = new EventTriggerDataDto()
{
EventName = "onboarding",
To = { SubscriberId = "subscriberId" },
Payload = onboardingMessage
};
var trigger = await novu.Event.Trigger(payload);
if (trigger.TriggerResponsePayloadDto.Acknowledged)
{
Console.WriteLine("Trigger has been created.");
}