summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandrewrademacher <>2014-04-09 19:38:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2014-04-09 19:38:00 (GMT)
commit839fc2919bf4927c09846423f4a90eb14844864c (patch)
treecb57b2bea03f87a8c5609f2f6d9cc589b27eb5cf
parentaf799e283be6604c997d014016ae19124078e91b (diff)
version 0.1.0.10.1.0.1
-rw-r--r--mailgun.cabal3
-rw-r--r--src/Rackspace/MailGun.hs5
2 files changed, 5 insertions, 3 deletions
diff --git a/mailgun.cabal b/mailgun.cabal
index a7cbdf1..614bd47 100644
--- a/mailgun.cabal
+++ b/mailgun.cabal
@@ -1,5 +1,5 @@
name: mailgun
-version: 0.1.0.0
+version: 0.1.0.1
synopsis: Connector to Rackspace's Mailgun Service
description: Allows users to directly access Rackspace's Mailgun service
without having to work with the underlying REST service.
@@ -28,6 +28,7 @@ library
, monad-control >=0.3.2.3
, http-client >=0.2.2.4
, failure >=0.2.0.2
+ , exceptions >=0.5
executable send
main-is: Send.hs
diff --git a/src/Rackspace/MailGun.hs b/src/Rackspace/MailGun.hs
index fda50ba..4e0019b 100644
--- a/src/Rackspace/MailGun.hs
+++ b/src/Rackspace/MailGun.hs
@@ -11,6 +11,7 @@ module Rackspace.MailGun
) where
import Control.Failure
+import Control.Monad.Catch (MonadThrow)
import Control.Monad.IO.Class
import Control.Monad.Trans.Control
import Data.ByteString.Char8 as BS (ByteString, pack,
@@ -63,13 +64,13 @@ buildBase msg = partText "from" (from msg)
++ partMaybeText "subject" (subject msg)
++ buildTail msg
-sendMessage :: (Failure HttpException m, MonadBaseControl IO m, MonadIO m) =>
+sendMessage :: (Failure HttpException m, MonadThrow m, MonadBaseControl IO m, MonadIO m) =>
String -> String -> Message -> m (Response LBS.ByteString)
sendMessage domain apiKey message = do
withManager $ \manager -> do
sendWith manager domain apiKey message
-sendWith :: (Failure HttpException m, MonadBaseControl IO m, MonadIO m) =>
+sendWith :: (Failure HttpException m, MonadThrow m, MonadBaseControl IO m, MonadIO m) =>
Manager -> String -> String -> Message -> m (Response LBS.ByteString)
sendWith manager domain apiKey message = do
initReq <- parseUrl $ baseUrl ++ "/" ++ domain ++ "/messages"