diff options
author | Joris | 2015-10-10 11:29:02 +0200 |
---|---|---|
committer | Joris | 2015-10-10 11:29:02 +0200 |
commit | 3ba512849f7b0ed184f2c06b481a7838ecdbe1e2 (patch) | |
tree | 8d81762c132104b75c5f44ca0e79de485bd575bf | |
parent | 137d8782797404daade5dddc3b96aedd521ba012 (diff) |
Do not send an email if there is no birthday
-rw-r--r-- | src/Main.hs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/Main.hs b/src/Main.hs index 9b5541c..29e9698 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -46,8 +46,12 @@ main = do (Right birthdates, Right config) -> do currentDate <- getCurrentDate let birthdays = filterBirthday currentDate birthdates - sendMail - (mailTo config) - (mailFrom config) - (mailSubject birthdays) - (mailBody currentDate birthdays) + if not (null birthdays) + then + sendMail + (mailTo config) + (mailFrom config) + (mailSubject birthdays) + (mailBody currentDate birthdays) + else + return () |