// Notify convers payload to a readable message
// and sends it to webhook webhook url
Notify convers payload to a readable message
and sends it to webhook webhook url
// Notify convers payload to a readable message // and sends it to webhook webhook url
func (sn WebhookNotifier) Notify(payload Payload) error {
	reader, err := sn.toReader(payload)
	if err != nil {
		return err
	}
	resp, err := http.Post(sn.webhookURL, contentType, reader)
	if err != nil {
		return err
	}
	if resp.StatusCode != http.StatusOK {
		return fmt.Errorf("Failed to send notification to webhook, status %d", resp.StatusCode)
	}
	return nil
}
func ( sn WebhookNotifier ) Notify ( payload Payload ) error { reader , err := sn . toReader ( payload ) if err != nil { return err } resp , err := http . Post ( sn . webhookURL , contentType , reader ) if err != nil { return err } if resp . StatusCode != http . StatusOK { return fmt . Errorf ( " " , resp . StatusCode ) } return nil }
Notify convers payload to a readable message
and sends it to webhook webhook url
Notify convers payload to a readable message and sends it to webhook webhook url