email

package
v0.0.0-...-e612854 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2022 License: LGPL-2.1 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attachment

type Attachment struct {
	Path     string
	FileName string
}

type Email

type Email struct {
	ReplyTo     string
	From        string
	To          []string
	Bcc         []string
	Cc          []string
	Subject     string
	BodyHTML    string // Html message (optional)
	Attachments []Attachment
}

type EmailConfig

type EmailConfig struct {
	From           string
	SMTPLogin      *SMTPLogin
	SEScredentials *SESCredentials
}

func NewSESConfig

func NewSESConfig(from string, region string, accessKey string, secretKey string) *EmailConfig

func NewSMTPConfig

func NewSMTPConfig(from string, host string, user string, pass string) *EmailConfig

type EmailSender

type EmailSender interface {
	SendEmail(to string, subject string, body string) error
	SendEmailAdv(e *Email) error
}

type Emailer

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

func NewEmailer

func NewEmailer(conf *EmailConfig) *Emailer

func (*Emailer) SendEmail

func (emx *Emailer) SendEmail(to string, subject string, body string) error

func (*Emailer) SendEmailAdv

func (emx *Emailer) SendEmailAdv(em *Email) error

type SESCredentials

type SESCredentials struct {
	AWSRegion string
	AccessKey string
	SecretKey string
}

type SMTPLogin

type SMTPLogin struct {
	Host     string
	UserName string
	Password string
}

Jump to

Keyboard shortcuts

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