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

[ bsd3, library, web ] [ Propose Tags ] [ Report a vulnerability ]

Please see README.md


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0
Change log CHANGELOG.md
Dependencies 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), scientific (>=0.3 && <0.4), servant (>=0.7 && <0.9), servant-client (>=0.7 && <0.9), text (>=1.2 && <2), transformers (>=0.4 && <0.6) [details]
License BSD-3-Clause
Copyright 2016 Anton Gushcha
Author Anton Gushcha
Maintainer ncrashed@gmail.com
Category Web
Home page https://github.com/NCrashed/servant-smsc-ru#readme
Source repo head: git clone https://github.com/NCrashed/servant-smsc-ru
Uploaded by NCrashed at 2016-08-04T18:53:18Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 859 total (5 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2016-08-04 [all 1 reports]

Readme for servant-smsc-ru-0.1.0.0

[back to package description]

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