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

Function composeIssueMessage

internal/email/email.go:195–208  ·  view source on GitHub ↗
(issue Issue, repo Repository, doer User, tplName string, tos []string, info string)

Source from the content-addressed store, hash-verified

193}
194
195func composeIssueMessage(issue Issue, repo Repository, doer User, tplName string, tos []string, info string) *Message {
196 subject := issue.MailSubject()
197 body := string(markup.Markdown([]byte(issue.Content()), repo.HTMLURL(), repo.ComposeMetas()))
198 data := composeTplData(subject, body, issue.HTMLURL())
199 data["Doer"] = doer
200 content, err := render(tplName, data)
201 if err != nil {
202 log.Error("HTMLString (%s): %v", tplName, err)
203 }
204 from := gomail.NewMessage().FormatAddress(conf.Email.FromEmail, doer.DisplayName())
205 msg := NewMessageFrom(tos, from, subject, content)
206 msg.Info = fmt.Sprintf("Subject: %s, %s", subject, info)
207 return msg
208}
209
210// SendIssueCommentMail composes and sends issue comment emails to target receivers.
211func SendIssueCommentMail(issue Issue, repo Repository, doer User, tos []string) {

Callers 2

SendIssueCommentMailFunction · 0.85
SendIssueMentionMailFunction · 0.85

Calls 11

MarkdownFunction · 0.92
stringFunction · 0.85
composeTplDataFunction · 0.85
renderFunction · 0.85
NewMessageFromFunction · 0.85
MailSubjectMethod · 0.65
ContentMethod · 0.65
HTMLURLMethod · 0.65
ComposeMetasMethod · 0.65
DisplayNameMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected