servant-smsc-ru

Servant client for smsc.ru service for sending SMS to cell phones https://github.com/NCrashed/servant-smsc-ru#readme

Latest on Hackage:0.1.0.0

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.

BSD3 licensed by Anton Gushcha
Maintained by ncrashed@gmail.com

servant-smsc-ru

Build Status

These are bindings to https://smsc.ru service for sending SMS/MMS message to cell phones.

How to use

The general API is provided by genericSmsSend function, but it is too overengineered to be used as is. Thats why several simplified wrappers are presented.

First, you need to provide SmscConfig value:

cfg <- defaultSmscConfig
let testSmscConfig = cfg {
        smscLogin = "mylogin"
      , smscPassword = "mypass"
      }

After that you can send a SMS:

res <- simpleSmsSend testSmscConfig testPhone "Test message"
case res of 
  Left er -> printLn $ "message sending: " ++ show er
  Right _ -> return ()

Or check how much it would cost to you:

res <- getSimpleSmsCost testSmscConfig testPhone "Test message"
case res of 
  Left er -> assertFailure $ "message costing: " <> show er
  Right v -> putStrLn $ "message cost: " <> show v

Changes

0.1.0.0

  • Initial release
comments powered byDisqus