Send a notification to the user when they are added to the list
This commit is contained in:
parent
0bd27ddeb7
commit
c873c1ec32
5 changed files with 61 additions and 6 deletions
|
|
@ -22,6 +22,8 @@ import (
|
|||
"reflect"
|
||||
"time"
|
||||
|
||||
"code.vikunja.io/api/pkg/config"
|
||||
|
||||
"code.vikunja.io/api/pkg/db"
|
||||
|
||||
"xorm.io/xorm"
|
||||
|
|
@ -116,6 +118,11 @@ func (u *User) GetName() string {
|
|||
return u.Username
|
||||
}
|
||||
|
||||
// GetNameAndFromEmail returns the name and email address for a user. Useful to use in notifications.
|
||||
func (u *User) GetNameAndFromEmail() string {
|
||||
return u.GetName() + " via Vikunja <" + config.MailerFromEmail.GetString() + ">"
|
||||
}
|
||||
|
||||
// GetFromAuth returns a user object from a web.Auth object and returns an error if the underlying type
|
||||
// is not a user object
|
||||
func GetFromAuth(a web.Auth) (*User, error) {
|
||||
|
|
|
|||
Reference in a new issue