Commit 08096a49 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[mail] some small refactoring

parent 220f3281
......@@ -50,7 +50,7 @@ data GargMail = GargMail { gm_to :: Email
-- | TODO add parameters to gargantext.ini
gargMail :: MailConfig -> GargMail -> IO ()
gargMail (MailConfig {..}) (GargMail to' name subject body) = do
gargMail (MailConfig {..}) (GargMail { .. }) = do
let host = unpack _mc_mail_host
user = unpack _mc_mail_user
password = unpack _mc_mail_password
......@@ -61,10 +61,10 @@ gargMail (MailConfig {..}) (GargMail to' name subject body) = do
TLS -> sendMailWithLoginTLS' host _mc_mail_port user password mail
STARTTLS -> sendMailWithLoginSTARTTLS' host _mc_mail_port user password mail
where
mail = simpleMail from to cc bcc subject [plainPart $ cs body]
mail = simpleMail from to cc bcc gm_subject [plainPart $ cs gm_body]
from = Address (Just "GarganText Email") _mc_mail_from
to = [Address name to']
to = [Address gm_name gm_to]
cc = []
bcc = []
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment