Sending Build Notification Emails

Hello, can you please tell me the following code:

emailext (
      to: "${config.emailAddr}",
      subject: subject,
      body: details,
      replyTo: '$DEFAULT_REPLYTO',
      charset: 'UTF8',
      from: '',
      mimeType: 'text/html',
      recipientProviders: [[$class: 'DevelopersRecipientProvider']]

What exactly does it mean recipientProviders: [[$class: ‘DevelopersRecipientProvider’]] and where you can read more about this class

This is the developers involved in the change that is being built, see from the pipeline syntax generator inline help:

In the email-ext plugin:

Where are the values ​​passed to this class [[$class: ‘DevelopersRecipientProvider’]]
what is it equal to
I couldn’t find an example anywhere with this design [[$class: ‘DevelopersRecipientProvider’]]

Not sure I understand what you’re after. If you select this provider, Jenkins will compute and use the list of people that contributed to the changeset that is being built, so there is no additional parameter to provide.

I couldn’t find an example anywhere with this design [[$class: ‘DevelopersRecipientProvider’]]

Use the Pipeline snippet generator it will generate the code for you.

1 Like

why is there nothing in the documentation about this parameter. There is only this:

recipientProviders: [developers(), requestor()],

but this design is not described anywhere:
recipientProviders: [[$class: ‘DevelopersRecipientProvider’]]

recipientProviders: [developers()] is exactly the same as recipientProviders: [[$class: 'DevelopersRecipientProvider']]. The developers() part refers to the exact same class (through the @Symbol("developers") annotation on the DescriptorImpl inner class).

I’m not sure where your original snippet came from, but I’m guessing that it was probably generated from an older version of the plugin which may not have had symbol support. Without the @Symbol("developers") annotation on the inner class, the initial way you were asking about would have been the only way to add the developers recipient provider to the email. However, now with that annotation there, developers() is the preferred way and is much easier to read and understand.

1 Like

thank you very much, everything is clear now