Creates a draft in the connected email account that owns the from address. Mirrors native email-client behavior: only from is required — to, cc, bcc, subject, messageBody, and attachments are all optional. At least one of those optional fields must be populated; sending only from returns a 400.
Supports idempotency via the Idempotency-Key header.
Required scope: emails:create
Rate limit category: Write
Create a draft 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"),
)
emailDraftResponse, err := client.Email.Draft(context.TODO(), githubcomlightfldlightfieldgo.EmailDraftParams{
From: "sales@acme.com",
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", emailDraftResponse.DraftedAt)
}
{
"draftedAt": "draftedAt"
}Returns Examples
{
"draftedAt": "draftedAt"
}