DEV Community

Raghwendra Sonu
Raghwendra Sonu

Posted on

2 1

Trigger a Job with Email in Jenkins

In this article we are going to see, how to trigger a Jenkins job with Email. We will be using Jenkins Poll Mailbox Trigger Plugin for this purpose.

Goto Manage Jenkins, in your Jenkins instance and install this plugin.

Alt Text

Now, create a freestyle job and in the configuration add below in "Poll Mailbox Trigger" settings:
host: imap.gmail.com
UserID: < enter your gmail userid >
Password:< enter your gmail password >
Advanced Email Properties: subjectContains=Trigger_Job_Demo
Schedule: H/1 * * * *
Attachments: Ignore

So, it will check email account for unread emails in every one minute and if any email with subject "Trigger_Job_Demo" is found it will trigger the job.

Alt Text

To test this, send an email from your account with given subject. And, the job at Jenkins will be executed.

Read more here: https://github.com/jenkinsci/poll-mailbox-trigger-plugin

AWS GenAI LIVE image

How is generative AI increasing efficiency?

Join AWS GenAI LIVE! to find out how gen AI is reshaping productivity, streamlining processes, and driving innovation.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs