Install the package
go get -u github.com/youremailapi/go-sdk
Start using it
How to send and email:
import (
"fmt"
youremailapigosdk "github.com/youremailapi/go-sdk"
)
func main() {
var variables = make(map[string]string)
variables["%user_first_name%"] = "Federico"
variables["%app_name%"] = "YouremailAPI"
response, err := youremailapigosdk.SendEmail("<YOUR API KEY>", youremailapigosdk.SendEmailData{
Template: "<YOUR TEMPLATE TOKEN>",
SmtpAccount: "<YOUR SMTP ACCOUNT TOKEN>",
To: "contact@youremailapi.com",
Subject: "Some Subject",
Variables: variables,
})
if err != nil {
panic(err)
}
messageId := response.MessageID
accepted := response.Accepted
fmt.Println(messageId)
fmt.Println(accepted)
}