2 Module : Gargantext.Core.Mail
4 Copyright : (c) CNRS, 2017-Present
5 License : AGPL + CECILL v3
6 Maintainer : team@gargantext.org
7 Stability : experimental
12 {-# LANGUAGE OverloadedStrings #-}
14 module Gargantext.Prelude.Mail
15 (gargMail, GargMail(..))
18 -- import Data.Text.Internal.Lazy (Text)
19 import Data.Text (Text)
21 import Network.Mail.SMTP hiding (htmlPart)
22 import Gargantext.Prelude
23 import Network.Mail.Mime (plainPart)
29 data GargMail = GargMail { gm_to :: Email
30 , gm_name :: Maybe Name
35 -- | TODO add parameters to gargantext.ini
36 gargMail :: GargMail -> IO ()
37 gargMail (GargMail to' name subject body) = sendMail "localhost" mail
39 mail = simpleMail from to cc bcc subject [plainPart $ cs body]
41 from = Address (Just "GargTeam") "contact@gargantext.org"
42 to = [Address name to']