Jenkins Pipeline job; proper quoting for slackSend step
In Groovy you have to use double quotes to get string interpolation:

    if ( "$output" != null ) {
        slackSend (channel: "@${name}", color: '#36A64F', message: "Job succeeded")
    } else {
        slackSend (channel: "@${name}", color: '#36A64F', message: "Job failed")
    }


You can also probably do something like this to avoid it entirely and have less duplication:

name = '@' + readFile('name.txt')

slackSend (channel: name //etc.