You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Ken Aguilar adeb476f7e bumped version 1 year ago
docs How to 1 year ago
src Bounces 1 year ago
.gitignore initial tracking 1 year ago
LICENSE Initial commit 1 year ago
README.md Readme 1 year ago
bsconfig.json NPM 1 year ago
package-lock.json unsubscribes 1 year ago
package.json bumped version 1 year ago

README.md

bs-mailgun

mailgun-js bucklescript bindings.

Mailgun is a cloud-based email service for sending, receiving and tracking email sent through your websites and applications. mailgun-js is a node module for interacting with Mailgun’s api. This bucklescript library is a binding for mailgun-js.

Installation

npm install @piq9117/bs-mailgun

bsconfig

  ...

  "bs-dependencies": [
    "@piq9117/bs-mailgun"
  ]
  ...

Usage

Sending Mail

let mailgunKeys =
  Mailgun.mailgunReq
    ~apiKey:"YOUR API KEY"
    ~domain:"YOUR DOMAIN"

let mailgun = Mailgun.mailgun req

let emailData =
  Mailgun.emailData
    ~from:"Excited User <me@samples.mailgun.org>"
    ~to_:"serobnic@mail.ru"
    ~subject:"Hello"
    ~text:"Testing some Mailgun awesomeness!"
    
let messages = Mailgun.Message.messages mailgun

let sendMail =
  let open Belt_Result in
  Mailgun.Message.send messages emailData (fun s ->
    match s with
    | Ok o -> Js.log o
    | Error e -> Js.log e 
  )

More examples on how to use this bindings library