In an automated software development process, Jenkins serves as a powerful (CI\CD) continuous integration and delivery tool. One crucial aspect of this process is receiving timely notifications about the status of automated tests and builds. Configuring email notifications in Jenkins enables you to receive automation reports, ensuring you stay updated on the health and progress of your projects. This blog post will guide you through the process of setting up email notifications in Jenkins, allowing you to receive automation reports effortlessly.
Prerequisites:
1. A running instance of Jenkins
2. Administrative access to Jenkins
3. An email server or SMTP service credentials to send emails
4. Access to the Jenkins server’s configuration settings
Step 1: Install Email Extension Plugin The first step is to install the Email Extension plugin in your Jenkins, which provides extended email notification functionality. Follow these steps:
1. Open Jenkins and go to “Manage Jenkins” from the Dashboard page.
2. Select “Manage Plugins” from the options.
3. In the “Available” tab, search for “Email Extension Plugin.”
4. Check the checkbox next to the plugin and click “Install without restart” to install it.
Manage Plugins
Step 2: Configure Email Server Settings To send email notifications, Jenkins needs to be configured with the necessary SMTP server settings.
1. Navigate to “Manage Jenkins” and click on “Configure System.”
2. Go down to the “Extended Email Notification” section.
3. Enter your SMTP server details , such as the SMTP server address and port number of your local host machine.
4. Provide authentication details if your SMTP server requires authentication.
5. Test the configuration by clicking on the “Test Configuration” button. Verify that a test email is sent successfully.
Verify that a test email is sent successfully.
Step 3: Configure Global Email Notifications In this step, you’ll configure Jenkins to send email notifications for every build:
1. From the Jenkins dashboard, click on “Manage Jenkins” and select “Configure System.”
2. Go to the “Extended Email Notification” section.
3. Fill in all the required fields, including the default recipient list, subject, and body of the email.
4. Customize the email template according to your needs using the available variables and pre-defined options.
5. Save the configuration changes.
Step 4: Configure Job-Specific Email Notifications
1. Open the desired Jenkins job and click on “Configure” from the left-hand side menu.
2. Scroll down to the “Post-build Actions” section.
3. Click on the “Add post-build action” dropdown and select “Editable Email Notification.”
4. Configure the email settings specific to this job, such as the recipient list, subject, and body.
5. Save the job configuration