Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
159
Issues
159
List
Board
Labels
Milestones
Merge Requests
9
Merge Requests
9
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
haskell-gargantext
Commits
38ff735d
Commit
38ff735d
authored
Dec 12, 2024
by
Grégoire Locqueville
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed code in `Core` and `Core.Config.Ini.Mail`
parent
507faeab
Pipeline
#7123
passed with stages
in 42 minutes and 1 second
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
40 deletions
+3
-40
Core.hs
src/Gargantext/Core.hs
+1
-14
Mail.hs
src/Gargantext/Core/Config/Ini/Mail.hs
+2
-26
No files found.
src/Gargantext/Core.hs
View file @
38ff735d
...
...
@@ -82,6 +82,7 @@ instance ToHttpApiData Lang where
toUrlPiece
=
pack
.
show
instance
Hashable
Lang
-- | https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
toISO639
::
Lang
->
ISO639
.
ISO639_1
toISO639
DE
=
ISO639
.
DE
toISO639
EL
=
ISO639
.
EL
...
...
@@ -100,20 +101,6 @@ iso639ToText la = pack [a, b]
where
(
a
,
b
)
=
ISO639
.
toChars
la
-- | https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
toISO639Lang
::
Lang
->
Text
toISO639Lang
DE
=
"de"
toISO639Lang
EL
=
"el"
toISO639Lang
EN
=
"en"
toISO639Lang
ES
=
"es"
toISO639Lang
FR
=
"fr"
toISO639Lang
IT
=
"it"
toISO639Lang
PL
=
"pl"
toISO639Lang
PT
=
"pt"
toISO639Lang
RU
=
"ru"
toISO639Lang
UK
=
"uk"
toISO639Lang
ZH
=
"zh"
allLangs
::
[
Lang
]
allLangs
=
[
minBound
..
maxBound
]
...
...
src/Gargantext/Core/Config/Ini/Mail.hs
View file @
38ff735d
...
...
@@ -15,19 +15,16 @@ module Gargantext.Core.Config.Ini.Mail (
,
LoginType
(
..
)
,
MailConfig
(
..
)
-- * Utility functions
,
gargMail
-- * Utility function
,
readConfig
)
where
import
Data.Maybe
import
Data.Text
(
unpack
)
import
Gargantext.Core.Config.Ini.Ini
(
readIniFile'
,
val
)
import
Gargantext.Core.Config.Mail
(
LoginType
(
..
),
MailConfig
(
..
),
SendEmailType
(
LogEmailToConsole
))
import
Gargantext.Prelude
import
Network.Mail.Mime
(
plainPart
)
import
Network.Mail.SMTP
hiding
(
htmlPart
,
STARTTLS
)
import
Prelude
(
read
)
...
...
@@ -54,24 +51,3 @@ data GargMail = GargMail { gm_to :: Email
,
gm_subject
::
Text
,
gm_body
::
Text
}
-- | TODO add parameters to gargantext.ini
gargMail
::
MailConfig
->
GargMail
->
IO
()
gargMail
(
MailConfig
{
..
})
(
GargMail
{
..
})
=
do
let
host
=
unpack
_mc_mail_host
user
=
unpack
_mc_mail_user
password
=
unpack
_mc_mail_password
case
_mc_mail_login_type
of
NoAuth
->
sendMail
host
mail
Normal
->
sendMailWithLogin'
host
_mc_mail_port
user
password
mail
SSL
->
sendMailWithLoginTLS'
host
_mc_mail_port
user
password
mail
TLS
->
sendMailWithLoginTLS'
host
_mc_mail_port
user
password
mail
STARTTLS
->
sendMailWithLoginSTARTTLS'
host
_mc_mail_port
user
password
mail
where
mail
=
simpleMail
sender
receiver
cc
bcc
gm_subject
[
plainPart
$
cs
gm_body
]
sender
=
Address
(
Just
"GarganText Email"
)
_mc_mail_from
receiver
=
[
Address
gm_name
gm_to
]
cc
=
[]
bcc
=
[]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment