Skip to content

Project shows how to use Slack API and HipChat API for sending notifications.

License

Notifications You must be signed in to change notification settings

kownet/FacadeNotifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Notifier

When you would like to send notifications to many channels and want to have it done in the most simple way, you should check this repository.

Supported services

  1. Slack API
  2. HipChat API

The notifications might be sent to all or one of the above services.

How to use

Firstly we have to define an IList<IClient> with clients that we are going to support.

var clients = new List<IClient>()
        {
            new HipChatClient(
                new Uri("https://api.hipchat.com/v2/"),
                roomToken: "",
                messageToken: ""),
            new SlackClient(
                new Uri(""))
        };

Secondly we have to pass this IList<IClient> to the notifier.

new Notifier(clients)
    .WithTitle(message)
    .WithBody("Build")
    .ToPeople(new string[] { "test@kownet.info", "tk" })
    .ToGroups(new string[] { "Api" })
    .SetMessageType(MessageType.Success)
    .WithLink(new ContentLink { Url = "https://kownet.info", Caption = "Kownet" })
    .SendAsync();

That's all. The notification will be send to the provided groups and / or single users.

About

Project shows how to use Slack API and HipChat API for sending notifications.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages