message

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attachment added in v0.2.0

type Attachment struct {
	// Type content type.
	Type string `json:"type"`
	// Name attachment name.
	Name string `json:"name"`
	// Content base64-encoded file content.
	Content string `json:"content"`
}

Attachment object.

func NewAttachment added in v0.2.0

func NewAttachment(fileName string, n ...string) (a *Attachment, err error)

NewAttachment returns Attachment by file name.

type Message

type Message interface {
	// Header sets custom email header.
	Header(key, val string) Message

	// From sets sender's contact.
	From(email string, name ...string) Message

	// ReplyTo sets email Reply-To header.
	ReplyTo(email string) Message

	// To sets email recipients.
	To(recipients ...Recipient) Message

	// Subject sets email subject.
	Subject(subject string) Message

	// BodyHtml sets email html body part.
	BodyHtml(html string) Message

	// BodyPlainText sets email plain text body part.
	BodyPlainText(plainText string) Message

	// Attach attaches file to message.
	Attach(fileName string) (err error)

	// InlineAttach attaches file inline.
	InlineAttach(fileName, name string) (err error)

	// Substitution passes the substitution to user.
	Substitution(key string, val interface{}) Message

	// Meta sets metadata value. Used for webhooks.
	//
	// See: https://one.unisender.com/en/docs/page/Webhook.
	Meta(key string, val interface{}) Message

	// TrackLinks enables email links tracking.
	TrackLinks() Message

	// TrackRead enables email read tracking.
	TrackRead() Message

	// Option sets custom email option.
	Option(key string, val interface{}) Message

	// UnsubscribeUrl sets custom unsubscribe link.
	//
	// See: https://one.unisender.com/en/docs/page/send#unsub
	UnsubscribeUrl(u string) Message
}

Message email message interface.

func NewMessage

func NewMessage() Message

NewMessage returns new message object.

type Recipient

type Recipient interface {
	// Name sets recipient name.
	Name(name string) Recipient

	// Substitution sets user substitution value.
	Substitution(key string, val interface{}) Recipient

	// Meta sets user meta param.
	Meta(key string, val interface{}) Recipient
}

Recipient email recipient interface.

func NewRecipient

func NewRecipient(email string) Recipient

NewRecipient returns new recipient object.

Jump to

Keyboard shortcuts

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