1
0

fix(assignees): improve wording for assignee emails

This commit is contained in:
kolaente
2024-01-28 13:11:37 +01:00
parent ce53663a88
commit e03920b84a
2 changed files with 9 additions and 0 deletions

View File

@ -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()+".").