MCPcopy Create free account
hub / github.com/gogs/gogs / SendRegisterNotifyMail

Function SendRegisterNotifyMail

internal/email/email.go:150–164  ·  view source on GitHub ↗

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

(c *macaron.Context, u User)

Source from the content-addressed store, hash-verified

148
149// SendRegisterNotifyMail triggers a notify e-mail by admin created a account.
150func SendRegisterNotifyMail(c *macaron.Context, u User) {
151 data := map[string]any{
152 "Username": u.DisplayName(),
153 }
154 body, err := render(tmplAuthRegisterNotify, data)
155 if err != nil {
156 log.Error("HTMLString: %v", err)
157 return
158 }
159
160 msg := NewMessage([]string{u.Email()}, c.Tr("mail.register_notify"), body)
161 msg.Info = fmt.Sprintf("UID: %d, registration notify", u.ID())
162
163 Send(msg)
164}
165
166// SendCollaboratorMail sends mail notification to new collaborator.
167func SendCollaboratorMail(u, doer User, repo Repository) {

Callers 2

CreateUserFunction · 0.92
NewUserPostFunction · 0.92

Calls 8

renderFunction · 0.85
NewMessageFunction · 0.85
SendFunction · 0.85
TrMethod · 0.80
DisplayNameMethod · 0.65
EmailMethod · 0.65
IDMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected