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.Prelude
18 import Gargantext.Database.Prelude
19 import Gargantext.Database.Query.Table.Node.Error (HasNodeError(..))
20 import Gargantext.Core.Mail
21 import Gargantext.Prelude.Config
22 import Gargantext.Database.Schema.User
23 import Gargantext.Database.Action.User
24 import Gargantext.Core.Types.Individu (User(..))
26 ------------------------------------------------------------------------
28 sendMail :: HasNodeError err => User -> Cmd err ()
30 server <- view $ hasConfig . gc_url
31 userLight <- getUserLightDB u
32 liftBase $ mail server (MailInfo { mailInfo_username = userLight_username userLight
33 , mailInfo_address = userLight_email userLight })