mailtrap 0.1.2.0 → 0.1.2.1
raw patch · 3 files changed
+11/−1 lines, 3 files
Files
- changelog.md +3/−0
- mailtrap.cabal +1/−1
- src/Network/Mail/Mailtrap.hs +7/−0
changelog.md view
@@ -1,3 +1,6 @@+## 0.1.2.1+* Add compatibility with base64-1.0.+ ## 0.1.2.0 * Add `FromJSON` and `ToJSON` instances for the `Token` type.
mailtrap.cabal view
@@ -1,5 +1,5 @@ name: mailtrap-version: 0.1.2.0+version: 0.1.2.1 category: Email synopsis: Mailtrap API library. description:
src/Network/Mail/Mailtrap.hs view
@@ -68,6 +68,9 @@ #endif -- base64 import Data.ByteString.Base64 (encodeBase64)+#if MIN_VERSION_base64(1,0,0)+import Data.Base64.Types (extractBase64)+#endif -- blaze-html import Text.Blaze.Html (Html) import Text.Blaze.Html.Renderer.Text (renderHtml)@@ -270,7 +273,11 @@ toJSON att = JSON.object $ [ "filename" .= attachment_name att , "type" .= decodeUtf8 (attachment_type att)+#if MIN_VERSION_base64(1,0,0)+ , "content" .= extractBase64 (encodeBase64 $ attachment_content att)+#else , "content" .= encodeBase64 (attachment_content att)+#endif , "disposition" .= (case attachment_disposition att of Inline _ -> "inline" :: Text