You should be able to import the content classes, instantiate an instance
of them and call the getContent method.

def BUILD_ID = new BuildIdContent()

def args = [ "Arg1" : "Foo", "Arg2", "Foo" ]

// currently the publisher is not accessible by the groovy templates, so
some tokens may not work this way (passing null)
// EmailType is not used in any of the content plugins as far as I can
tell, so passing null shouldn't cause an issue here
<% BUILD_ID.getContent(build, null, null, args) %>

I'll see if I can make the publisher available in the next version of
email-ext.


On Mon, Feb 4, 2013 at 1:58 AM, Bernhard Berbuir <bernhard.berb...@web.de>wrote:

> Hello,
> I am migrating my email-ext mail template to a Groovy script. My current
> email configuration uses a lot of tokens (${BUILD_LOG_EXCERPT},
> ${CHANGES_SINCE_LAST_SUCCESS}, ${BUILD_LOG_REGEX}, ${WARNINGS_RESULT},
> ${TASKS_RESULT}, ...). I do not want to implement the same functionality in
> Groovy which is already available in the Java code of the email-ext plugin.
> Is there any way to reuse the existing implementation? Has anyone done this
> (and can provide some examples)?
>
> Regards
>
> Bernhard
>
> --
> 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 
> jenkinsci-users+unsubscribe@**googlegroups.com<jenkinsci-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit 
> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
> .
>
>
>


-- 
Website: http://earl-of-code.com

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to