Jenkins主目录下email-ext模板的新位置

4

我可以使用email-ext插件的默认html模板,但是我找不到插件目录下的模板文件。我该在哪里编辑默认的html.jelly模板?在早期版本的Jenkins中,这些模板会位于Jenkins主目录下的plugins/email-ext目录中。

1个回答

3
把您的模板放在 \Jenkins\email-templates\YOUR_TEMPLATE.jelly 中。 如果没有 email-templates 文件夹,只需创建它即可。

假设我已经创建了一个名为mytemplate.jelly的模板,那么我该如何将该模板用于我的电子邮件正文?我是否需要在Default Pre-send Script中编写一些内容来使用我的自定义模板?我的意思是,我不太清楚如何使用该模板... 你能给我指点一下吗? - Paras
你需要将这个jelly文件提供给email-ext插件。在postbuild actions中添加“可编辑的电子邮件通知”。然后将以下内容添加到“默认内容”中:${JELLY_SCRIPT,template =“mytemplate”}。 - harish
2
我发现在 Jenkins 升级后,你的答案遇到了这个错误:"Jelly file [html] was not found in $JENKINS_HOME/email-templates"。我将 https://raw.githubusercontent.com/jenkinsci/email-ext-plugin/master/src/main/resources/hudson/plugins/emailext/templates/html.jelly 复制到一个新文件夹 /var/lib/jenkins/email-templates 中,问题得以解决。感谢你的提示。你能否提供一下这个文件夹的文档链接? - alfonx

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接