Email-ext and Workflow/Pipeline - some tokens not being expanded?

Viewed 6125

I'm trying to use the email-ext plugin in a Jenkins pipeline job, but most of the tokens I take for granted when using email-ext in a freestyle job aren't being expanded?

e.g.

node {
    emailext body: '${DEFAULT_CONTENT}', mimeType: 'text/html', replyTo: '$DEFAULT_REPLYTO', subject: '${DEFAULT_SUBJECT}', to: '$DEFAULT_RECIPIENTS'
}

Generates the email:

Subject:

$PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!

Body:

$PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS: Check console output at $BUILD_URL to view the results.

Which are, in fairness, what is set in the general configuration. However, none of those tokens are expanded, and if I use them directly from workflow, they're not expanded either, e.g.

emailext body: '$PROJECT_NAME', mimeType: 'text/html', replyTo: '$DEFAULT_REPLYTO', subject: '${DEFAULT_SUBJECT}', to: '$DEFAULT_RECIPIENTS'

This would be 'okay' if I was able to reference my existing Groovy-based email templates using $SCRIPT, but those aren't expanded either.

Apologies if I'm missing something incredibly obvious - I don't have much experience with Pipeline yet - the lack of email-ext support has stopped me from moving across thus far.

I tested today by clean installing Jenkins 1.651, email-ext 2.41.3 and Pipeline 1.14.

1 Answers
Related