mailer

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2018 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitMailRender

func InitMailRender(dir string, funcMap []template.FuncMap)

InitMailRender templating system

func LoginAuth

func LoginAuth(username, password string) smtp.Auth

LoginAuth SMTP AUTH LOGIN Auth Handler

func NewContext

func NewContext()

NewContext initiate the mailing process

func SendActivateAccountMail

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

SendActivateAccountMail when activating account

func SendActivateEmailMail

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

SendActivateEmailMail sends confirmation email.

func SendAsync

func SendAsync(msg *Message)

SendAsync in the background

func SendResetPasswordMail

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

SendResetPasswordMail when resetting password

func SendTestMail

func SendTestMail(email string) error

SendTestMail as indicated

func SendUserMail

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

SendUserMail to the User

Types

type MailRender

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

MailRender the template

type Message

type Message struct {
	Info string // Message information for log purpose.
	*gomail.Message
}

Message content

func NewMessage

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

NewMessage creates new mail message object with default From header.

func NewMessageFrom

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

NewMessageFrom creates new mail message object with custom From header.

type Sender

type Sender struct {
}

Sender struct

func (*Sender) Send

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

Send the mail

type User

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

User is email user

Jump to

Keyboard shortcuts

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