Transmitly 0.1.0

dotnet add package Transmitly --version 0.1.0                
NuGet\Install-Package Transmitly -Version 0.1.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Transmitly" Version="0.1.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Transmitly --version 0.1.0                
#r "nuget: Transmitly, 0.1.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Transmitly as a Cake Addin
#addin nuget:?package=Transmitly&version=0.1.0

// Install Transmitly as a Cake Tool
#tool nuget:?package=Transmitly&version=0.1.0                

Communications, done right

Transmitly is a powerful and vendor-agnostic communication library designed to simplify and enhance the process of sending transactional messages across various platforms. With its easy-to-use API, developers can seamlessly integrate email, SMS, and other messaging services into their applications, ensuring reliable and efficient delivery of critical notifications. Built for flexibility and scalability, Transmitly supports multiple communication channels, allowing you to focus on building great applications while it handles the complexity of message transmission.

Supported Channel Providers

Channel(s) Project
Email Transmitly.ChannelProvider.MailKit
Email Transmitly.ChannelProvider.SendGrid
Email, Sms, Voice Transmitly.ChannelProvider.InfoBip
Sms, Voice Transmitly.ChannelProvider.Twilio
Push Notifications Transmitly.ChannelProvider.Firebase

Supported Template Engines

Project
Transmitly.TemplateEngine.Fluid
Transmitly.TemplateEngine.Scriban

Supported Containers

Container Project
Microsoft.Microsoft.Extensions.DependencyInjection Transmitly.Microsoft.Extensions.DependencyInjection

Quick Start

Transmitly can do a lot. It's a little overwhelming. Start by viewing the "Kitchen Sink" Sample Project or stick around and go through the intoductory tutorial.

Tutorial

Let's start with where we all generally start in our applications, sending an email. For this example we'll send an email to someone that has just signed up for our cool new app.

Get Transmitly

dotnet add package Transmitly

Get a channel provider

Transmitly comes with channels like, Email, SMS and Push Notifications out of the box. However, we're going to need a Channel Provider to do the heavy lifting of actually sending or dispatching a communication for us. As this is our first email, we'll choose SMTP. In the past we've used MailKit (Microsoft recommends it!) to send emails. Let's add that to our project...

dotnet add package Transmitly.ChannelProvider.MailKit

Configure our email

Now the fun part. In our Startup code we can now define a pipeline. Pipelines will give us a lot of flexibility down the road. For now we'll, use one of the MailKit convenient extension methods to keep things simple.

Using Microsoft Dependency Injection? Give the Transmitly MS DI extension a go instead of using the builder directly.

using Transmitly;

//CommunicationsClientBuilder is a fluent way to configure our communication settings and pipline
ICommunicationsClient communicationsClient = new CommunicationsClientBuilder()
//Transmitly.ChannelProvider.MailKit adds on to the client builder with it's own extensions to make adding setup a breeze
.AddMailKitSupport(options =>
{
  options.Host = "smtp.example.com";
  options.Port = 587;
  options.UseSsl = true;
  options.UserName = "MySMTPUsername";
  options.Password = "MyPassword";
})
//Pipelines are the heart of Transmitly. Pipelines allow you to define your communications
//as a domain action. This allows your domain code to stay agnostic to the details of how you
//may send out a transactional communication.
.AddPipeline("WelcomeKit", pipeline =>
{
    //AddEmail is a channel that is core to the Transmitly library.
    //AsIdentityAddress() is also a convenience method that helps us create an audience identity
    //Identity addresses can be anything, email, phone, or even a device/app Id for push notifications!
    pipeline.AddEmail("welcome@my.app".AsIdentityAddress("Welcome Committee"), email =>
    {
       //Transmitly is a bit different. All of our content is supported by templates out of the box.
       //There are multiple types of templates to get you started. You can even create templates 
       //specific to certain cultures! For this example we'll keep things simple and send a static message.
       email.Subject.AddStringTemplate("Thanks for creating an account!");
       email.HtmlBody.AddStringTemplate("Check out the <a href=\"https://my.app/getting-started\">Getting Started</a> section to see all the cool things you can do!");
       email.TextBody.AddStringTemplate("Check out the Getting Started (https://my.app/getting-started) section to see all the cool things you can do!");
    });
//We're done configuring, now we need to create our new communications client
.BuildClient();

//In this case, we're using Microsoft.DependencyInjection. We need to register our `ICommunicationsClient` with the service collection
builder.Services.AddSingleton(communicationsClient);

In our new account registration code:

class AccountRegistrationService
{
  private readonly ICommunicationsClient _communicationsClient;
  public AccountRegistrationService(ICommunicationsClient communicationsClient)
  {
    _communicationsClient = communicationsClient;
  }

  public async Task<Account> RegisterNewAccount(AccountVM account)
  {
    //Validate and create the Account
    var newAccount = CreateAccount(account);

    //Dispatch (Send) our configured email
    var result = await _communicationsClient.DispatchAsync("WelcomeKit", "newAccount@gmail.com", new{});

    if(result.IsSuccessful)
      return newAccount;

    throw Exception("Error sending communication!");
  }
}

That's it. But what did we do?

  • Externalized delivery configuration - The details of our (Email) communications are not cluttering up our code base.
    • The added benefit is, in the future, we can change it to SendGrid, MailChimp, Infobip or the many other available providers.
  • Externalized message composition - The details of how an email or sms is generated are not scattered throughout your codebase.
    • In the future we may want to send an SMS and/or push notifications. We can now control that in a single location.
  • We can now use a single service/client for all of our communication needs
    • No more cluttering up your service constructors with IEmailClient, ISmsClient, etc.
    • This also cleans up having if/else statement littered to manage our user's communication preferences

Changing Channel Providers

Normally, changing from SMTP with MailKit can be somewhat of an undertaking. With Transmitly it's as easy as adding a your prefered channel provider and configuring. Your channel configuration stays the same. Your domain code stays the same. And things work as you expect.

For the next example we'll start using SendGrid to send our emails.

dotnet install Transmitly.ChannelProvider.Sendgrid

Next we'll update our configuration. Notice we've removed MailKitSupport and added SendGridSupport.

using Transmitly;

//CommunicationsClientBuilder is a fluent way to configure our communication settings and pipline
ICommunicationsClient communicationsClient = new CommunicationsClientBuilder()
//Transmitly.ChannelProvider.MailKit adds on to the client builder with it's own extensions to make adding setup a breeze
//.AddMailKitSupport(options =>
//{
//  options.Host = "smtp.example.com";
//  options.Port = 587;
//  options.UseSsl = true;
//  options.UserName = "MySMTPUsername";
//  options.Password = "MyPassword";
//})
.AddSendGridSupport(options=>
{
    options.ApiKey = "MySendGridApi";
})
//Pipelines are the heart of Transmitly. Pipelines allow you to define your communications
//as a domain action. This allows your domain code to stay agnostic to the details of how you
//may send out a transactional communication.
.AddPipeline("WelcomeKit", pipeline =>
{
    //AddEmail is a channel that is core to the Transmitly library.
    //AsIdentityAddress() is also a convenience method that helps us create an audience identity
    //Identity addresses can be anything, email, phone, or even a device/app Id for push notifications!
    pipeline.AddEmail("welcome@my.app".AsIdentityAddress("Welcome Committee"), email =>
    {
       //Transmitly is a bit different. All of our content is supported by templates out of the box.
       //There are multiple types of templates to get you started. You can even create templates 
       //specific to certain cultures! For this example we'll keep things simple and send a static message.
       email.Subject.AddStringTemplate("Thanks for creating an account!");
       email.HtmlBody.AddStringTemplate("Check out the <a href=\"https://my.app/getting-started\">Getting Started</a> section to see all the cool things you can do!");
       email.TextBody.AddStringTemplate("Check out the Getting Started (https://my.app/getting-started) section to see all the cool things you can do!");
    });
//We're done configuring, now we need to create our new communications client
.BuildClient();

//In this case, we're using Microsoft.DependencyInjection. We need to register our `ICommunicationsClient` with the service collection
builder.Services.AddSingleton(communicationsClient);

Next Steps

We've only scratched the surface. Transmitly can do a LOT more to deliver more value for your entire team. Check out the wiki to learn more about Transmitly's concepts as well as check out our examples to help you get started quickly.

<picture> <source media="(prefers-color-scheme: dark)" srcset="https://github.com/transmitly/transmitly/assets/3877248/524f26c8-f670-4dfa-be78-badda0f48bfb"> <img alt="an open-source project sponsored by CiLabs of Code Impressions, LLC" src="https://github.com/transmitly/transmitly/assets/3877248/34239edd-234d-4bee-9352-49d781716364" width="500" align="right"> </picture>


Copyright © Code Impressions, LLC - Provided under the Apache License, Version 2.0.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 is compatible.  net48 is compatible.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.7.2

    • No dependencies.
  • .NETFramework 4.8

    • No dependencies.
  • .NETStandard 2.0

    • No dependencies.
  • net6.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages (10)

Showing the top 5 NuGet packages that depend on Transmitly:

Package Downloads
Transmitly.ChannelProvider.Infobip

An Infobip channel provider for the Transmitly library.

Transmitly.ChannelProvider.Twilio

A channel provider for the Transmitly communications library.

Transmitly.Microsoft.Extensions.DependencyInjection

A Microsoft dependency injection extension for the Transmitly library.

Transmitly.ChannelProvider.MailKit

A channel provider for the Transmitly communications library.

Transmitly.TemplateEngine.Scriban

A template engine for the Transmitly communications library.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.1.0 399 9/9/2024
0.1.0-214.756c33c 45 10/20/2024
0.1.0-211.ec126bc 67 10/19/2024
0.1.0-178.b9d08f6 66 6/20/2024
0.1.0-176.e95bbdf 82 6/1/2024
0.1.0-175.f6ebc70 81 5/5/2024
0.1.0-175.95a6680 54 5/18/2024
0.1.0-174.b43bdf8 55 5/6/2024
0.1.0-172.6554ea1 71 4/19/2024
0.1.0-171.c8a05e5 57 4/18/2024
0.1.0-170.26f9ed7 57 4/17/2024
0.1.0-169.5907c88 70 4/9/2024
0.1.0-166.2e0b03d 53 4/8/2024
0.1.0-165.90903b5 54 4/8/2024
0.1.0-163.dcb9cdd 67 4/7/2024
0.1.0-161.17a01dc 68 4/5/2024
0.1.0-160.63d220a 49 4/5/2024
0.1.0-159.0921c83 56 4/5/2024
0.1.0-157.44ba356 78 4/3/2024
0.1.0-156.e0524a0 65 4/2/2024
0.1.0-154.2e35b69 67 3/31/2024
0.1.0-151.a4cb41f 65 3/31/2024
0.1.0-150.401c1e4 62 3/31/2024
0.1.0-149.8bd19ec 77 3/31/2024
0.1.0-148.5f12bd9 61 3/30/2024
0.1.0-147.abb66a4 56 3/30/2024
0.1.0-145.a57ff3a 88 3/23/2024
0.1.0-144.40348bf 56 3/23/2024
0.1.0-143.3ea52b9 64 3/22/2024
0.1.0-141.c74f31e 59 3/22/2024
0.1.0-140.caccefb 55 3/22/2024
0.1.0-139.abb6154 59 3/22/2024
0.1.0-136.9386ba7 72 3/21/2024
0.1.0-134.5ce017f 63 3/20/2024
0.1.0-133.7c4f2af 61 3/20/2024
0.1.0-132.8256df2 76 3/19/2024
0.1.0-129.e7bcd45 63 3/19/2024
0.1.0-127.618e95c 84 3/18/2024
0.1.0-126.13fde3a 64 3/18/2024
0.1.0-125.eaa0dc0 62 3/17/2024
0.1.0-124.1ef24bc 77 3/17/2024
0.1.0-122.1a1021f 72 3/15/2024
0.1.0-121.43cea6f 58 3/14/2024
0.1.0-113.de07dfa 106 3/13/2024