2 Module : Gargantext.Database.Action.Mail
4 Copyright : (c) CNRS, 2017-Present
5 License : AGPL + CECILL v3
6 Maintainer : team@gargantext.org
7 Stability : experimental
13 module Gargantext.Database.Action.Mail
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
26 ------------------------------------------------------------------------
28 sendMail :: HasNodeError err => User -> Cmd err ()
30 cfg <- view $ mailSettings
31 userLight <- getUserLightDB u
32 liftBase $ mail cfg (MailInfo { mailInfo_username = userLight_username userLight
33 , mailInfo_address = userLight_email userLight })