This project implements a node HTTP server which can accept:
You can configure SendGrid to make webhook calls when email is processed, dropped, deferred, delivered, bounced, clicked, opened, unsubscribed from or marked as spam.
This server transforms the event information from SendGrid into HipChat-valid HTML and posts it into a HipChat room for monitoring.
In your SendGrid configuration, enable the Event Notification App. It is disabled by default. Within its settings, you can choose which kinds of events you're interested in. We typically monitor: dropped, bounced, unsubscribe, and spam. Monitoring deferred events seemed to cause a lot of noise.
For the URL setting: http(s)://yourserver.com/postSendGridMessage?apikey=a-valid-hipchat-api-key&room=a-valid-HipChat-room-number&user=your-sendgrid-subuser-id&environment=a-string-of-your-choosing
Batch event notifications: Leave this unchecked, as the code can't handle batches yet.
The Jenkins webhook will send a message to a HipChat room only when a job finishes and one of the following conditions are met:
- The substring "FAIL" appears in the job status.
- The job status changed from the last job execution (FAILED to SUCCESS, SUCCESS to FAILED).
This server does not have any persistent state. All job statuses will be lost when the node engine is restarted.
- Install the Jenkins Notification Plugin
- In an individual Jenkins project configuration:
- Add a Job Notification
- Format: JSON
- Protocol: HTTP
- URL: http(s)://yourserver.com/postJenkinsMessage?apikey=a-valid-hipchat-api-key&room=a-valid-HipChat-room-number
You'll need a HipChat API (API version 1) )Auth Token of type Admin to be able to post messages to HipChat. You'll also need the room number of the HipChat room you want to post to. The room number can be had from the URL of the chat history web page for the room in question.
SendGrid To Dos
- Unit tests
- Make dependence on SendGrid sub-user accounts optional. We use them, you might not.
- Add support for "Batch event notifications" in SendGrid.
HipChat To Dos
- Add support for posting to multiple HipChat rooms simultaneously.
Jenkins To Dos
- Add a querystring argument that controls whether the start of a job is announced to HipChat.