mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2025-09-11 23:54:28 +08:00
make bonfire notifications multiple posts for markdown compatibility
This commit is contained in:
parent
2a7b382767
commit
558aea906a
1 changed files with 5 additions and 1 deletions
|
@ -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() {}
|
||||
|
|
Loading…
Add table
Reference in a new issue