make bonfire notifications multiple posts for markdown compatibility

This commit is contained in:
Craig Peterson 2018-03-28 10:00:05 -04:00
parent 2a7b382767
commit 558aea906a

View file

@ -27,7 +27,11 @@ func (b bonfireNotifier) Notify(domain, provider, msg string, err error, preview
} else {
payload = fmt.Sprintf(`Successfully ran correction for **%s[%s]** - %s`, domain, provider, msg)
}
http.Post(string(b), "text/markdown", strings.NewReader(payload))
// chat doesn't markdownify multiline messages. Split in two so the first line can have markdown
parts := strings.SplitN(payload, "\n", 2)
for _, p := range parts {
http.Post(string(b), "text/markdown", strings.NewReader(p))
}
}
func (b bonfireNotifier) Done() {}