1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Slack: Fix #2393 - Enable markdown parsing when using custom messsage color (#2626)

This commit is contained in:
Matthieu Barthélemy 2016-08-10 01:52:18 -05:00 committed by Matt Clay
parent 69a3e66460
commit adfd990232

View file

@ -171,7 +171,8 @@ def build_payload_for_slack(module, text, channel, username, icon_url, icon_emoj
if color == "normal" and text is not None:
payload = dict(text=text)
elif text is not None:
payload = dict(attachments=[dict(text=text, color=color)])
# With a custom color we have to set the message as attachment, and explicitely turn markdown parsing on for it.
payload = dict(attachments=[dict(text=text, color=color, mrkdwn_in=["text"])])
if channel is not None:
if (channel[0] == '#') or (channel[0] == '@'):
payload['channel'] = channel