FAKE - F# Make


Office365ConnectorHelper

Contains a task to send notification messages to a Office 356 Connector webhook

Sample

 1: 
 2: 
 3: 
 4: 
 5: 
 6: 
 7: 
 8: 
 9: 
10: 
11: 
12: 
13: 
14: 
15: 
16: 
17: 
18: 
19: 
20: 
21: 
22: 
23: 
24: 
25: 
26: 
27: 
28: 
29: 
30: 
31: 
32: 
33: 
34: 
let imageUrl = sprintf "https://connectorsdemo.azurewebsites.net/images/%s" 

let notification p =
    { p with
        Summary = Some "Max Muster ran a build"
        Title = Some "Sample Project"
        Sections =
           [ { SectionDefaults with 
                 ActivityTitle = Some "Max Muster"
                 ActivitySubtitle = Some "on Sample Project" 
                 ActivityImage = 
                    imageUrl "MSC12_Oscar_002.jpg" 
                    |> ImageUri.FromUrl
                    |> Some 
             }
             { SectionDefaults with
                 Title = Some "Details"
                 Facts = [ { Name = "Labels"; Value = "FOO, BAR" }
                           { Name = "Version"; Value = "1.0.0" }
                           { Name = "Trello Id"; Value = "1101" } ]
             } 
           ]
        PotentialActions =
           [
             {
               Name = "View in Trello"
               Target = System.Uri("https://trello.com/c/1101/")
             }
           ]
    }

let webhookURL = "<YOUR WEBHOOK URL>"

Office365Notification webhookURL notification |> ignore
val imageUrl : (string -> string)

Full name: docs.imageUrl
val sprintf : format:Printf.StringFormat<'T> -> 'T

Full name: Microsoft.FSharp.Core.ExtraTopLevelOperators.sprintf
val notification : p:'a -> 'a

Full name: docs.notification
val p : 'a
union case Option.Some: Value: 'T -> Option<'T>
namespace System
Multiple items
type Uri =
  new : uriString:string -> Uri + 5 overloads
  member AbsolutePath : string
  member AbsoluteUri : string
  member Authority : string
  member DnsSafeHost : string
  member Equals : comparand:obj -> bool
  member Fragment : string
  member GetComponents : components:UriComponents * format:UriFormat -> string
  member GetHashCode : unit -> int
  member GetLeftPart : part:UriPartial -> string
  ...

Full name: System.Uri

--------------------
System.Uri(uriString: string) : unit
System.Uri(uriString: string, uriKind: System.UriKind) : unit
System.Uri(baseUri: System.Uri, relativeUri: string) : unit
System.Uri(baseUri: System.Uri, relativeUri: System.Uri) : unit
val webhookURL : string

Full name: docs.webhookURL
val ignore : value:'T -> unit

Full name: Microsoft.FSharp.Core.Operators.ignore

Nested types and modules

TypeDescription
ColorHexValue

This type alias gives you a hint where you have to use a Hex color value (e.g. #AAFF77)

ConnectorCard

This is the base data, which will be sent to the Office 365 webhook connector

Fact

A simple key/value pair

Image

Represents a described image object

ImageUri

Represents the URI to an image (either a normal URI or a DataUri)

MarkdownString

This type alias for string gives you a hint where you can use markdown

Section

A section in a ConnectorCard

SimpleString

This type alias for string gives you a hint where you can't use markdown

ViewAction

Represents an action button

Functions and values

Function or valueDescription
ConnectorCardDefaults
Signature: ConnectorCard

Default values for a ConnectorCard (everything is empty here)

Office365Notification (...)
Signature: webhookURL:string -> setParams:(ConnectorCard -> ConnectorCard) -> string

Sends a notification to an Office 365 Connector

Parameters

  • webhookURL - The Office 365 webhook connector URL
  • setParams - Function used to override the default notification parameters
SectionDefaults
Signature: Section

Default values for a Section in a ConnectorCard (everything is empty here)

Fork me on GitHub