https://github.com/outr/mailgun4s
Mailgun API implementation in Scala
https://github.com/outr/mailgun4s
Last synced: 7 months ago
JSON representation
Mailgun API implementation in Scala
- Host: GitHub
- URL: https://github.com/outr/mailgun4s
- Owner: outr
- License: mit
- Created: 2016-08-18T01:03:36.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2025-01-14T14:10:23.000Z (11 months ago)
- Last Synced: 2025-03-29T10:04:30.707Z (8 months ago)
- Language: Scala
- Size: 71.3 KB
- Stars: 17
- Watchers: 3
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- fucking-awesome-scala - mailgun4s - activity/y/outr/mailgun4s) (Table of Contents / Misc)
- awesome-scala - mailgun4s ★ 7 ⧗ 4 - Scala wrapper around the Mailgun API (Misc)
- awesome-scala - mailgun4s - activity/y/outr/mailgun4s) (Table of Contents / Misc)
README
[](https://www.codacy.com/app/matthicks/mailgun4s?utm_source=github.com&utm_medium=referral&utm_content=outr/mailgun4s&utm_campaign=badger)
[](http://travis-ci.org/outr/mailgun4s)
mailgun4s
============
Updated project originally forked from https://github.com/Nycto/mailgun-scala but since has been completely re-written.
A Scala wrapper around the Mailgun API. Their documentation can
be found here:
http://documentation.mailgun.com
Currently only supports sending messages, but more functionality will be added as needed or requested.
Example
-------
Note that as of 1.1, we now use [cats-effect](https://typelevel.org/cats-effect/) instead of Futures.
The following example shows how to instantiate and send an email:
```scala
import org.matthicks.mailgun._
import java.io._
import scala.concurrent._
import cats.effect.IO
val mailgun = new Mailgun("samples.mailgun.org", "key-YOUR-MAILGUN-KEY")
val io: IO[MessageResponse] = mailgun.send(Message.simple(
from = EmailAddress("nobody@example.com", "Test App"),
to = List(EmailAddress("mailgun-scala@mailinator.com", "Joe User")),
subject = "Mailgun4s Rules!",
text = Some("This is the testing text"),
html = Some("This seems
to
work!
")
).withInline(new File("example.jpg"), "image/jpeg"))
io.map { result =>
println(s"Result: $result")
}
```
Adding it to your Project
-------------------------
Add the following directives to your `build.sbt` file:
```
libraryDependencies ++= Seq(
"org.matthicks" %% "mailgun4s" % "1.1.0"
)
```
License
-------
This library is released under the MIT License, which is pretty spiffy. You
should have received a copy of the MIT License along with this program. If not,
see .