Hi, 

sorry for the late response, i was away a few days. 
i am new to jenkins, so please forgive me to ask some silly questions. Did 
i understand this right? It doesn't work directly out of a Jenkinsfile? I 
tried 

emailext (
                to: '[email protected], 
                replyTo: ' [email protected]', 
                subject: $DEFAULT_SUBJECT, 
                body: '<b>testb</b>test<i>testi</i><p>new area</p>', 
                mimeType: 'text/html'
            );

and get the error message

groovy.lang.MissingPropertyException: No such property: $DEFAULT_SUBJECT 
for class: WorkflowScript

Regards 

Dave


slide schrieb am Freitag, 31. Juli 2020 um 14:45:23 UTC+2:

> 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/0638577a-35c9-4ee6-8f29-a6acb2160f4dn%40googlegroups.com.

Reply via email to