I wanted to show the user who triggered a Jenkins job in the post job email. This is possible by using the plugin Build User Vars Plugin and the env variable
Without Plugin ->
def cause = currentBuild.getBuildCauses('hudson.model.Cause$UserIdCause') echo "userName: ${cause.userName}"