From dcb52c00f1c6b3217e2b508d7799fc83adb3b055 Mon Sep 17 00:00:00 2001 From: jayden-c Date: Sat, 16 Oct 2021 21:53:33 +0000 Subject: [PATCH] feat: improve account deletion email grammar (#1006) Co-authored-by: Jayden Chan Reviewed-on: https://kolaente.dev/vikunja/api/pulls/1006 Reviewed-by: konrad Co-authored-by: jayden-c Co-committed-by: jayden-c --- pkg/user/notifications.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pkg/user/notifications.go b/pkg/user/notifications.go index 30eb17c38..e008ad2e6 100644 --- a/pkg/user/notifications.go +++ b/pkg/user/notifications.go @@ -227,11 +227,17 @@ type AccountDeletionNotification struct { // ToMail returns the mail notification for AccountDeletionNotification func (n *AccountDeletionNotification) ToMail() *notifications.Mail { + durationString := "in " + strconv.Itoa(n.NotificationNumber) + " days" + + if n.NotificationNumber == 1 { + durationString = "tomorrow" + } + 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()+","). 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:"). Action("Abort the deletion", config.ServiceFrontendurl.GetString()). Line("Have a nice day!")