Jenkins comes with an out of box facility to add an email notification for a build project.
Step 1 − Configuring an SMTP server. Goto Manage Jenkins → Configure System. Go to the E-mail notification section and enter the required SMTP server and user email-suffix details.
Step 2 − Configure the recipients in the Jenkins project - When you configure any Jenkins build project, right at the end is the ability to add recipients who would get email notifications for unstable or broken builds. Then click on the Save button.
Apart from the default, there are also notification plugin’s available in the market. An example is the notification plugin from Tikal Knowledge which allows sending Job Status notifications in JSON and XML formats. This plugin enables end-points to be configured as shown below.
Here are the details of each option −
"Format" − This is the notification payload format which can either be JSON or XML.
"Protocol" − protocol to use for sending notification messages, HTTP, TCP or UDP.
"Event" − The job events that trigger notifications: Job Started, Job Completed, Job Finalized or All Events (the default option).
"URL" − URL to send notifications to. It takes the form of "http://host" for HTTP protocol, and "host:port"
for TCP and UDP protocols.
"Timeout" − Timeout in milliseconds for sending notification request, 30 seconds by default.