mailer

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2017 License: MIT Imports: 13 Imported by: 4

Documentation

Index

Constants

View Source
const (
	MAIL_AUTH_ACTIVATE        infrastructure.TplName = "auth/activate"
	MAIL_AUTH_ACTIVATE_EMAIL  infrastructure.TplName = "auth/activate_email"
	MAIL_AUTH_RESET_PASSWORD  infrastructure.TplName = "auth/reset_passwd"
	MAIL_AUTH_REGISTER_NOTIFY infrastructure.TplName = "auth/register_notify"
)

Variables

This section is empty.

Functions

func InitMail

func InitMail(activeCodeLives, resetPwdCodeLives int, renderOption *macaron.RenderOptions, mailer *Mailer)

func LoginAuth

func LoginAuth(username, password string) smtp.Auth

func SendActivateAccountMail

func SendActivateAccountMail(c *macaron.Context, u User)

func SendActivateEmailMail

func SendActivateEmailMail(c *macaron.Context, u User, email string)

func SendAsync

func SendAsync(msg *Message)

func SendRegisterNotifyMail

func SendRegisterNotifyMail(c *macaron.Context, u User)

func SendResetPasswordMail

func SendResetPasswordMail(c *macaron.Context, u User)

func SendTestMail

func SendTestMail(email string) error

func SendUserMail

func SendUserMail(c *macaron.Context, u User, tpl infrastructure.TplName, code, subject, info string)

Types

type MailRender

type MailRender interface {
	HTMLString(string, interface{}, ...macaron.HTMLOptions) (string, error)
}

type Mailer

type Mailer struct {
	QueueLength           int
	Name                  string
	Host                  string
	From                  string
	FromEmail             string
	User, Passwd          string
	DisableHelo           bool
	HeloHostname          string
	SkipVerify            bool
	UseCertificate        bool
	CertFile, KeyFile     string
	EnableHTMLAlternative bool
}

type Message

type Message struct {
	Info string
	*gomail.Message
}

func NewMessage

func NewMessage(to []string, subject, body string) *Message

func NewMessageFrom

func NewMessageFrom(to []string, from, subject, htmlBody string) *Message

type Sender

type Sender struct {
}

func (*Sender) Send

func (s *Sender) Send(from string, to []string, msg io.WriterTo) error

type User

type User interface {
	ID() int64
	DisplayName() string
	Email() string
	GenerateActivateCode() string
	GenerateEmailActivateCode(string) string
}

Jump to

Keyboard shortcuts

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