elk46

package
v0.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 7, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StausCreated   Status = "created"   // We've received your request.
	StatusSent            = "send"      // We've sent your message to the recipient
	StatusFailed          = "failed"    // Unable to deliver your message
	StatuDelivered        = "delivered" // Message has reached recipient's phone.
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DeliveryReport

type DeliveryReport struct {
	// 46elk message id
	Id string `json:"id"`
	// Either ”delivered” or ”failed”.
	Status Status `json:"status"`
	// The delivery time in UTC. Only included if status is set to delivered.
	Delivered string `json:"delivered"`
}

type Dummy

type Dummy struct {
	// contains filtered or unexported fields
}

func NewDummy

func NewDummy() *Dummy

func (*Dummy) LastMessage

func (d *Dummy) LastMessage() *SmsLog

func (*Dummy) SendSms

func (d *Dummy) SendSms(to, message string) (*Response, error)

type Elk46

type Elk46 interface {
	SendSms(to, message string) (*Response, error)
}

https://46elks.se/docs/send-sms

func NewSender

func NewSender(from, username, password, callbackurl, dryrun string) Elk46

from The sender of the SMS as seen by the recipient. Either a text sender ID or a phone number in E.164 format if you want to be able to receive replies. username for accessing the api password for accessing the api callbackurl to handle delivery reports. Can be blank to skip callbacks. dryrun yes or no

type Response

type Response struct {
	Id            string `json:"id"`
	Status        Status `json:"status"`
	From          string `json:"from"`
	To            string `json:"to"`
	Parts         int    `json:"parts"`
	Message       string `json:"message"`
	Created       string `json:"created"`
	Delivered     string `json:"delivered"`
	Cost          int    `json:"cost"`
	EstimatedCost int    `json:"estimated_cost"`
	Direction     string `json:"direction"`
	DontLog       string `json:"dontLog"`
}

type Sender

type Sender struct {
	// contains filtered or unexported fields
}

func (*Sender) SendSms

func (s *Sender) SendSms(to, message string) (*Response, error)

type SmsLog

type SmsLog struct {
	To      string
	Message string
}

type Status

type Status string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL