orchardcmsslack-apiorchardcms-1.9

Intergrating Slack with Orchard CMS


I am attempting to use a web request to post updates to Slack whenever content is versioned via the Workflow module, but it keeps failing to post correctly, and send the error email I have programmed to send if the web request fails.

I am trying to post to a slack using a webhook url, and I have tried to send the body text as JSON using:

payload={"text": "A very important thing has occurred! for details!"}

or just:

{"text": "A very important thing has occurred! for details!"}

Both work when I test using a client like POSTMAN, but not within Orchard.

I can not see any logs to get/give more feedback on what's happening either.

Anyone have success?


Solution

  • You need to wrap the json in double parentheses so that the tokenizer does not try to process it. Something like this:

    (( "text": "A very important thing has occurred! for details!" ))