diff --git a/services/mailer/email_utils.go b/services/mailer/email_utils.go index 5c6c03cbe..9ef26b2b4 100644 --- a/services/mailer/email_utils.go +++ b/services/mailer/email_utils.go @@ -4,7 +4,6 @@ import ( "context" "fmt" "slices" - "sort" "strings" "time" @@ -113,14 +112,10 @@ func (s *Server) generateEmailProposals(ctx context.Context, userInfo *userinfo. } } - sort.Slice(emails, func(i, j int) bool { - return emails[i] < emails[j] - }) + slices.Sort(emails) utils.RemoveSliceDuplicates(emails) - sort.Slice(domains, func(i, j int) bool { - return domains[i] < domains[j] - }) + slices.Sort(domains) utils.RemoveSliceDuplicates(domains) return emails, domains, nil @@ -129,6 +124,8 @@ func (s *Server) generateEmailProposals(ctx context.Context, userInfo *userinfo. func getBasicNameEmails(firstname string, lastname string) []string { return []string{ // User fullname: Erika Mustermann utils.Slug(fmt.Sprintf("%s.%s", firstname, lastname)), // erika.mustermann + utils.Slug(fmt.Sprintf("%s", firstname)), // erika + utils.Slug(fmt.Sprintf("%s", lastname)), // mustermann utils.Slug(fmt.Sprintf("%s%s", utils.StringFirstN(firstname, 1), lastname)), // emustermann utils.Slug(fmt.Sprintf("%s%s", firstname, utils.StringFirstN(lastname, 1))), // erikam utils.Slug(fmt.Sprintf("%s.%s", utils.StringFirstN(firstname, 1), utils.StringFirstN(lastname, 3))), // eri.mus