diff options
-rw-r--r-- | src/Model/Mail.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Model/Mail.hs b/src/Model/Mail.hs index 2ae8df4..2af2159 100644 --- a/src/Model/Mail.hs +++ b/src/Model/Mail.hs @@ -20,13 +20,13 @@ mailSubject :: [Birthdate] -> [Birthdate] -> Text mailSubject birthdaysToday birthdaysNextWeek = T.concat [ "Hey, " - , if length birthdaysToday > 0 + , if not . null $ birthdaysToday then mailSubjectSentence Today birthdaysToday else "" - , if length birthdaysNextWeek > 0 + , if not . null $ birthdaysNextWeek then T.concat - [ if length birthdaysToday > 0 then " and " else "" + [ if not . null $ birthdaysToday then " and " else "" , mailSubjectSentence NextWeek birthdaysNextWeek ] else @@ -52,13 +52,13 @@ mailSubjectSentence event birthdates = mailBody :: Date -> [Birthdate] -> [Birthdate] -> Text mailBody currentDate birthdaysToday birthdaysNextWeek = T.concat - [ if length birthdaysToday > 0 + [ if not . null $ birthdaysToday then mailBodySentence Today currentDate birthdaysToday else "" - , if length birthdaysNextWeek > 0 + , if not . null $ birthdaysNextWeek then T.concat - [ if length birthdaysToday > 0 then " " else "" + [ if not . null $ birthdaysToday then " " else "" , mailBodySentence NextWeek currentDate birthdaysNextWeek ] else "" |