18 lines
635 B
Groovy
18 lines
635 B
Groovy
def call(String recipients) {
|
|
// Determina el estado del build
|
|
def buildStatus = currentBuild.currentResult ?: 'SUCCESS'
|
|
|
|
// Define el asunto y el cuerpo del correo según el estado
|
|
def subject = "[Jenkins] ${buildStatus}: ${env.JOB_NAME} #${env.BUILD_NUMBER}"
|
|
def body = """El build ${env.BUILD_NUMBER} del trabajo '${env.JOB_NAME}' ha finalizado con estado: ${buildStatus}.
|
|
Puedes ver los detalles aquí: ${env.BUILD_URL}"""
|
|
|
|
// Enviar correo
|
|
mail to: recipients, subject: subject, body: body
|
|
// emailext(
|
|
// to: recipients,
|
|
// subject: subject,
|
|
// body: body
|
|
// )
|
|
}
|