summaryrefslogtreecommitdiff
path: root/test/Send.hs
diff options
context:
space:
mode:
authorandrewrademacher <>2014-04-01 20:54:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2014-04-01 20:54:00 (GMT)
commitaf799e283be6604c997d014016ae19124078e91b (patch)
tree27e47f99076bec3a00d6672bf8870d03a280bbaf /test/Send.hs
version 0.1.0.00.1.0.0
Diffstat (limited to 'test/Send.hs')
-rw-r--r--test/Send.hs23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/Send.hs b/test/Send.hs
new file mode 100644
index 0000000..94b47e8
--- /dev/null
+++ b/test/Send.hs
@@ -0,0 +1,23 @@
+{-# LANGUAGE OverloadedStrings #-}
+
+module Main where
+
+import Data.Text as T (Text (..), pack)
+import Rackspace.MailGun
+import System.Environment
+
+main :: IO ()
+main = do
+ domain <- getEnv "MAILGUN_DOMAIN"
+ apiKey <- getEnv "MAILGUN_SECRET"
+ testAddr <- getEnv "MAILGUN_TEST_ADDRESS"
+
+ let message = TextMessage
+ { from = T.pack ("someone@" ++ domain)
+ , to = T.pack testAddr
+ , cc = Nothing
+ , bcc = Nothing
+ , subject = Just "Test Message"
+ , text = "Hello, this is a test message!" }
+ res <- sendMessage domain apiKey message
+ print res