README
¶
TextMagic
Prerequisites
You will need to have a TextMagic account and
UserName
and API KEY
from TextMagic.(api-keys)
package main
import (
"context"
"log"
"github.com/nikoksr/notify"
"github.com/nikoksr/notify/service/textmagic"
)
func main() {
textMagicService := textmagic.New("YOUR_USER_NAME", "YOUR_API_KEY")
textMagicService.AddReceivers("Destination1-Phone-Number")
notifier := notify.New()
notifier.UseServices(textMagicService)
err := notifier.Send(context.Background(), "subject", "message")
if err != nil {
log.Fatalf("notifier.Send() failed: %s", err.Error())
}
log.Printf("notification sent")
}
Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service allow you to configure a TextMagic SDK client.
func New ¶
New creates a new text magic client. Use your user-name and API key from https://my.textmagic.com/online/api/rest-api/keys.
func (*Service) AddReceivers ¶
AddReceivers adds the given phone numbers to the notifier.
Click to show internal directories.
Click to hide internal directories.