body

package
v0.0.0-...-41ef739 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2016 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 MailBody

type MailBody struct {
	Headers textproto.MIMEHeader
	// contains filtered or unexported fields
}

MailBody represents HTML text for use in an HTML email.

func FromFile

func FromFile(filename string) *MailBody

FromFile will return a MailBody based upon the text at the given filename.

func FromReader

func FromReader(reader io.Reader) *MailBody

FromReader will return a MailBody based upon the provided data.

func FromString

func FromString(body string) *MailBody

FromString will return a MailBody based upon the text provided.

func TemplateFromFile

func TemplateFromFile(filename string, data *interface{}) *MailBody

TemplateFromFile will return a MailBody based upon the template at the given filename. A pointer to an interface{} is accepted so that this object can be updated with different data. This allows for generating multiple emails with different data from the same template.

func TemplateFromReader

func TemplateFromReader(reader io.Reader, data interface{}) *MailBody

TemplateFromReader will return a MailBody based upon the template using the provided data.

func TemplateFromString

func TemplateFromString(body string) *MailBody

TemplateFromString

func (*MailBody) GenerateBody

func (b *MailBody) GenerateBody() string

GenerateBody will perform any parsing and return the message body.

Jump to

Keyboard shortcuts

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