Skip to content

Instantly share code, notes, and snippets.

@sturman
Last active June 16, 2017 10:46
Show Gist options
  • Save sturman/1fbe1534ab270422c2b232e098e25494 to your computer and use it in GitHub Desktop.
Save sturman/1fbe1534ab270422c2b232e098e25494 to your computer and use it in GitHub Desktop.
import javax.mail.internet.*
logger.print(“This ends up in the log as well”);
String encodingOptions = “text/html; charset=UTF-8;“;
// msg.setContent(“please check!!!!“, encodingOptions);
String defaultSubject = msg.getSubject();
build.getLog(1000).each() { line ->
if (line.contains(“archive_name”)) {
matcher = (line =~ /archive_name: (.*)/);
if (matcher.matches()) {
msg.setSubject(defaultSubject + ” - triggered by: ” + matcher[0][1]);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment