我需要在邮件正文中添加一张图片,而不是作为附件,通过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工作区相对路径给出了正确的图片路径,但是我尝试搜索相关的解决方案却没有成功。