SlackPlugin

This plugin implements functions for sending messages via Slack.

Table of contents

  1. Installation and settings
  2. Settings
    1. Token
    2. NameParameterForSaveRequestResult
    3. ThrowExeptionIfNotSended
    4. SaveRequestResult
  3. Actions
    1. SlackSendMessage

Installation and settings

Table of contents

Install the nuget package:

How to install nuget package in Visual studio for Windows

How to install nuget package in Visual studio for Mac

How to install nuget package in Rider

Add the following namespaces to the usings section:

using OptimaJet.Workflow.Plugins;

Create a plugin object and arrange the required Settings:

var slackPlugin = new SlackPlugin();

// Here are your settings

// slackPlugin.Token = "Token";
// slackPlugin.NameParameterForSaveRequestResult = "SlackRequestResult";
// slackPlugin.ThrowExeptionIfNotSended = true;
// slackPlugin.SaveRequestResult = true;

Connect the plugin to the WorkflowRuntime:

var runtime = new WorkflowRuntime()...

runtime.WithPlugin(slackPlugin);

Settings

Token

Table of contents

String: a parameter for access to Slack.

Used for SlackSendMessage.

NameParameterForSaveRequestResult

Table of contents

String: the name of the parameter, where the request result is stored.

Used for SlackSendMessage.

ThrowExeptionIfNotSended

Table of contents

Boolean: the flag for an exception to be thrown in case of a sending error: if true - the exception will be thrown; if false - the error will be skipped.

Default value: true

Used for SlackSendMessage.

SaveRequestResult

Table of contents

Boolean: the flag for storage the request result: if true - the result will be stored in the parameter; if false - the result won't be stored.

Default value: true

Used for SlackSendMessage.

Actions

Read about actions.

SlackSendMessage

Table of contents

Sends a message.

Parameters:

Token : String *

A parameter for access to Slack.

The value is taken from Token, if specified there.

Channel : String *

A channel to send the message to.

Message : String *

A string that contains the message body.

ThrowExeptionIfNotSended : Boolean *

The flag for an exception to be thrown in case of a sending error: if true - the exception will be thrown; if false - the error will be skipped.

Default value: true

The value is taken from ThrowExeptionIfNotSended, if specified there.

SaveRequestResult : Boolean *

The flag for storage the request result: if true - the result will be stored in the parameter; if false - the result won't be stored.

Default value: true

The value is taken from SaveRequestResult, if specified there.

NameParameterForSaveRequestResult : String *

The name of the parameter, where the request result will be stored.

The value is taken from NameParameterForSaveRequestResult, if specified there.

Top