Skip to content

[JENKINS-71101] Allow loading templates from shared-library. #1399

@jenkins-infra-bot

Description

@jenkins-infra-bot

It would be great if we could send in a shared-library resources that is our Email Ext. template, or if we could send in a body (as a string) to be processes as groovy or jelly.

For example, rather then the following call:

  emailext subject: '$DEFAULT_SUBJECT',
   attachLog: attachLogs,
   body: 'This is our email body',
   recipientProviders: [developers(), requestor()]

We could do something like:

  // This is a shared-library resource file.
  def mailContent = libraryResource('resources/email/template.groovy')
  emailext subject: '$DEFAULT_SUBJECT',
   attachLog: attachLogs,
   body: mailContent,
   bodyType: 'groovy',
   to: additionalRecipients,
   recipientProviders: [developers(), requestor()]


Originally reported by mdelaney, imported from: Allow loading templates from shared-library.
  • status: Open
  • priority: Minor
  • component(s): email-ext-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 1
  • imported: 20251211-193728
Raw content of original issue

It would be great if we could send in a shared-library resources that is our Email Ext. template, or if we could send in a body (as a string) to be processes as groovy or jelly.

For example, rather then the following call:

  emailext subject: '$DEFAULT_SUBJECT',
           attachLog: attachLogs,
           body: 'This is our email body',
           recipientProviders: [developers(), requestor()]

We could do something like:

  // This is a shared-library resource file.
  def mailContent = libraryResource('resources/email/template.groovy')
  emailext subject: '$DEFAULT_SUBJECT',
           attachLog: attachLogs,
           body: mailContent,
           bodyType: 'groovy',
           to: additionalRecipients,
           recipientProviders: [developers(), requestor()]
environment
Jenkins 2.387.2<br/>
Email Ext. 2.96

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions