Stuff
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Kekskurse 2022-01-16 13:25:40 +01:00
parent 6de086824b
commit b5c5642bf7
Signed by: kekskurse
GPG Key ID: 728ACCB59341E7E4
2 changed files with 21 additions and 0 deletions

2
go.mod
View File

@ -1,3 +1,5 @@
module notfall
go 1.17
require github.com/sms77io/go-client v0.0.0-20211026080708-90d592e387a5

19
main.go
View File

@ -3,8 +3,10 @@ package main
import (
_ "embed"
"encoding/json"
"github.com/sms77io/go-client/sms77api"
"html/template"
"net/http"
"os"
"time"
)
@ -43,6 +45,23 @@ func main() {
})
http.HandleFunc("/activate", func(writer http.ResponseWriter, request *http.Request) {
if active == true {
return
}
var klient = sms77api.New(sms77api.Options{
ApiKey: os.Getenv("sms77key"),
})
sms := sms77api.SmsBaseParams{
Text: "Something",
To: "004917655424258",
From: "Notfall-Portal"
}
klient.Sms.Text(sms77api.SmsTextParams{
SmsBaseParams: sms,
Details: false,
ReturnMessageId: false,
})
active = true
activeSince = time.Now()
})