@hackage servant-smsc-ru0.1.0.0

Servant client for smsc.ru service for sending SMS to cell phones

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