Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thedevsaddam/gomailer
Gomailer provides a simple email interface to integrate third party email services.
https://github.com/thedevsaddam/gomailer
email go-email-service golang gomailer mailer
Last synced: 18 days ago
JSON representation
Gomailer provides a simple email interface to integrate third party email services.
- Host: GitHub
- URL: https://github.com/thedevsaddam/gomailer
- Owner: thedevsaddam
- License: mit
- Created: 2017-11-24T15:42:18.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-09-07T18:45:31.000Z (about 2 years ago)
- Last Synced: 2024-06-20T12:39:02.180Z (5 months ago)
- Topics: email, go-email-service, golang, gomailer, mailer
- Language: Go
- Size: 66.4 KB
- Stars: 14
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
Package gomailer
==================
[![Go Report Card](https://goreportcard.com/badge/github.com/thedevsaddam/gomailer)](https://goreportcard.com/report/github.com/thedevsaddam/gomailer)
[![GoDoc](https://godoc.org/github.com/thedevsaddam/gomailer?status.svg)](https://godoc.org/github.com/thedevsaddam/gomailer)
[![License](https://img.shields.io/dub/l/vibe-d.svg)](https://github.com/thedevsaddam/gomailer/blob/dev/LICENSE.md)This package provides a simple email interface to integrate third party email services. You can integrate popular email services and switch easily.
### Installation
Install the package using
```go
$ go get github.com/thedevsaddam/gomailer
```### Usage
To use the package import it in your `*.go` code
```go
import "github.com/thedevsaddam/gomailer"
```
### Integration```go
package mainimport (
"log"mailer "github.com/thedevsaddam/gomailer"
)func main() {
c := mailer.Configs{
Domain: "Your domain here",
APIKey: "Your key here",
}m, err := mailer.New(mailer.MAILGUN, c)
checkError(err)m.From("John Doe", "[email protected]")
m.To("Jane Doe", "[email protected]")
m.Cc("Tom", "[email protected]")
m.Bcc("Jerry", "[email protected]")
m.ReplyTo("Salman", "[email protected]")
m.Subject("mailgun: Urgent email about tom & jerry")
// m.BodyText("This is a test text email")
m.BodyHTML("Inline image here: ")
m.AttachmentFile("a.jpg")checkError(err)
err = m.Send()
checkError(err)
}func checkError(err error) {
if err != nil {
log.Println(err)
}
}```
***You can chain methods easily***
```go
m, err := mailer.New(mailer.MAILGUN, c)
m.To("name", "email").Cc("name", "email").Bcc("name", "email").Bcc("name", "email").Subject("Your subject").BodyText("simple message here").AttachmentFile("some/file.zip").Send()
```### More [examples](_examples/)
### Roadmap
- [x] Mailgun
- [x] Sendgrid
- [x] Postmark
- [x] Mailjet
- [x] CustomerIO
- [ ] Elasticmail
- [ ] Jangomail
- [ ] Leadersend
- [ ] Madmimi
- [ ] Mandrill
- [ ] Postageapp
- [ ] Socketlabs
- [ ] Sparkpost### Note
This package is under development, need to write tests, unimplemented services. Use now at your own risk.### Contribution
Your suggestions will be more than appreciated.
[Read the contribution guide here](CONTRIBUTING.md)### See all [contributors](https://github.com/thedevsaddam/gomailer/graphs/contributors)
### Read [API doc](https://godoc.org/github.com/thedevsaddam/gomailer) to know about ***Available options and Methods***
### **License**
The **gomailer** is an open-source software licensed under the [MIT License](LICENSE.md).