Skip to content

transmitly/transmitly-channel-provider-infobip

Repository files navigation

Transmitly.ChannelProvider.Infobip

A Transmitly channel provider that enables sending Email and SMS communications with Infobip.

Getting started

To use the Infobip channel provider, first install the NuGet package:

dotnet add package Transmitly.ChannelProvider.Infobip

Then add the channel provider using AddInfobipSupport():

using Transmitly;
...
var communicationClient = new CommunicationsClientBuilder()
.AddInfobipSupport(options =>
{
	options.BasePath = "https://base.infobip.com";
	options.ApiKey = "key";
	options.ApiKeyPrefix = "App";
})
.AddPipeline("first-pipeline", pipeline =>
{
	//AddEmail is a channel that is core to the Transmitly library.
	//AsAudienceAddress() is also a convenience method that helps us create an audience address
	//Audience addresses can be anything, email, phone, or even a device/app Id for push notifications!
	pipeline.AddEmail("from@mydomain.com".AsAudienceAddress("Test Display Name"), 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!
		email.Subject.AddStringTemplate("Hey, Check out Transmit.ly!");
		email.HtmlBody.AddStringTemplate("Hey, check out this cool new library for managing app communications. <a href=\"https://transmit.ly\">");
		email.TextBody.AddStringTemplate("Hey, check out this cool new library. https://transmitly.ly");
	});

	//AddSms is a channel that is core to the Transmitly library.
	pipeline.AddSms(sms =>
	{
		sms.Body.AddStringTemplate("Check out Transmit.ly!");
	});
});
//Dispatch (send) the transsactional messages to our friend Joe (joe@mydomain.com & 888-555-1234) using our configured InfoBip account with our "first-pipeline" pipeline.
var result = await communicationsClient.DispatchAsync("first-pipeline", ["joe@mydomain.com".AsAudienceAddress("Joe"),"+18885551234".AsAudienceAddress()], new { });
  • See the Transmitly project for more details on what a channel provider is and how it can be configured.
an open-source project sponsored by CiLabs of Code Impressions, LLC

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages