Skip to content

kannon-email/kannon.go

Repository files navigation

kannon.go is the official GoLang client library for Kannon Email Sender

Instantiate kannon cli

sender := kannon.Sender{
  Email: "[email protected]",
  Alias: "Kannon",
}

k := kannon.NewKannon(
  "<YOUR DOMAIN>",
  "<API KEY>",
  sender,
  "<YOU KANNON API HOST>",
)

Basic Usage

html := `...`;

recipents := []kannon.Recipient{
  {
    Email: "[email protected]",
    Fields: kannon.Fields{
      "name": "Test",
    },
  },
}

res, err := k.SendEmail(
  recipents,
  "This is an email from kannon.go",
  html,
);

Sending Templates

templateID := `...`;

recipents := []kannon.Recipient{
  {
    Email: "[email protected]",
    Fields: kannon.Fields{
      "name": "Test",
    },
  },
}

res, err := k.SendTemplate(
  recipents,
  "This is an email from kannon.go",
  templateID,
);

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages