Skip to content

Latest commit

 

History

History
82 lines (65 loc) · 2.35 KB

README.MD

File metadata and controls

82 lines (65 loc) · 2.35 KB

Sitecore Send SDK (Unofficial)

GitHub Actions Workflow Status

NuGet Version NuGet Downloads

Provides .NET wrapper around Sitecore Send API

Usage

var apiConfiguration = new ApiConfiguration
{
    ApiKey = "[YOUR API KEY]",
};

// or any other service
IMailingListService mailingListService = new MailingListService(apiConfiguration);

var response = await mailingListService.GetAllMailingLists();

// ensure response is not null and Success is true
if (response is {Success: true})
{
    IList<MailingList>? allLists = response.Data?.MailingLists;
    // handle allLists
}

Configuration with DI:

var apiConfiguration = new ApiConfiguration
{
    ApiKey = "[YOUR API KEY]",
};
serviceCollection.AddHttpClient("SitecoreSendClient",
    (client) => { client.BaseAddress = new Uri(apiConfiguration.BaseUri); });
serviceCollection.AddScoped<IMailingListService>(provider => new MailingListService(apiConfiguration,
    provider.GetService<IHttpClientFactory>()!.CreateClient("SitecoreSendClient")));

Integration tests

Overview

Integration tests are located in SitecoreSend.SDK.Tests project.

Running locally

Create file appsettings.local.json in SitecoreSend.SDK.Tests project.

Fill it with the following content:

{
  "SitecoreSend": {
    "ApiKey": "[YOUR API KEY]",
    "TestListId": "[TEST LIST ID]"
  },
  "UnitTests": {
    "HideSecrets": false // specify, if hide api secrets and emails in test outputs 
  }
}

Contribute / Bug / Help

You can contact me via email or in Sitecore Slack: zharikovigor97@gmail.com. Or please open an issue.

Roadmap

Documented API

  • Mailing list service
  • Subscribers service
  • Campaigns service (WIP)
  • Segments service

Internal API

  • Websites management
  • Automations
  • Senders API

Tracking API

  • Tracking API

SMTP API

  • SMTP