2

I want to write a custom email template for Jenkins using the email-ext plugin. The documentation mentions I can use JavaScript for this, but has no further JavaScript-specific documentation.

I would much prefer to use JavaScript instead of Groovy; all of the examples I have been able to find use the latter.

How do I go about writing a template like this in JavaScript? Which API do I use? How do I do the actual templating--is there some template format, or do I just return a string, or something else entirely?

Josh Unger
  • 6,717
  • 6
  • 33
  • 55
Tikhon Jelvis
  • 67,485
  • 18
  • 177
  • 214

1 Answers1

1

Only Groovy and Jelly engines are supported (or were supported as of a month ago).

malenkiy_scot
  • 16,415
  • 6
  • 64
  • 87
  • I don't know, the [documentation](https://wiki.jenkins-ci.org/display/JENKINS/Email-ext+plugin) (in the "Script content" section) says that "New to version 2.15 is the ability to use Groovy or JavaScript scripts...". Of course, it could be lying. – Tikhon Jelvis Apr 29 '12 at 22:51
  • Yes, you are right. I wanted to write a Python script and discovered that it was not supported (although it is JSR223 compatible language), so I extrapolated to other languages as well. BTW, I ended up writing my script in Groovy. – malenkiy_scot Apr 29 '12 at 23:49
  • I fixed the documentation, only Groovy is supported. – slide Feb 23 '14 at 14:12