Open In App

How To Send Email Notification Using Jenkins ?

Jenkins notifications function as messages or alerts that notify users of significant occurrences, conditions, or modifications in CI/CD pipelines. They are essential in guaranteeing transparency and visibility throughout the development process and informing stakeholders. By following the below steps, we can configure the Jenkins notifications.

Why do we need email notifications in Jenkins?

Step-by-step instructions for Jenkins Notifications

Step 1: Install Jenkins



Step 2: Login to your Gmail

Step 3: Click on manage Jenkins click on security and enable 2-factor authentication, as shown image below.



Step 4: Aftre enabling the 2factor authentication we need to generate app password. Under the 2 step verification we have one option app password. Click on app password as shown image below.

Step 5: Enter the name of app password, Below image refers we have entered the “Jenkins1” name then click on create. It will display the app password note it down the app password some secret place. It’s one time visible keep it mind. By using the app password we can enable the third party apps into gmail.

Step 6: Entetr into jenkins and click on manage jenkins then click on system and scrolle down below you will find the E-mail notification section. Here you need to configure the some settings as shown image below. Afert configuring the smtp server click on advanced section then fill the below details.

Step 7: Scrole down below you will find the test configuration settings here you can enter the mail then click on test you will receive the test mail. Refer the below image for you refrerance.

Step 8: After successfully receiving the test mail find the extended e-mial notification section on same page. We need to configure the below details.

Step 9: After step8 click on advanced then configure the credentials of your Gmail as shown image below. Then select the your credentias and click on SSL.

Step 10: Crete the pipeline job here we have created the jenkins-notification job as shown image below. What is jenkins pipeline.

Step 11: Add post-build action in your project: To allow your projects to send an email, you need to add Post Build Action and select “Email Notification from the drop-down list. This will provide you the below interface, where you can add a list of email addresses that the email is required to be sent to.

Step 12: After success fully configuring the jenkins job you can build the jenkins job here you can refer the below image the after build success notification was send to respective mail.

Step 13: Refre the below image you will find the jenkins notification mail. We will get the notifications successful or failure of build or we can customize the notifications as per our requirements. We can find the customization settings on extendable email notification settings.

Conclusion

Jenkins email notifications are essential for giving real-time feedback, encouraging teamwork, maintaining transparency, enabling quick responses to important events, and supporting pipelines for continuous integration and delivery of continuous improvement. Through adherence to the above-described, methodical methods, users can efficiently set up email notifications, augmenting correspondence and optimizing workflow administration in their Jenkins environment.

Jenkins Notifications – FAQ’s

What is Jenkins notification?

Jenkins notification is a feature that allows users to receive real-time feedback and collaboration by sending them messages or alerts about important events or changes in CI/CD pipelines.

Can Jenkins send SMS?

It is possible for Jenkins to deliver SMS notifications with plugins like Clickatell or Twilio, giving users the ability to get alerts and updates straight from their pipelines.

How do I start Jenkins?

Go to the Jenkins installation directory and type “java -jar jenkins.war” into the terminal or command line to launch Jenkins. Alternatively, if Jenkins is set up as a service, you can launch it with the relevant operating system service management commands.

How do I delete a job in Jenkins?

In Jenkins, to remove a job, go to the job page, select “Delete Project” from the sidebar menu, and then click “Confirm Delete.” Another option is to erase the job straight from the Jenkins file system.


Article Tags :