]> source.dussan.org Git - gitea.git/commit
Mail assignee when issue/pull request is assigned (#8546)
authorDavid Svantesson <davidsvantesson@gmail.com>
Fri, 25 Oct 2019 14:46:37 +0000 (16:46 +0200)
committerLunny Xiao <xiaolunwen@gmail.com>
Fri, 25 Oct 2019 14:46:37 +0000 (22:46 +0800)
commit6aa3f8bc29cb1ed3a1b165cbf526079a751c8c71
treed18aafe7855f9d21fb0d8d7104e7ac7b4aba72b2
parentc34e58fc008d53a5ec92cadadab2b13fb4e0ae94
Mail assignee when issue/pull request is assigned (#8546)

* Send email to assigned user

* Only send mail if enabled

* Mail also when assigned through API

* Need to refactor functions from models to issue service

* Refer to issue index rather than ID

* Disable email notifications completly at initalization if global disable

* Check of user enbled mail shall be in mail notification function only

* Initialize notifications from routers init function.

* Use the assigned comment when sending assigned mail

* Refactor so that assignees always added as separate step when new issue/pr.

* Check error from AddAssignees

* Check if user can be assiged to issue or pull request

* Missing return

* Refactor of CanBeAssigned check.

CanBeAssigned shall have same check as UI.

* Clarify function names (toggle rather than update/change), and clean up.

* Fix review comments.

* Flash error if assignees was not added when creating issue/pr

* Generate error if assignee users doesn't exist
23 files changed:
models/issue.go
models/issue_assignees.go
models/issue_assignees_test.go
models/issue_test.go
models/issue_user.go
models/pull.go
models/repo_permission.go
models/user.go
modules/notification/base/notifier.go
modules/notification/base/null.go
modules/notification/mail/mail.go
modules/notification/notification.go
options/locale/locale_en-US.ini
routers/api/v1/repo/issue.go
routers/api/v1/repo/pull.go
routers/init.go
routers/repo/issue.go
routers/repo/pull.go
services/issue/issue.go
services/mailer/mail.go
services/mailer/mail_issue.go
services/pull/pull.go
templates/mail/issue/assigned.tmpl [new file with mode: 0644]