aboutsummaryrefslogtreecommitdiff
path: root/src/SendMail.hs
blob: 23b1b80074fe133fa4631a733346a1217fe3b946 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{-# LANGUAGE OverloadedStrings #-}

module SendMail
  ( sendMail
  ) where

import Data.Text (Text)
import Data.Text.Lazy (fromStrict)

import Network.Mail.Mime

sendMail :: Text -> Text -> Text -> Text -> IO ()
sendMail to from subject body = do
  renderSendMail (simpleMail' (address to) (address from) subject (fromStrict body))

address :: Text -> Address
address email =
  Address
    { addressName = Nothing
    , addressEmail = email
    }