We often get requirement to send data to slack as a part of any notification activity in any automation requirements. It could be as simple as an alert message or bit complicated as initiating a workflow. The below code snippit simplifies that messaging using native python libraries.
