-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Use templates for issue e-mail subject and body #8329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 20 commits
Commits
Show all changes
57 commits
Select commit
Hold shift + click to select a range
9dbabcd
Merge go-gitea/master into master
guillep2k 889c619
Merge branch 'master' of github.com:go-gitea/gitea
guillep2k d7c46c8
Merge branch 'master' of github.com:go-gitea/gitea
guillep2k 8eaacbf
Merge remote-tracking branch 'refs/remotes/origin/master'
guillep2k de5aa64
Merge branch 'master' of github.com:go-gitea/gitea
guillep2k 80c6f2b
Merge branch 'master' of github.com:go-gitea/gitea
guillep2k ac40f7f
Merge branch 'master' of github.com:go-gitea/gitea
guillep2k f6ac46b
Merge branch 'master' of github.com:go-gitea/gitea
guillep2k b563158
Merge branch 'master' of github.com:go-gitea/gitea
guillep2k 6f55d1e
Merge branch 'master' of github.com:go-gitea/gitea
guillep2k 188e164
Merge branch 'master' of github.com:go-gitea/gitea
guillep2k fd6fe8c
Merge branch 'master' of github.com:go-gitea/gitea
guillep2k 54624dd
Merge branch 'master' of github.com:go-gitea/gitea
guillep2k e2a6388
Merge branch 'master' of github.com:go-gitea/gitea
guillep2k 2714a5d
Add template capability for issue mail subject
guillep2k c4f6c1d
Remove test string
guillep2k 83624a9
Fix trim subject length
guillep2k c68bbd6
Add comment to template and run make fmt
guillep2k 3d25d11
Add information for the template
guillep2k a366af6
Merge branch 'master' into fix-email-subject
guillep2k 78b2e34
merge from latest master
guillep2k 6049215
Rename defaultMailSubject() to fallbackMailSubject()
guillep2k 39a6094
Merge branch 'master' into fix-email-subject
guillep2k 70d1d44
General rewrite of the mail template code
guillep2k 120ff55
Merge branch 'master' into fix-email-subject
guillep2k 679338b
Fix .Doer name
guillep2k 24967be
Use text/template for subject instead of html
guillep2k 1ce2530
Fix subject Re: prefix
guillep2k 2bba363
Fix mail tests
guillep2k 6aa4433
Fix static templates
guillep2k b31fb25
Merge branch 'master' into fix-email-subject
guillep2k 8383b95
[skip ci] Updated translations via Crowdin
GiteaBot 3db7c21
Expose db.SetMaxOpenConns and allow non MySQL dbs to set conn pool pa…
zeripath ab1ab0f
Prevent .code-view from overriding font on icon fonts (#8614)
zeripath 7d5074b
Correct some outdated statements in the contributing guidelines (#8612)
lukbukkit 9140b3b
Remove TrN due to lack of lang context
guillep2k 554850e
Redo templates to match previous code
guillep2k fe6f873
Merge branch 'fix-email-subject' of github.com:guillep2k/gitea into f…
guillep2k f65e5d2
Fix extra character in template
guillep2k 111a036
Unify PR & Issue tempaltes, fix format
guillep2k fa9e93b
Remove default subject
guillep2k cbf32f1
Add template tests
guillep2k d823b73
Fix template
guillep2k 083f26e
Remove replaced function
guillep2k 1a40a79
Merge branch 'master' into fix-email-subject
guillep2k 74d9c3b
Provide User as models.User for better consistency
guillep2k e02aa11
Add docs
guillep2k e1ab7c4
Fix doc inaccuracies, improve examples
guillep2k e4065fc
Merge branch 'master' into fix-email-subject
guillep2k c84a489
Change mail footer to math AppName
guillep2k 1d0302d
Merge branch 'master' into fix-email-subject
guillep2k 2cad1b1
Add test for mail subject/body template separation
guillep2k 507ef55
Add support for code review comments
guillep2k 52966ee
Merge master and resolve conflicts
guillep2k 93e8cfa
Update docs/content/doc/advanced/mail-templates-us.md
guillep2k 21d9de0
Merge branch 'master' into fix-email-subject
lunny 79f891f
Merge branch 'master' into fix-email-subject
lunny File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,13 +51,13 @@ func TestComposeIssueCommentMessage(t *testing.T) { | |
InitMailRender(email) | ||
|
||
tos := []string{"[email protected]", "[email protected]"} | ||
msg := composeIssueCommentMessage(issue, doer, "test body", comment, mailIssueComment, tos, "issue comment") | ||
msg := composeIssueCommentMessage(issue, doer, models.ActionCommentIssue, false, "test body", comment, mailIssueComment, tos, "issue comment") | ||
|
||
subject := msg.GetHeader("Subject") | ||
inreplyTo := msg.GetHeader("In-Reply-To") | ||
references := msg.GetHeader("References") | ||
|
||
assert.Equal(t, subject[0], "Re: "+mailSubject(issue), "Comment reply subject should contain Re:") | ||
assert.Equal(t, subject[0], "Re: "+defaultMailSubject(issue), "Comment reply subject should contain Re:") | ||
guillep2k marked this conversation as resolved.
Show resolved
Hide resolved
|
||
assert.Equal(t, inreplyTo[0], "<user2/repo1/issues/1@localhost>", "In-Reply-To header doesn't match") | ||
assert.Equal(t, references[0], "<user2/repo1/issues/1@localhost>", "References header doesn't match") | ||
} | ||
|
@@ -79,12 +79,12 @@ func TestComposeIssueMessage(t *testing.T) { | |
InitMailRender(email) | ||
|
||
tos := []string{"[email protected]", "[email protected]"} | ||
msg := composeIssueCommentMessage(issue, doer, "test body", nil, mailIssueComment, tos, "issue create") | ||
msg := composeIssueCommentMessage(issue, doer, models.ActionCreateIssue, false, "test body", nil, mailIssueComment, tos, "issue create") | ||
|
||
subject := msg.GetHeader("Subject") | ||
messageID := msg.GetHeader("Message-ID") | ||
|
||
assert.Equal(t, subject[0], mailSubject(issue), "Subject not equal to issue.mailSubject()") | ||
assert.Equal(t, subject[0], defaultMailSubject(issue), "Subject not equal to issue.mailSubject()") | ||
assert.Nil(t, msg.GetHeader("In-Reply-To")) | ||
assert.Nil(t, msg.GetHeader("References")) | ||
assert.Equal(t, messageID[0], "<user2/repo1/issues/1@localhost>", "Message-ID header doesn't match") | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[{{.Repo}}] {{.Doer}} | ||
{{if eq .Action 6}} | ||
created issue #{{.Issue.Index}} | ||
{{else if eq .Action 7}} | ||
created PR #{{.Issue.Index}} | ||
{{else if eq .Action 10}} | ||
commented on #{{.Issue.Index}} | ||
{{else if eq .Action 12}} | ||
closed issue #{{.Issue.Index}} | ||
{{else if eq .Action 13}} | ||
reopened issue #{{.Issue.Index}} | ||
{{else if eq .Action 14}} | ||
closed PR #{{.Issue.Index}} | ||
{{else if eq .Action 15}} | ||
reopened PR #{{.Issue.Index}} | ||
{{else}} | ||
commented/acted upon #{{.Issue.Index}} | ||
{{end}} | ||
- {{.Issue.Title}} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.