mailer

package
v0.11.4 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2017 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

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

	MAIL_ISSUE_COMMENT = "issue/comment"
	MAIL_ISSUE_MENTION = "issue/mention"

	MAIL_NOTIFY_COLLABORATOR = "notify/collaborator"
)

Variables

This section is empty.

Functions

func InitMailRender

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

func LoginAuth

func LoginAuth(username, password string) smtp.Auth

SMTP AUTH LOGIN Auth Handler

func NewContext

func NewContext()

func SendActivateAccountMail

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

func SendActivateEmailMail

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

SendActivateAccountMail sends confirmation email.

func SendAsync

func SendAsync(msg *Message)

func SendCollaboratorMail

func SendCollaboratorMail(u, doer User, repo Repository)

SendCollaboratorMail sends mail notification to new collaborator.

func SendIssueCommentMail

func SendIssueCommentMail(issue Issue, repo Repository, doer User, tos []string)

SendIssueCommentMail composes and sends issue comment emails to target receivers.

func SendIssueMentionMail

func SendIssueMentionMail(issue Issue, repo Repository, doer User, tos []string)

SendIssueMentionMail composes and sends issue mention emails to target receivers.

func SendRegisterNotifyMail

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

SendRegisterNotifyMail triggers a notify e-mail by admin created a account.

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, code, subject, info string)

Types

type Issue

type Issue interface {
	MailSubject() string
	Content() string
	HTMLURL() string
}

type MailRender

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

type Message

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

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 Repository

type Repository interface {
	FullName() string
	HTMLURL() string
	ComposeMetas() map[string]string
}

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