sms

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendTemplate

func SendTemplate[T tmpl.Context](ctx context.Context, cfg config.Config, sender Sender, engine *tmpl.Engine, to []string, t tmpl.Known[T], args T) error

SendTemplates renders a known template

Types

type Account

type Account struct {
	From        string
	AccountSid  string
	AccessToken string
}

type Message

type Message struct {
	From string
	To   []string
	Body string
}

type NoopProvider

type NoopProvider struct{}

func (*NoopProvider) Send

func (*NoopProvider) Send(ctx context.Context, msg Message) error

type Sender

type Sender interface {
	// Send sends msg and returns any error encountered.
	Send(ctx context.Context, msg Message) error
}

Sender can send messages using the Twilio Programmable SMS interface.

func New

func New(acc Account) (Sender, error)

New creates a new SMSSender using acc.

func NewNoopProvider

func NewNoopProvider() Sender

Jump to

Keyboard shortcuts

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