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.
npm install @piq9117/bs-mailgun
...
"bs-dependencies": [
"@piq9117/bs-mailgun"
]
...
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
)