gitea: Index | Files

package mailer

import ""


Package Files

mail.go mail_comment.go mail_issue.go mail_release.go mailer.go


var Sender gomail.Sender

Sender sender for sending mail synchronously

func InitMailRender Uses

func InitMailRender(subjectTpl *texttmpl.Template, bodyTpl *template.Template)

InitMailRender initializes the mail renderer

func LoginAuth Uses

func LoginAuth(username, password string) smtp.Auth

LoginAuth SMTP AUTH LOGIN Auth Handler

func MailMentionsComment Uses

func MailMentionsComment(pr *models.PullRequest, c *models.Comment, mentions []*models.User) (err error)

MailMentionsComment sends email to users mentioned in a code comment

func MailNewRelease Uses

func MailNewRelease(rel *models.Release)

MailNewRelease send new release notify to all all repo watchers.

func MailParticipants Uses

func MailParticipants(issue *models.Issue, doer *models.User, opType models.ActionType, mentions []*models.User) error

MailParticipants sends new issue thread created emails to repository watchers and mentioned people.

func MailParticipantsComment Uses

func MailParticipantsComment(c *models.Comment, opType models.ActionType, issue *models.Issue, mentions []*models.User) error

MailParticipantsComment sends new comment emails to repository watchers and mentioned people.

func NewContext Uses

func NewContext()

NewContext start mail queue service

func SendActivateAccountMail Uses

func SendActivateAccountMail(locale Locale, u *models.User)

SendActivateAccountMail sends an activation mail to the user (new user registration)

func SendActivateEmailMail Uses

func SendActivateEmailMail(locale Locale, u *models.User, email *models.EmailAddress)

SendActivateEmailMail sends confirmation email to confirm new email address

func SendAsync Uses

func SendAsync(msg *Message)

SendAsync send mail asynchronously

func SendAsyncs Uses

func SendAsyncs(msgs []*Message)

SendAsyncs send mails asynchronously

func SendCollaboratorMail Uses

func SendCollaboratorMail(u, doer *models.User, repo *models.Repository)

SendCollaboratorMail sends mail notification to new collaborator.

func SendIssueAssignedMail Uses

func SendIssueAssignedMail(issue *models.Issue, doer *models.User, content string, comment *models.Comment, tos []string)

SendIssueAssignedMail composes and sends issue assigned email

func SendRegisterNotifyMail Uses

func SendRegisterNotifyMail(locale Locale, u *models.User)

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

func SendResetPasswordMail Uses

func SendResetPasswordMail(locale Locale, u *models.User)

SendResetPasswordMail sends a password reset mail to the user

func SendTestMail Uses

func SendTestMail(email string) error

SendTestMail sends a test mail

func SendUserMail Uses

func SendUserMail(language string, u *models.User, tpl base.TplName, code, subject, info string)

SendUserMail sends a mail to the user

type Locale Uses

type Locale interface {
    Language() string
    Tr(string, ...interface{}) string

Locale represents an interface to translation

type Message Uses

type Message struct {
    Info            string // Message information for log purpose.
    FromAddress     string
    FromDisplayName string
    To              []string
    Subject         string
    Date            time.Time
    Body            string
    Headers         map[string][]string

Message mail body and log info

func NewMessage Uses

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

NewMessage creates new mail message object with default From header.

func NewMessageFrom Uses

func NewMessageFrom(to []string, fromDisplayName, fromAddress, subject, body string) *Message

NewMessageFrom creates new mail message object with custom From header.

func (*Message) SetHeader Uses

func (m *Message) SetHeader(field string, value ...string)

SetHeader adds additional headers to a message

func (*Message) ToMessage Uses

func (m *Message) ToMessage() *gomail.Message

ToMessage converts a Message to gomail.Message

Package mailer imports 28 packages (graph) and is imported by 39 packages. Updated 2021-01-22. Refresh now. Tools for package owners.