i\'d like to modify the email message i send from jenkins. how can i do it? i tried to use msg variable and set the content using msg.setContent(\"this is the string i want in t
msg.setContent
doesn't send messages if the GString
type passed as content.
Don't forget to convert GString
to java.lang.String
Use toString()
def gStringContent = "Hellow ${name}"
logger.println 'Content type is ' + gStringContent.getClass()
msg.setContent(gStringContent.toString(), 'text/html')
Use explicit typing String
String gStringContent = """Hello $name
Goodby ${name}"""
logger.println 'Content type is ' + gStringContent.getClass()
msg.setContent(gStringContent.toString(), 'text/html')
etc.
That's was my trouble. Fixed.