Send email from Go with Lettr
Lettr works with Go through the lettr-go module.
Checked
What you can do
- Send email and templates
- Manage domains and webhooks
- Manage your audience and campaigns
How to set it up
go get github.com/lettr-com/lettr-goclient := lettr.NewClient(os.Getenv("LETTR_API_KEY"))
resp, err := client.Emails.Send(ctx, &lettr.SendEmailRequest{
From: "sender@yourdomain.com",
To: []string{"recipient@example.com"},
Subject: "Hello from Lettr",
Html: "<h1>Hello!</h1><p>This is a test email.</p>",
})Requirements
- Go 1.21 or later