This project is an example of how to integrate slack events api with Sendgrid mail apis. Here we show how for every file comment(link) posted in slack, we email that immediately to the responsible file owner's email address.
-
Create a slack app and get a slack application token as shown at this link.
-
Register at sendgrid and get a sendgrid api key as shown at this link.
-
Set the system environment variables SLACK_TOKEN and SENDGRID_API_KEY.
-
Build the app using mvn clean install
-
Use the maven jetty plugin to start the app mvn jetty:run
-
Download ngrok from here to expose localhost to the web.
-
Run the command ngrok http 8080 to expose http://localhost:8080 to web.
-
Register this url as a callback url in the slack application and choose the file_comment event to be subscribed.
-
Install the app to your slack workspace.
In case there are issues please report them to Github issues.