mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
make bonfire notifications multiple posts for markdown compatibility
This commit is contained in:
@@ -27,7 +27,11 @@ func (b bonfireNotifier) Notify(domain, provider, msg string, err error, preview
|
|||||||
} else {
|
} else {
|
||||||
payload = fmt.Sprintf(`Successfully ran correction for **%s[%s]** - %s`, domain, provider, msg)
|
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() {}
|
func (b bonfireNotifier) Done() {}
|
||||||
|
|||||||
Reference in New Issue
Block a user