Search code examples
jenkinsjenkins-pipelinejenkins-plugins

How to debug Jenkin's `emailext` plugin?


emailext is by far the most popular email plugin for Jenkins and Jenkinsfiles.

How do you debug it?

It is failing to send the expected email with no error messages. The documentation for emailext doesn't indicate any kind of return value, callback, or any other way to get the status or result of the function call.

What methods exist (if any), in general, for debugging something like this?

(If you're curious about my specific use-case, I'll embed my code)

emailext(
    to: "[REDACTED]@[REDACTED].com",
    replyTo: 'no-reply@[REDACTED].com',
    subject: '$DEFAULT_SUBJECT',
    body: getEmailBody()
)

Solution

  • You can enable the debug mode of the plugin under Manage Jenkins > Configure System > Extended E-mail Notification then checkbox as in the following screenshot:

    enter image description here

    In the console output of your build, were you call emailext , you should then see more logs.