put property name back as originator and recipients

This commit is contained in:
cemturker
2020-11-25 00:30:23 +01:00
parent c5e2b0f159
commit 199f14667e
4 changed files with 22 additions and 22 deletions

View File

@ -14,14 +14,14 @@ const (
// AlertProvider is the configuration necessary for sending an alert using Messagebird
type AlertProvider struct {
AccessKey string `yaml:"access-key"`
From string `yaml:"from"`
To string `yaml:"to"`
AccessKey string `yaml:"access-key"`
Originator string `yaml:"originator"`
Recipients string `yaml:"recipients"`
}
// IsValid returns whether the provider's configuration is valid
func (provider *AlertProvider) IsValid() bool {
return len(provider.AccessKey) > 0 && len(provider.From) > 0 && len(provider.To) > 0
return len(provider.AccessKey) > 0 && len(provider.Originator) > 0 && len(provider.Recipients) > 0
}
// ToCustomAlertProvider converts the provider into a custom.AlertProvider
@ -41,7 +41,7 @@ func (provider *AlertProvider) ToCustomAlertProvider(service *core.Service, aler
"originator": "%s",
"recipients": "%s",
"body": "%s"
}`, provider.From, provider.To, message),
}`, provider.Originator, provider.Recipients, message),
Headers: map[string]string{
"Content-Type": "application/json",
"Authorization": fmt.Sprintf("AccessKey %s", provider.AccessKey),