]> Git — Sourcephile - gargantext.git/blob - src/Gargantext/Database/Action/Mail.hs
Revert b3fb1a1697d18777af6b401c132c39a5c905e129
[gargantext.git] / src / Gargantext / Database / Action / Mail.hs
1 {-|
2 Module : Gargantext.Database.Action.Mail
3 Description :
4 Copyright : (c) CNRS, 2017-Present
5 License : AGPL + CECILL v3
6 Maintainer : team@gargantext.org
7 Stability : experimental
8 Portability : POSIX
9
10
11 -}
12
13 module Gargantext.Database.Action.Mail
14 where
15
16 import Control.Lens (view)
17 import Gargantext.Core.Mail (mail, MailModel(..))
18 import Gargantext.Core.Mail.Types (mailSettings)
19 import Gargantext.Core.Types.Individu (User(..))
20 import Gargantext.Database.Action.User
21 import Gargantext.Database.Prelude
22 import Gargantext.Database.Query.Table.Node.Error (HasNodeError(..))
23 import Gargantext.Database.Schema.User
24 import Gargantext.Prelude
25
26 ------------------------------------------------------------------------
27
28 sendMail :: (HasNodeError err, CmdM env err m) => User -> m ()
29 sendMail u = do
30 cfg <- view $ mailSettings
31 userLight <- getUserLightDB u
32 mail cfg (MailInfo { mailInfo_username = userLight_username userLight
33 , mailInfo_address = userLight_email userLight
34 }
35 )