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

Allow loading templates from shared-library.

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • email-ext-plugin
    • None
    • Jenkins 2.387.2
      Email Ext. 2.96

      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()]
      
      

            Unassigned Unassigned
            mdelaney Mike Delaney
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: