mail

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2020 License: Apache-2.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 Mail

type Mail struct {
	ExternalURL string
	FromName    string
	FromEmail   string
}

Mail provides a mail service implementation

func NewMail

func NewMail(mc *config.MailConfig, sc *config.SiteConfig) *Mail

NewMail generates new Mail variable

func (*Mail) Send

func (m *Mail) Send(subject string, toName string, toEmail string, content string) error

Send email with sendgrid

func (*Mail) SendVerificationEmail

func (m *Mail) SendVerificationEmail(toEmail string, v *model.Verification) error

SendVerificationEmail assumes defaults and generates a verification email

func (*Mail) SendWithDefaults

func (m *Mail) SendWithDefaults(subject, toEmail, content string) error

SendWithDefaults assumes some defaults for sending out email with sendgrid

type Service

type Service interface {
	Send(subject string, toName string, toEmail string, content string) error
	SendWithDefaults(subject, toEmail, content string) error
	SendVerificationEmail(toEmail string, v *model.Verification) error
}

Service is the interface to access our Mail

Jump to

Keyboard shortcuts

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