Skip to content

3.1 Add extra fields

Alexandre Sanlim edited this page Dec 7, 2020 · 3 revisions
try
{
    throw new DivideByZeroException();
}
catch (System.Exception e)
{
    await e.SendToSlackAsync(new ExtraInfo
    {
       Fields = new System.Collections.Generic.List<Webhooks.SlackField>
       {
           new Webhooks.SlackField
           {
               Title = "Username",
               Value = "Alexandre Sanlim",
               Short = true
           },
           new Webhooks.SlackField
           {
              Title = "S.O",
              Value = "Windows 10",
              Short = true
           },
           new Webhooks.SlackField
           {
              Title = "New Field 3",
              Value = "Hi, I'am a new long field to show in GitHub sample",
           }
        }
    });
}

Results in:

Clone this wiki locally