From 50cbd915a47fbad8f48a25655d3048201ce9ae4d Mon Sep 17 00:00:00 2001 From: tomaslin Date: Mon, 25 Jan 2016 16:26:18 -0800 Subject: [PATCH] make the pound in a slack channel name optional --- .../spinnaker/echo/slack/SlackNotificationService.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/echo-notifications/src/main/groovy/com/netflix/spinnaker/echo/slack/SlackNotificationService.groovy b/echo-notifications/src/main/groovy/com/netflix/spinnaker/echo/slack/SlackNotificationService.groovy index dbb011cef..01f69cc39 100644 --- a/echo-notifications/src/main/groovy/com/netflix/spinnaker/echo/slack/SlackNotificationService.groovy +++ b/echo-notifications/src/main/groovy/com/netflix/spinnaker/echo/slack/SlackNotificationService.groovy @@ -48,8 +48,8 @@ class SlackNotificationService implements NotificationService { def body = notificationTemplateEngine.build(notification, NotificationTemplateEngine.Type.BODY) notification.to.each { slack.sendMessage(token, new SlackMessage( - text: body, - channel: it + text: body, + channel: it.startsWith('#') ? it : "#${it}".toString() )) } }