Xurel Docs

Go

Official module github.com/xurel/xurel-go.

Install

go
go get github.com/xurel/xurel-go

Usage

main.go
package main

import (
  "context"
  "fmt"
  "os"

  "github.com/xurel/xurel-go"
)

func main() {
  client := xurel.New(os.Getenv("XUREL_API_KEY"))
  email, err := client.Emails.Send(context.Background(), &xurel.SendParams{
    From:    "hello@yourdomain.com",
    To:      []string{"user@example.com"},
    Subject: "Hello",
    HTML:    "<p>Sent from Go</p>",
    Type:    "transactional",
  })
  if err != nil {
    panic(err)
  }
  fmt.Println(email.ID)
}