Documentation ¶
Index ¶
- Constants
- Variables
- func LoginAuth(username, password string) smtp.Auth
- func MailMentionsComment(ctx context.Context, pr *issues_model.PullRequest, c *issues_model.Comment, ...) (err error)
- func MailNewRelease(ctx context.Context, rel *repo_model.Release)
- func MailParticipants(ctx context.Context, issue *issues_model.Issue, doer *user_model.User, ...) error
- func MailParticipantsComment(ctx context.Context, c *issues_model.Comment, ...) error
- func MailTeamInvite(ctx context.Context, inviter *user_model.User, team *org_model.Team, ...) error
- func NewContext(ctx context.Context)
- func NewNotifier() notify_service.Notifier
- func NtlmAuth(username, password string) smtp.Auth
- func SendActivateAccountMail(locale translation.Locale, u *user_model.User)
- func SendActivateEmailMail(u *user_model.User, email *user_model.EmailAddress)
- func SendAsync(msg *Message)
- func SendAsyncs(msgs []*Message)
- func SendCollaboratorMail(u, doer *user_model.User, repo *repo_model.Repository)
- func SendIssueAssignedMail(ctx context.Context, issue *issues_model.Issue, doer *user_model.User, ...) error
- func SendRegisterNotifyMail(u *user_model.User)
- func SendRepoTransferNotifyMail(ctx context.Context, doer, newOwner *user_model.User, ...) error
- func SendResetPasswordMail(u *user_model.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 MailMentionsComment ¶ added in v1.13.2
func MailMentionsComment(ctx context.Context, pr *issues_model.PullRequest, c *issues_model.Comment, mentions []*user_model.User) (err error)
MailMentionsComment sends email to users mentioned in a code comment
func MailNewRelease ¶ added in v1.13.0
func MailNewRelease(ctx context.Context, rel *repo_model.Release)
MailNewRelease send new release notify to all repo watchers.
func MailParticipants ¶
func MailParticipants(ctx context.Context, issue *issues_model.Issue, doer *user_model.User, opType activities_model.ActionType, mentions []*user_model.User) error
MailParticipants sends new issue thread created emails to repository watchers and mentioned people.
func MailParticipantsComment ¶
func MailParticipantsComment(ctx context.Context, c *issues_model.Comment, opType activities_model.ActionType, issue *issues_model.Issue, mentions []*user_model.User) error
MailParticipantsComment sends new comment emails to repository watchers and mentioned people.
func MailTeamInvite ¶ added in v1.17.4
func MailTeamInvite(ctx context.Context, inviter *user_model.User, team *org_model.Team, invite *org_model.TeamInvite) error
MailTeamInvite sends team invites
func NewNotifier ¶ added in v1.21.0
func NewNotifier() notify_service.Notifier
NewNotifier create a new mailNotifier notifier
func SendActivateAccountMail ¶
func SendActivateAccountMail(locale translation.Locale, u *user_model.User)
SendActivateAccountMail sends an activation mail to the user (new user registration)
func SendActivateEmailMail ¶
func SendActivateEmailMail(u *user_model.User, email *user_model.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 *user_model.User, repo *repo_model.Repository)
SendCollaboratorMail sends mail notification to new collaborator.
func SendIssueAssignedMail ¶ added in v1.11.0
func SendIssueAssignedMail(ctx context.Context, issue *issues_model.Issue, doer *user_model.User, content string, comment *issues_model.Comment, recipients []*user_model.User) error
SendIssueAssignedMail composes and sends issue assigned email
func SendRegisterNotifyMail ¶
func SendRegisterNotifyMail(u *user_model.User)
SendRegisterNotifyMail triggers a notify e-mail by admin created a account.
func SendRepoTransferNotifyMail ¶ added in v1.14.0
func SendRepoTransferNotifyMail(ctx context.Context, doer, newOwner *user_model.User, repo *repo_model.Repository) error
SendRepoTransferNotifyMail triggers a notification e-mail when a pending repository transfer was created
func SendResetPasswordMail ¶
func SendResetPasswordMail(u *user_model.User)
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 // Use only one recipient to prevent leaking of addresses ReplyTo 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.