diff options
author | Joris | 2016-11-20 18:26:07 +0100 |
---|---|---|
committer | Joris | 2016-11-20 18:26:07 +0100 |
commit | 74aff92204f70a6f113039fe90d332b44f9493c2 (patch) | |
tree | eb9b6ecb3edf55be352737db9cb72a7f1c2ac87e /src/Mail.hs | |
parent | ae45764821dc3c04eeb8c2171f14d36256ce4027 (diff) |
Enable multi-urls in config file
Diffstat (limited to 'src/Mail.hs')
-rw-r--r-- | src/Mail.hs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/Mail.hs b/src/Mail.hs index bf1516e..1145f9f 100644 --- a/src/Mail.hs +++ b/src/Mail.hs @@ -6,6 +6,8 @@ module Mail import Data.Text (Text) import qualified Data.Text as T +import qualified Data.Text.Lazy as LT +import Data.Text.Lazy.Builder (toLazyText, fromText) import Data.Either (isLeft) import Control.Exception (SomeException, try) @@ -30,8 +32,8 @@ getMimeMail mail = in fromMail { Mime.mailTo = map address . Mail.to $ mail , Mime.mailParts = - [ [ Mime.plainPart . Mail.plainBody $ mail - , Mime.htmlPart . Mail.htmlBody $ mail + [ [ Mime.plainPart . strictToLazy . Mail.plainBody $ mail + , Mime.htmlPart . strictToLazy . Mail.htmlBody $ mail ] ] , Mime.mailHeaders = [("Subject", Mail.subject mail)] @@ -43,3 +45,6 @@ address addressEmail = { Mime.addressName = Nothing , Mime.addressEmail = addressEmail } + +strictToLazy :: Text -> LT.Text +strictToLazy = toLazyText . fromText |