aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoris2015-10-10 11:29:02 +0200
committerJoris2015-10-10 11:29:02 +0200
commit3ba512849f7b0ed184f2c06b481a7838ecdbe1e2 (patch)
tree8d81762c132104b75c5f44ca0e79de485bd575bf /src
parent137d8782797404daade5dddc3b96aedd521ba012 (diff)
Do not send an email if there is no birthday
Diffstat (limited to 'src')
-rw-r--r--src/Main.hs14
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 ()