aboutsummaryrefslogtreecommitdiff
path: root/src/AdListener.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/AdListener.hs')
-rw-r--r--src/AdListener.hs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/AdListener.hs b/src/AdListener.hs
index c08efc5..4fc9b20 100644
--- a/src/AdListener.hs
+++ b/src/AdListener.hs
@@ -17,7 +17,8 @@ import Model.Ad
import Model.URL
import Model.Resume
-import View.Ad
+import qualified View.Plain.Ad as P
+import qualified View.Html.Ad as H
import Page
import Parser.Detail
@@ -64,7 +65,7 @@ listenToNewAdsWithResumes config viewedURLs resumes =
time <- getCurrentFormattedTime
if not (null newAds)
then
- let message = renderConsoleAds time newAds
+ let message = P.renderConsoleAds time newAds
in do
T.putStrLn message
trySendMail config newAds
@@ -79,9 +80,10 @@ trySendMail config ads =
Nothing ->
return ()
Just mailTo ->
- let (title, message) = renderAds ads
+ let (title, plainBody) = P.renderAds ads
+ htmlBody = H.renderAds ads
in do
- eitherMailSuccess <- sendMail mailTo title message
+ eitherMailSuccess <- sendMail mailTo title plainBody htmlBody
case eitherMailSuccess of
Right () ->
putStrLn "\nMail sent."