feat: improve account deletion email grammar (#1006)

Co-authored-by: Jayden Chan <jaydencn7@gmail.com>
Reviewed-on: https://kolaente.dev/vikunja/api/pulls/1006
Reviewed-by: konrad <k@knt.li>
Co-authored-by: jayden-c <jaydencn7@gmail.com>
Co-committed-by: jayden-c <jaydencn7@gmail.com>
This commit is contained in:
jayden-c 2021-10-16 21:53:33 +00:00 committed by konrad
parent 50b65a517d
commit dcb52c00f1

View file

@ -227,11 +227,17 @@ type AccountDeletionNotification struct {
// ToMail returns the mail notification for AccountDeletionNotification // ToMail returns the mail notification for AccountDeletionNotification
func (n *AccountDeletionNotification) ToMail() *notifications.Mail { func (n *AccountDeletionNotification) ToMail() *notifications.Mail {
durationString := "in " + strconv.Itoa(n.NotificationNumber) + " days"
if n.NotificationNumber == 1 {
durationString = "tomorrow"
}
return notifications.NewMail(). return notifications.NewMail().
Subject("Your Vikunja account will be deleted in "+strconv.Itoa(n.NotificationNumber)+" days"). Subject("Your Vikunja account will be deleted "+durationString).
Greeting("Hi "+n.User.GetName()+","). Greeting("Hi "+n.User.GetName()+",").
Line("You recently requested the deletion of your Vikunja account."). Line("You recently requested the deletion of your Vikunja account.").
Line("We will delete your account in "+strconv.Itoa(n.NotificationNumber)+" days."). Line("We will delete your account "+durationString+".").
Line("If you changed your mind, simply click the link below to cancel the deletion and follow the instructions there:"). Line("If you changed your mind, simply click the link below to cancel the deletion and follow the instructions there:").
Action("Abort the deletion", config.ServiceFrontendurl.GetString()). Action("Abort the deletion", config.ServiceFrontendurl.GetString()).
Line("Have a nice day!") Line("Have a nice day!")