Skip to content

tpraxedes/UnsendSDK

Repository files navigation

UnsendSDK 🚀

A C# SDK for interacting with the Unsend API. This library allows developers to easily send emails, manage contacts, and schedule messages.

Supported versions

  • Unsend 1.4.x
  • .NET Core 8.0
  • .NET Core 9.0
  • .NET Framework 4.8

📦 Installation

You can install the package from NuGet:

dotnet add package UnsendSDK --version 1.0.3

Or, using the NuGet Package Manager:

PM> NuGet\Install-Package UnsendSDK -Version 1.0.3

🚀 Usage Example

Initialize the Client

using UnsendSDK;

var client = new UnsendClient("your-api-key", "YOUR URL FOR UNSEND OR LEAVE IT BLANK FOR UNSEND CLOUD");

Send an Email

List<string> emailTo = new List<string>();
emailTo.Add("test@test.com");
var sendedMail = await client.emailService.SendEmailAsync(
    emailTo, 
    "C# SDK TEST", 
    "from@mail.com", 
    html: html);
Console.WriteLine($"Email ID: {sendedMail.emailId}");

Retrieve Email Details

var emailDetails = await client.emailService.GetEmailAsync("your-email-id");
Console.WriteLine($"Email ID: {emailDetails.subject}");

Update Scheduled Email

var updatedEmail = await client.emailService.UpdateScheduleAsync("your-email-id", DateTime.UtcNow.AddMinutes(30));
Console.WriteLine($"Updated Email ID: {updatedEmail.emailId}");

Cancel a Scheduled Email

var canceledEmail = await client.emailService.CancelScheduleAsync("your-email-id");
Console.WriteLine($"Canceled Email ID: {canceledEmail.emailId}");

🛠️ Features

  • ✅ Send Emails
  • ✅ Schedule Emails
  • ✅ Retrieve Email Status
  • ✅ Cancel Scheduled Emails
  • ✅ Get Domains Information
  • ✅ Create, Update, Upsert, Delete and Get Contact Info

💬 Support

If you encounter any issues, feel free to create an issue on GitHub.

About

Unsend SDK for C#

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages