Documentation Index
Fetch the complete documentation index at: https://docs.mailglyph.com/llms.txt
Use this file to discover all available pages before exploring further.
Use a secret key client for template methods.
import (
"context"
"os"
mailglyph "github.com/MailGlyph/mailglyph-go"
)
client := mailglyph.New(os.Getenv("MAILGLYPH_SECRET_KEY"))
ctx := context.Background()
List templates (Templates.List)
limit := 20
templateType := "TRANSACTIONAL"
search := "welcome"
page, err := client.Templates.List(ctx, &mailglyph.ListTemplatesParams{
Limit: &limit,
Type: &templateType,
Search: &search,
})
if err != nil {
panic(err)
}
println(page.Total, page.TotalPages, len(page.Data))
You can paginate with cursor:
cursor := "next_cursor_value"
nextPage, err := client.Templates.List(ctx, &mailglyph.ListTemplatesParams{
Limit: &limit,
Cursor: &cursor,
})
if err != nil {
panic(err)
}
println(len(nextPage.Data))
See full details in the Templates API reference.