fix(assignees): improve wording for assignee emails
This commit is contained in:
parent
ce53663a88
commit
e03920b84a
@ -300,6 +300,7 @@ func (s *SendTaskAssignedNotification) Handle(msg *message.Message) (err error)
|
||||
Doer: event.Doer,
|
||||
Task: &task,
|
||||
Assignee: event.Assignee,
|
||||
Target: subscriber.User,
|
||||
}
|
||||
err = notifications.Notify(subscriber.User, n)
|
||||
if err != nil {
|
||||
|
@ -111,10 +111,18 @@ type TaskAssignedNotification struct {
|
||||
Doer *user.User `json:"doer"`
|
||||
Task *Task `json:"task"`
|
||||
Assignee *user.User `json:"assignee"`
|
||||
Target *user.User `json:"-"`
|
||||
}
|
||||
|
||||
// ToMail returns the mail notification for TaskAssignedNotification
|
||||
func (n *TaskAssignedNotification) ToMail() *notifications.Mail {
|
||||
if n.Target.ID == n.Assignee.ID {
|
||||
return notifications.NewMail().
|
||||
Subject("You have been assigned to "+n.Task.Title+"("+n.Task.GetFullIdentifier()+")").
|
||||
Line(n.Doer.GetName()+" has assigned you to "+n.Task.Title+".").
|
||||
Action("View Task", n.Task.GetFrontendURL())
|
||||
}
|
||||
|
||||
return notifications.NewMail().
|
||||
Subject(n.Task.Title+"("+n.Task.GetFullIdentifier()+")"+" has been assigned to "+n.Assignee.GetName()).
|
||||
Line(n.Doer.GetName()+" has assigned this task to "+n.Assignee.GetName()+".").
|
||||
|
Loading…
x
Reference in New Issue
Block a user