About
Go library for interacting with the ElasticEmail API.
Supported methods
-
Email:
Send your emails and see their statuses
- GetStatus
- Send
- Status
- View
-
Template:
Managing and editing templates of your emails
- GetList
-
List:
API methods for managing your Lists
- list
-
Contact:
Methods used to manage your Contacts.
- Add
Usage
ee := elasticemail.NewElasticEmail("api-key")
//send email
to := make([]string, 1)
to[0] = "abc@gmail.com"
sendEmail, err := ee.Send(elasticemail.SendParams{To: to, BodyHtml: "<b>Hello!</b>", Subject: "Hello", From: "noreply@eeee.eee"})
if err!= nil {
log.Fatal(err.Error())
}
// get status:
status, err := ee.GetEmailStatus(elasticemail.GetEmailStatusParams{TransactionID: sendEmail.TransactionID})
if err != nil {
log.Fatal(err.Error())
}