Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-26104

Custom Workflow step for sending mail

    Details

    • Similar Issues:

      Description

      You can already use mailer-plugin from a flow:

      step $class: 'hudson.tasks.Mailer', recipients: '...'
      

      However this just runs the canned functionality of Jenkins build mail notification: mail is sent only for unstable/failed builds, with a predetermined subject, etc. (Use catchError to send even after an earlier step throws an error.)

      email-ext-plugin integration would add a bunch more options, but still this would be focused on picking up existing behaviors related to build status: different stability triggers, changelogs, etc.

      For some cases you would prefer to unconditionally send a message with a given subject and a given body to a given list of recipients and that is that. This is best done with a special step:

      mail to: '...', cc: '...', subject: '...', body: '...'
      

      For example, you could do this immediately before running an input step to notify a team that something is waiting.

        Attachments

          Issue Links

            Activity

            jglick Jesse Glick created issue -
            jglick Jesse Glick made changes -
            Field Original Value New Value
            Link This issue depends on JENKINS-23074 [ JENKINS-23074 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "email-ext PR 97 (Web Link)" [ 11927 ]
            tfennelly Tom FENNELLY made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "workflow-plugin PR 39 (Web Link)" [ 12027 ]
            jglick Jesse Glick made changes -
            Assignee Tom FENNELLY [ tfennelly ]
            Hide
            tfennelly Tom FENNELLY added a comment -

            merged upstream

            Show
            tfennelly Tom FENNELLY added a comment - merged upstream
            tfennelly Tom FENNELLY made changes -
            Status In Progress [ 3 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            Hide
            tfennelly Tom FENNELLY added a comment -
            Show
            tfennelly Tom FENNELLY added a comment - Short blog about this new feature: http://developer-blog.cloudbees.com/2015/01/mail-step-for-jenkins-workflow.html
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            COMPATIBILITY.md
            http://jenkins-ci.org/commit/workflow-plugin/a032d4c2e9ea9449b9dbc6b5ec80f527f4b49101
            Log:
            JENKINS-24887 JENKINS-26104 Noting.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: COMPATIBILITY.md http://jenkins-ci.org/commit/workflow-plugin/a032d4c2e9ea9449b9dbc6b5ec80f527f4b49101 Log: JENKINS-24887 JENKINS-26104 Noting.
            Hide
            rodrigc Craig Rodrigues added a comment -

            I'm having problems with pipeline plugin (formerly named workflow plugin).
            I described the problem here: https://groups.google.com/d/msg/jenkinsci-users/vziPhYZQcPI/tY2FPK1oEgAJ

            Can someone help?

            Show
            rodrigc Craig Rodrigues added a comment - I'm having problems with pipeline plugin (formerly named workflow plugin). I described the problem here: https://groups.google.com/d/msg/jenkinsci-users/vziPhYZQcPI/tY2FPK1oEgAJ Can someone help?
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 160094 ] JNJira + In-Review [ 196314 ]
            abayer Andrew Bayer made changes -
            Labels workflow pipeline workflow
            abayer Andrew Bayer made changes -
            Labels pipeline workflow pipeline
            childnode Marcel 'childNo͡.de' Trautwein made changes -
            Remote Link This issue links to "MailStep.java (Web Link)" [ 15625 ]

              People

              • Assignee:
                tfennelly Tom FENNELLY
                Reporter:
                jglick Jesse Glick
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: