Added SMSGlobal config variable support.

This commit is contained in:
Adrian Gallagher
2015-03-03 22:48:25 +11:00
parent a167f1f8f4
commit 2977664da6
3 changed files with 8 additions and 4 deletions

View File

@@ -13,6 +13,8 @@ type SMSContacts struct {
type Config struct {
Name string
SMSGlobalUsername string
SMSGlobalPassword string
SMSContacts []SMSContacts
Exchanges []Exchanges
}

View File

@@ -1,5 +1,7 @@
{
"Name": "Skynet",
"SMSGlobalUsername": "Username",
"SMSGlobalPassword": "Password",
"SMSContacts" : [
{
"Name": "Bob",

View File

@@ -13,12 +13,12 @@ const (
SMSGLOBAL_API_URL = "http://www.smsglobal.com/http-api.php"
)
func SMSNotify(username, password, from, to, message string) (error) {
func SMSNotify(to, message string) (error) {
values := url.Values{}
values.Set("action", "sendsms")
values.Set("user", username)
values.Set("password", password)
values.Set("from", from)
values.Set("user", bot.config.SMSGlobalUsername)
values.Set("password", bot.config.SMSGlobalPassword)
values.Set("from", bot.config.Name)
values.Set("to", to)
values.Set("text", message)