Jenkins可以发送带有附件的邮件通知吗?
Jenkins 可以向收件人发送带有附件的邮件通知吗?对我来说更重要的是(可选),它还可以从文件 *.xls 中读取并将其添加到电子邮件文本中。
或者我可以从系统变量添加到由 jenkins 插件(分机邮件)发送的数据吗?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
截至 2011 年 9 月的新答案:是。 问题 9018 已解决。
从 Jenkins email-ext 插件版本 2.15 开始,您可以在 Jenkins 构建通知中发送附件。请参阅此处的 Jenkins wiki:
New answer, as of September 2011: Yes. Issue 9018 has been resolved.
Starting with version 2.15 of the Jenkins email-ext plugin, you can send attachments in Jenkins build notifications. See the Jenkins wiki here:
当 Jenkins 触发
1) 按“配置”
始终发送一封带有附加 HTML 文件的电子邮件.net/FyyAD.png" rel="nofollow noreferrer">
2 ) 在顶部配置的一部分按“构建后操作”
3) 按“添加构建后操作”
并选择“可编辑电子邮件通知”
4) 添加后
输入“项目收件人列表”您要发送的电子邮件(可以添加多封邮件,如示例中所示)
5) 向下滚动,添加到您要发送的文件的“附件”方向
6) 在页面末尾按右侧的“高级设置”按钮
<图像src="https://i.sstatic.net/AlMcc.png" alt="在此处输入图像描述">
how I make a Jenkins send me an Email always with attached HTML file when the Jenkins trigger
1) press "Configuration"
2) in the top part of configuration press "Post-build Actions"
3) press on "add post build action "
and choose "editable email notification"
4) after it been added
enter "Project Recipient List" a emails you want to send (possible to add more than one mail , like in the example)
5) scroll down, add to the "Attachments" direction to the file you want to send
6) in the end of the page press on button "advanced settings" from the right side
此问题最近发布在 Jenkins JIRA 上:问题 9018。该网站现在没有响应我,所以我什至看不到状态是什么。
关于XLS文件中的电子邮件,我搜索了Jenkins插件,但找不到任何“XLS”或“Excel”的内容。如果您的 Jenkins 实例在 Windows 上运行,您可以使用 VBScript 和 COM 将列表导出为可解析的格式,如 TAB 或 CVS;或者您可以尝试以编程方式浏览电子邮件列表,并让 VBScript 将它们作为一个大字符串返回。该论坛有一个非常清晰的示例,打开工作簿,选择适当的工作表,然后迭代单元格:XLS 和VBScript。哦,我刚刚想起来,如果您有较新版本的 Visual Studio 和 Office,那么互操作性可能会更容易;虽然我从来没有尝试过那个组合。
我希望这有帮助,
扎卡里
This issue was recently posted on the Jenkins JIRA: Issue 9018. That site is not responding for me right now, so I can't even see what the status is.
Regarding the e-mails in the XLS file, I did a search of the Jenkins plug-ins and could not find anything for "XLS" or "Excel". If you're Jenkins instance is running on Windows, you could use VBScript and COM to either export the list to a parsable format like TAB or CVS; or you could try to programmatically look through the list for the e-mails and get the VBScript to return them as one big string. This forum has a pretty clear example of opening a workbook, selecting the appropriate worksheet, and then iterating through the cells: XLS & VBScript. Oh, and I just remembered that if you have newer versions of Visual Studio and Office, there's interoperability there that might be easier; though I've never tried that combo.
I hope this helps,
Zachary