twilio

package
v0.0.0-...-dc9cd0e Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2019 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SMS

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

SMS is the service object. No public data, only two public methods: `Send` and `Hook` for interacting with Twilio.

func Default

func Default(id, secret, from string) SMS

Default gives an instance of the `SMS` service object. A slight abstraction over github.com/sfreiberg/gotwilio and a `Hook` for HTTP requests from Twilio themselves.

func (SMS) Hook

func (sms SMS) Hook(c *gin.Context) (_number, _text string, _err error)

Hook handles webhooks from Twilio. Used to receive text messages from users. Returns user phone number, user text, and potential error from reading and parsing payload from Twilio.

func (SMS) Send

func (sms SMS) Send(to, text string) error

Send pushes the `text` to `to` via Twilio. May return an error from `twilio.SendMMS`.

Jump to

Keyboard shortcuts

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