Documentation ¶
Index ¶
- Constants
- Variables
- func InitMailRender(subjectTpl *texttmpl.Template, bodyTpl *template.Template)
- func LoginAuth(username, password string) smtp.Auth
- func MailMentionsComment(pr *models.PullRequest, c *models.Comment, mentions []*models.User) (err error)
- func MailNewRelease(rel *models.Release)
- func MailParticipants(issue *models.Issue, doer *models.User, opType models.ActionType, ...) error
- func MailParticipantsComment(c *models.Comment, opType models.ActionType, issue *models.Issue, ...) error
- func NewContext()
- func SendActivateAccountMail(locale translation.Locale, u *models.User)
- func SendActivateEmailMail(u *models.User, email *models.EmailAddress)
- func SendAsync(msg *Message)
- func SendAsyncs(msgs []*Message)
- func SendCollaboratorMail(u, doer *models.User, repo *models.Repository)
- func SendIssueAssignedMail(issue *models.Issue, doer *models.User, content string, ...) error
- func SendRegisterNotifyMail(u *models.User)
- func SendRepoTransferNotifyMail(doer, newOwner *models.User, repo *models.Repository) error
- func SendResetPasswordMail(u *models.User)
- func SendTestMail(email string) error
- type Message
Constants ¶
const (
// MailBatchSize set the batch size used in mailIssueCommentBatch
MailBatchSize = 100
)
Variables ¶
var Sender gomail.Sender
Sender sender for sending mail synchronously
Functions ¶
func InitMailRender ¶
InitMailRender initializes the mail renderer
func MailMentionsComment ¶ added in v1.13.2
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 ¶ added in v1.13.0
MailNewRelease send new release notify to all all repo watchers.
func MailParticipants ¶
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 ¶
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 SendActivateAccountMail ¶
func SendActivateAccountMail(locale translation.Locale, u *models.User)
SendActivateAccountMail sends an activation mail to the user (new user registration)
func SendActivateEmailMail ¶
func SendActivateEmailMail(u *models.User, email *models.EmailAddress)
SendActivateEmailMail sends confirmation email to confirm new email address
func SendAsyncs ¶ added in v1.11.0
func SendAsyncs(msgs []*Message)
SendAsyncs send mails asynchronously
func SendCollaboratorMail ¶
func SendCollaboratorMail(u, doer *models.User, repo *models.Repository)
SendCollaboratorMail sends mail notification to new collaborator.
func SendIssueAssignedMail ¶ added in v1.11.0
func SendIssueAssignedMail(issue *models.Issue, doer *models.User, content string, comment *models.Comment, recipients []*models.User) error
SendIssueAssignedMail composes and sends issue assigned email
func SendRegisterNotifyMail ¶
SendRegisterNotifyMail triggers a notify e-mail by admin created a account.
func SendRepoTransferNotifyMail ¶ added in v1.14.0
func SendRepoTransferNotifyMail(doer, newOwner *models.User, repo *models.Repository) error
SendRepoTransferNotifyMail triggers a notification e-mail when a pending repository transfer was created
func SendResetPasswordMail ¶
SendResetPasswordMail sends a password reset mail to the user
Types ¶
type Message ¶
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 ¶
NewMessage creates new mail message object with default From header.
func NewMessageFrom ¶
NewMessageFrom creates new mail message object with custom From header.