Sends an email via the connected email account that owns the from address. Currently supports new sends only; replies and forwards are not yet supported.
Supports idempotency via the Idempotency-Key header.
Required scope: emails:create
Rate limit category: Write
Send an email
package main
import (
"context"
"fmt"
"github.com/Lightfld/lightfield-go"
"github.com/Lightfld/lightfield-go/option"
)
func main() {
client := githubcomlightfldlightfieldgo.NewClient(
option.WithAPIKey("My API Key"),
)
emailSendResponse, err := client.Email.Send(context.TODO(), githubcomlightfldlightfieldgo.EmailSendParams{
From: "sales@acme.com",
MessageBody: githubcomlightfldlightfieldgo.EmailSendParamsMessageBody{
Content: "<p>Hi there,</p><p>Following up on our chat earlier this week.</p>",
},
Subject: "Following up on our chat",
To: []string{"lead@example.com"},
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", emailSendResponse.SentAt)
}
{
"sentAt": "sentAt"
}Returns Examples
{
"sentAt": "sentAt"
}