location of email-ext template file

4,359 views
Skip to first unread message

esharish

unread,
Mar 1, 2015, 5:59:52 AM3/1/15
to jenkins...@googlegroups.com
I can use the default html template from email-ext plugin, but I cannot locate the template file under the plugin directory or Jenkins home to edit it. Where can I edit this default html.jelly template? I am using latest Jenkins 1.598 and email-ext template 2.39.

Slide

unread,
Mar 1, 2015, 10:05:45 AM3/1/15
to jenkins...@googlegroups.com

Check the wiki, there is information there on that exact thing.


On Sun, Mar 1, 2015, 03:59 esharish <hari...@gmail.com> wrote:
I can use the default html template from email-ext plugin, but I cannot locate the template file under the plugin directory or Jenkins home to edit it. Where can I edit this default html.jelly template? I am using latest Jenkins 1.598 and email-ext template 2.39.

--
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-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/96e7e9f6-d4c9-4e77-8ca7-00bdce9462da%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Harish ES

unread,
Mar 1, 2015, 10:42:07 AM3/1/15
to jenkins...@googlegroups.com
Thanks Slide, from reading plugin wiki, it looks I need to make a copy of jelly template(from github?) with custom name and edit it and follow below steps pasted from wiki:

Using custom Jelly scripts (those not packaged with email-ext) requires the cooperation of your Hudson administrator. The steps are relatively simple:

  1. Create the Jelly script. The name of the script should be <name>.jelly. It is important the name ends in .jelly.
  2. Have your Jenkins administrator place the script inside $JENKINS_HOME_\email-templates_.


--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/_FgZG06aqGc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAPiUgVchzFuyQHWuw4-CsxqZ-tjSuGxteE9xZkMkWaJX%3DAcKcw%40mail.gmail.com.

Slide

unread,
Mar 1, 2015, 4:16:19 PM3/1/15
to jenkins...@googlegroups.com
The other option is if you install the config-file-provider plugin, you can put the template in there and not have to worry about using the file system location. I need to go and update the wiki with a bunch of information...

Chris T

unread,
Dec 6, 2017, 12:24:46 PM12/6/17
to Jenkins Users
And how is "config-file-provider" used?

In the emailext:
body: '${JELLY_SCRIPT, template="managed:<name_of_my_config_file>"}',
or
body: '${SCRIPT, template="managed:<name_of_my_config_file>"}',

But this isn't working for me.

Slide

unread,
Dec 6, 2017, 12:25:55 PM12/6/17
to jenkins...@googlegroups.com
Do you have the config-file-provider plugin installed? If so, you specify the NAME of the template that you create in the managed scripts area of the global configuration after managed:

Chris T

unread,
Dec 6, 2017, 2:27:25 PM12/6/17
to Jenkins Users
Thanks slide on the fast response!
So yes I do have config-file-provider plugin installed.
I've attached screenshots of screenshots of my set up.

In my pipeline Jenkinsfile, I would add:
                emailext(
                    to: '<an_email>',
                    subject: 'test email',
                    body:'${JELLY_SCRIPT, template="managed:JellyEmailTemplate.jelly"}' ,
                    mimeType: 'text/html'
                )

But the email response would say:

Jelly file [managed:JellyEmailTemplate.jelly] was not found in $JENKINS_HOME/email-templates.


Do you know why the pipeline doesn't pick up my config files?
Config File Page.JPG
Config File.JPG

Slide

unread,
Dec 6, 2017, 3:01:42 PM12/6/17
to jenkins...@googlegroups.com
Just for kicks, can you try removing .jelly from the name of the template?

jer...@bodycad.com

unread,
Dec 6, 2017, 3:08:43 PM12/6/17
to Jenkins Users
For security reason I was told, the template must reside on the master (you can stash it and unstash it into the email template folder on the master or you can read it and write it on master node):

node('master')
{
  writeFile([file: "${JENKINS_HOME}/email-templates/mytempofile.jelly", text: 'template data read from other file']);
}
emailext body: ...

At least it was my workaround until I find something less retarded.

Chris T

unread,
Dec 6, 2017, 3:25:50 PM12/6/17
to Jenkins Users
I originally had the template name without ".jelly", but got same (not working) results.

Chris T

unread,
Dec 6, 2017, 3:28:02 PM12/6/17
to Jenkins Users
I thought the point of config-file-provider plugin was so we don't have to store the template in the $JENKINS_HOME/email-templates?

Slide

unread,
Dec 6, 2017, 4:26:12 PM12/6/17
to jenkins...@googlegroups.com
Yes, that is the point. I'm not sure why it isn't working for you, I am using pretty much the same thing in my setup and it works (though I am not sure I have tried from a pipeline job).

--
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-use...@googlegroups.com.

Daniel Beck

unread,
Dec 6, 2017, 5:02:04 PM12/6/17
to jenkins...@googlegroups.com

> On 6. Dec 2017, at 19:42, Chris T <chris.t...@gmail.com> wrote:
>
> So yes I do have config-file-provider plugin installed.

Have you restarted Jenkins since you installed either of these plugins? Optional features may not be available otherwise.

Chris T

unread,
Dec 6, 2017, 5:28:38 PM12/6/17
to Jenkins Users
The plugins were install a while ago, and have been restarted (at least a few times) since then.

Chris T

unread,
Dec 6, 2017, 5:46:15 PM12/6/17
to Jenkins Users
Just to narrow down possible failure points, I did make a simple free style job where I added in the same command in the default content box of the editable email notification. And got same results as in my pipeline.

Slide

unread,
Dec 7, 2017, 10:44:26 AM12/7/17
to jenkins...@googlegroups.com
Can you try enabling debug mode for email-ext (there is a checkbox in the global config, possibly under advanced) and see if there is anything in the logs that could help pinpoint the issue? Also, I didn't see what versions of Jenkins, email-ext and config-file-provider you are using, can you share that as well?

Chris T

unread,
Dec 7, 2017, 11:29:40 AM12/7/17
to Jenkins Users
I will try that, and for versions:

Jenkins: 2.86

Email ext plugin: 2.60

Config File Provider: 2.16.4

slmp...@gmail.com

unread,
Jan 4, 2018, 4:59:07 AM1/4/18
to Jenkins Users
Hi,
    I also getting same error.


Jelly file [managed:EmailTemplate] was not found in $JENKINS_HOME/email-templates.

I already installed

Config File Provider Plugin but i dont't know how to refer in my email template.



in email text


               ${JELLY_SCRIPT, template="managed:EmailTemplate.jelly"}



I also tried


               ${JELLY_SCRIPT, template="managed:EmailTemplate"}



can anyone please help to solve this issue


Mani Agnihotri

unread,
Jun 18, 2018, 3:04:02 AM6/18/18
to Jenkins Users
Hi,

I know this is old post, but I figured a lot of people might be struggling from the same problem still (just like I was). The problem is you are probably using the *ID* of the template and not the *Name*. 
  1. Make the name free of whitespaces
  2. Use the name instead of ID
This should solve the issue.

Thanks!

kalkin powale

unread,
Mar 27, 2019, 10:58:04 AM3/27/19
to Jenkins Users
Hi,
I am using groovy scripts and I use this command after adding my template here config-file-provider plugin. and it worked fine.

body: '''${SCRIPT, template="managed:custom_groovy_Email.groovy"}''',
Reply all
Reply to author
Forward
0 new messages