messenger

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContentTypeHTML  = "html"
	ContentTypePlain = "plain"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Attachment

type Attachment struct {
	Name    string
	Header  textproto.MIMEHeader
	Content []byte
}

Attachment represents a file or blob attachment that can be sent along with a message by a Messenger.

type Message

type Message struct {
	From        string
	To          []string
	Subject     string
	ContentType string
	Body        []byte
	AltBody     []byte
	Headers     textproto.MIMEHeader
	Attachments []Attachment

	Subscriber models.Subscriber

	// Campaign is generally the same instance for a large number of subscribers.
	Campaign *models.Campaign
}

Message is the message pushed to a Messenger.

type Messenger

type Messenger interface {
	Name() string
	Push(Message) error
	Flush() error
	Close() error
}

func NewAWSSES

func NewAWSSES(cfg []byte, l *onelog.Logger) (Messenger, error)

NewAWSSES creates new instance of pinpoint

func NewPinpoint

func NewPinpoint(cfg []byte, l *onelog.Logger) (Messenger, error)

NewPinpoint creates new instance of pinpoint

func NewTwilio

func NewTwilio(cfg []byte, l *onelog.Logger) (Messenger, error)

NewTwilio creates new instance of twilio

Jump to

Keyboard shortcuts

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