@hackage servant-smsc-ru0.1.0.0
Servant client for smsc.ru service for sending SMS to cell phones
Categories
License
BSD-3-Clause
Maintainer
ncrashed@gmail.com
Links
Versions
- 0.1.0.0 Thu, 4 Aug 2016
Installation
Dependencies (11)
- aeson >=0.11 && <0.12
- base >=4.7 && <5
- bytestring >=0.10 && <0.11
- http-client >=0.4 && <0.6
- http-client-tls >=0.2 && <0.4
- mtl >=2.2 && <2.3 Show all…
Dependents (1)
@hackage/acme-everything
servant-smsc-ru
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