{"modulePath":"github.com/RedAFD/code-core","version":"v1.14.0-rc8","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package mailer\n\n## Variables\n\n```go\nvar Sender gomail.Sender\n```\nSender sender for sending mail synchronously\n\n## Functions\n\n```go\nfunc InitMailRender(subjectTpl *texttmpl.Template, bodyTpl *template.Template)\n```\nInitMailRender initializes the mail renderer\n\n```go\nfunc LoginAuth(username, password string) smtp.Auth\n```\nLoginAuth SMTP AUTH LOGIN Auth Handler\n\n```go\nfunc MailMentionsComment(pr *models.PullRequest, c *models.Comment, mentions []*models.User) (err error)\n```\nMailMentionsComment sends email to users mentioned in a code comment\n\n```go\nfunc MailNewRelease(rel *models.Release)\n```\nMailNewRelease send new release notify to all all repo watchers.\n\n```go\nfunc MailParticipants(issue *models.Issue, doer *models.User, opType models.ActionType, mentions []*models.User) error\n```\nMailParticipants sends new issue thread created emails to repository watchers and mentioned people.\n\n```go\nfunc MailParticipantsComment(c *models.Comment, opType models.ActionType, issue *models.Issue, mentions []*models.User) error\n```\nMailParticipantsComment sends new comment emails to repository watchers and mentioned people.\n\n```go\nfunc NewContext()\n```\nNewContext start mail queue service\n\n```go\nfunc SendActivateAccountMail(locale Locale, u *models.User)\n```\nSendActivateAccountMail sends an activation mail to the user (new user registration)\n\n```go\nfunc SendActivateEmailMail(locale Locale, u *models.User, email *models.EmailAddress)\n```\nSendActivateEmailMail sends confirmation email to confirm new email address\n\n```go\nfunc SendAsync(msg *Message)\n```\nSendAsync send mail asynchronously\n\n```go\nfunc SendAsyncs(msgs []*Message)\n```\nSendAsyncs send mails asynchronously\n\n```go\nfunc SendCollaboratorMail(u, doer *models.User, repo *models.Repository)\n```\nSendCollaboratorMail sends mail notification to new collaborator.\n\n```go\nfunc SendIssueAssignedMail(issue *models.Issue, doer *models.User, content string, comment *models.Comment, tos []string)\n```\nSendIssueAssignedMail composes and sends issue assigned email\n\n```go\nfunc SendRegisterNotifyMail(locale Locale, u *models.User)\n```\nSendRegisterNotifyMail triggers a notify e-mail by admin created a account.\n\n```go\nfunc SendRepoTransferNotifyMail(doer, newOwner *models.User, repo *models.Repository) error\n```\nSendRepoTransferNotifyMail triggers a notification e-mail when a pending repository transfer was created\n\n```go\nfunc SendResetPasswordMail(locale Locale, u *models.User)\n```\nSendResetPasswordMail sends a password reset mail to the user\n\n```go\nfunc SendTestMail(email string) error\n```\nSendTestMail sends a test mail\n\n```go\nfunc SendUserMail(language string, u *models.User, tpl base.TplName, code, subject, info string)\n```\nSendUserMail sends a mail to the user\n\n## Types\n\n```go\ntype Locale interface {\n\tLanguage() string\n\tTr(string, ...interface{}) string\n}\n```\nLocale represents an interface to translation\n\n```go\ntype Message struct {\n\tInfo            string // Message information for log purpose.\n\tFromAddress     string\n\tFromDisplayName string\n\tTo              []string\n\tSubject         string\n\tDate            time.Time\n\tBody            string\n\tHeaders         map[string][]string\n}\n```\nMessage mail body and log info\n\n```go\nfunc NewMessage(to []string, subject, body string) *Message\n```\nNewMessage creates new mail message object with default From header.\n\n```go\nfunc NewMessageFrom(to []string, fromDisplayName, fromAddress, subject, body string) *Message\n```\nNewMessageFrom creates new mail message object with custom From header.\n\n```go\nfunc (m *Message) SetHeader(field string, value ...string)\n```\nSetHeader adds additional headers to a message\n\n```go\nfunc (m *Message) ToMessage() *gomail.Message\n```\nToMessage converts a Message to gomail.Message\n\n","path":"github.com/RedAFD/code-core/services/mailer","name":"mailer","synopsis":"","isRedistributable":true}
