Jenkins 管道 emailext emailextrecipients : Can I also add specific, 个人电子邮件地址?

标签 jenkins jenkins-pipeline email-ext

在 Jenkins 管道中,我将 email-extemailextrecipients 一起使用,如下所示:

emailext(
    subject: email_subject, 
    mimetype: 'text/html', 
    to: emailextrecipients([[$class: 'CulpritsRecipientProvider'], [$class: 'RequesterRecipientProvider']]), 
    body: email_body
)

我想添加一个特定的电子邮件地址,例如admin@myshop.com,转到使用 emailextrecipients 生成的列表。我希望该收件人(我或经理或管理员)始终收到电子邮件,但该收件人可能是罪魁祸首或请求者,并且我不希望 emailext 向该收件人发送两封电子邮件。

有没有办法将“admin@myshop.com”与emailextrecipients合并?

最佳答案

我不知道我是如何错过这个的,但答案在 email-ext 文档中。使用 to: 作为其他电子邮件地址,并使用 recipientProviders: 而不是 to: emailextrecipients:

emailext(
    subject: email_subject,
    mimetype: 'text/html',
    to: 'admin@myshop.com',
    recipientProviders: [[$class: 'CulpritsRecipientProvider'], [$class: 'RequesterRecipientProvider']],
    body: email_body
)

关于Jenkins 管道 emailext emailextrecipients : Can I also add specific, 个人电子邮件地址?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43473159/

相关文章:

jenkins - 发送电子邮件时如何在 Jenkins 中获取 SVN 日志条目

Jenkins X : trying to execute 'jx boot' from a non requirements repo

jenkins - 从另一个多分支管道触发多分支管道作业

git - 检查 git repo 中是否存在分支而不进行克隆

jenkins - 如何在 Jenkins 自由泳项目中使用码头容器?

gradle - 如何将jar发布到NEXUS存储库

Jenkins - 如何将 Email-ext 插件的 "Culprits"电子邮件列表变量传递给构建步骤?

python - 获取 SSL : CERTIFICATE_VERIFY_FAILED when using python with Apache NIFI rest api

jenkins - 如何使用Jenkinsfile在Multibranch管道中禁用分支

python - 在 Jenkins 中发送电子邮件时添加 png 图像和表格 html