Hi Dave,

Email-ext works on the idea of macros. When you define the default subject
in the global config, it sets the value of a macro that you can then use in
your job config. If you want to get the value you set, you have to use the
macro for it.

subject: '$DEFAULT_SUBJECT'

This is the same with the other items as well.

You could wrap this into a shared library so that it's just a simple call
to do everything you want.

Regards,

Alex


On Fri, Jul 31, 2020, 00:01 David Koenig <[email protected]> wrote:

>
> i am using Jenkins with the email extension plugin and declarative
> pipelines. In https://jenkinsserver/configure i configured the "Default
> Subject" and "Default Content" with some variables and nice looking content
> which i want to use in a pipeline script.
> When i add the following code to a pipeline script, everything works
> perfectly fine.
>
>     post {
>             always {
>                 emailext (
>                     to: '[email protected]',
>                     replyTo: '[email protected]',
>                     subject: "foo",
>                     body: "bar",
>                     mimeType: 'text/html'
>                 );
>             }
>         }
>
> So technical, everything is working perfectly. But i don't want to specify
> something in the pipeline script, everything should be done with the data
> specified in the global configuration. When i remove everything and just
> call `emailext ();` it failes with the comment that subject is missing.
> What can i do to work with default values specified globally?
>
> Regards
>
> Dave
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/35d1b78c-39e9-46a9-b942-caae4d7f103cn%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/35d1b78c-39e9-46a9-b942-caae4d7f103cn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAPiUgVcy5Uz88msWBDjYxFFBs2q0%3DOqza6Q86VB9KtuQVsTGqg%40mail.gmail.com.

Reply via email to