【发布时间】:2017-11-22 10:45:57
【问题描述】:
我需要通过管道从 Jenkins 添加电子邮件中的图像作为电子邮件正文而不是附件。 我在 Jenkins 管道中使用 emailext 插件,下面是我正在使用的代码。
emailext (
subject: "test email",
body: """
<html>
<body>
<p>please find attached score: Job '${env.JOB_NAME}':</p>
<p> The last commit was by ${last_commit_user} </p>
<p>Please check jenkins console at "</p>
<p> For detailed report on this analysis, visit "</p>
</body>
</html>
""",
to: email_recipients,
attachmentsPattern: '${BUILD_NUMBER}.jpg'
)
我不想使用作为附件的“attachmentsPattern”, 我试过用,
body: """
<html>
<img src="image_name.jpg" >
</html>
"""
这只是我电子邮件中的蓝框,我提供了相对于我的 Jenkins 工作区的正确图像路径, 我试图搜索相关的解决方案,但徒劳无功。
【问题讨论】:
-
你找到在 Jenkins email-ext 中嵌入图片的方法了吗?
-
您找到解决方案了吗?我也有类似的问题
-
@Dinesh 请在下面找到我的解决方案,我遇到了同样的问题。
标签: html jenkins jenkins-pipeline jenkins-plugins jenkins-email-ext