Versions in this module Expand all Collapse all v0 v0.2.0 Oct 5, 2026 Changes in this version type SendMessageParams + BCC []string + CC []string v0.1.0 Sep 27, 2026 Changes in this version + const MaxAttachmentTotalBytes + const MaxAttachments + func ErrorCode(err error) (string, bool) + func FormatAddress(address, name string) string + func JSONResponse(status int, body any) *http.Response + func SignWebhookRequest(secret, eventID string, body []byte, timestamp time.Time) http.Header + func UnsubscribeHeaders(opts UnsubscribeOptions) (http.Header, error) + func VerifyWebhookSignature(secrets []string, headers http.Header, rawBody []byte, opts *VerifyOptions) bool + type APIError struct + Code string + Fields []ValidationField + Message string + RawBody string + StatusCode int + func (e *APIError) Error() string + type Attachment = generated.Attachment + func NewAttachmentFromBytes(filename string, content []byte, opts ...AttachmentOption) (Attachment, error) + func NewAttachmentFromFile(path string, opts ...AttachmentOption) (Attachment, error) + type AttachmentOption func(*Attachment) + func WithContentID(contentID string) AttachmentOption + func WithContentType(contentType string) AttachmentOption + type AuthenticationError struct + type Client struct + Events *EventsService + Messages *MessagesService + Stats *StatsService + Suppressions *SuppressionsService + Webhooks *WebhooksService + func New(apiKey, domain string, opts ...Option) (*Client, error) + func (c *Client) Health(ctx context.Context) (*HealthStatus, error) + type ConflictError struct + type ConnectionError struct + Err error + func (e *ConnectionError) Error() string + func (e *ConnectionError) Unwrap() error + type CreateWebhookParams struct + Events []string + URL string + type Doer interface + Do func(req *http.Request) (*http.Response, error) + type Event = generated.Event + type EventPage = generated.EventPage + type EventType = generated.EventType + type EventsService struct + func (s *EventsService) List(ctx context.Context, params ListEventsParams) (*EventPage, error) + func (s *EventsService) ListAll(ctx context.Context, params ListEventsParams, maxItems int) iter.Seq2[*Event, error] + type GetStatsParams struct + Granularity string + Since *time.Time + Until *time.Time + type HealthStatus struct + Status string + type ListEventsParams struct + Cursor string + Limit int + MessageID string + Recipient string + Since *time.Time + Type string + type ListSuppressionsParams struct + Cursor string + Limit int + Reason string + type Message = generated.Message + type MessageAccepted = generated.MessageAccepted + type MessageAcceptedStatus = generated.MessageAcceptedStatus + type MessageStatus = generated.MessageStatus + type MessagesService struct + func (s *MessagesService) Get(ctx context.Context, id string) (*Message, error) + func (s *MessagesService) Send(ctx context.Context, params SendMessageParams) (*SendMessageResult, error) + type NotFoundError struct + type Option func(*config) + func WithBaseURL(baseURL string) Option + func WithHTTPClient(client Doer) Option + func WithLanguage(lang string) Option + func WithMaxRetries(n int) Option + func WithMaxRetryWait(d time.Duration) Option + func WithTimeout(d time.Duration) Option + func WithUserAgent(ua string) Option + type PayloadTooLargeError struct + type PermissionError struct + type QuotaExceededError struct + RetryAfter time.Duration + type RateLimitError struct + RetryAfter time.Duration + type Recipient = generated.Recipient + type RecipientStatus = generated.RecipientStatus + type RecordedRequest struct + Body []byte + Header http.Header + Method string + Path string + Query url.Values + type SendMessageParams struct + Attachments []Attachment + From string + HTML string + Headers map[string]string + IdempotencyKey string + Metadata map[string]string + ReplyTo string + Subject string + Tags []string + Text string + To []string + Tracking *Tracking + type SendMessageResult struct + ID string + Location string + Replayed bool + Status string + type ServerError struct + type Stats = generated.Stats + type StatsGranularity = generated.StatsGranularity + type StatsPeriod = generated.StatsPeriod + type StatsService struct + func (s *StatsService) Get(ctx context.Context, params GetStatsParams) (*Stats, error) + type Suppression = generated.Suppression + type SuppressionPage = generated.SuppressionPage + type SuppressionReason = generated.SuppressionReason + type SuppressionsService struct + func (s *SuppressionsService) Add(ctx context.Context, email string) (suppression *Suppression, created bool, err error) + func (s *SuppressionsService) List(ctx context.Context, params ListSuppressionsParams) (*SuppressionPage, error) + func (s *SuppressionsService) ListAll(ctx context.Context, params ListSuppressionsParams, maxItems int) iter.Seq2[*Suppression, error] + func (s *SuppressionsService) Remove(ctx context.Context, email string) error + type TestTransport struct + Requests []RecordedRequest + func NewTestTransport(handler func(*http.Request) (*http.Response, error)) *TestTransport + func (t *TestTransport) Do(req *http.Request) (*http.Response, error) + type TimeoutError struct + Err error + func (e *TimeoutError) Error() string + func (e *TimeoutError) Unwrap() error + type Tracking = generated.Tracking + type UnsubscribeOptions struct + HTTPSURL string + Mailto string + OneClick *bool + type ValidationError struct + type ValidationField struct + Field string + Message string + type VerifyOptions struct + Now time.Time + ToleranceSeconds int + type Webhook = generated.Webhook + type WebhookDelivery = generated.WebhookDelivery + type WebhookDeliveryList = generated.WebhookDeliveryList + type WebhookDeliveryStatus = generated.WebhookDeliveryStatus + type WebhookEvent struct + Data map[string]any + Domain string + ID string + Type string + func ConstructEvent(secrets []string, headers http.Header, rawBody []byte, opts *VerifyOptions) (*WebhookEvent, error) + type WebhookList = generated.WebhookList + type WebhookSignatureError struct + func (e *WebhookSignatureError) Error() string + type WebhookStatus = generated.WebhookStatus + type WebhooksService struct + func (s *WebhooksService) Create(ctx context.Context, params CreateWebhookParams) (*Webhook, error) + func (s *WebhooksService) Delete(ctx context.Context, id string) error + func (s *WebhooksService) Deliveries(ctx context.Context, id string, limit int) ([]WebhookDelivery, error) + func (s *WebhooksService) Get(ctx context.Context, id string) (*Webhook, error) + func (s *WebhooksService) List(ctx context.Context) ([]Webhook, error) v0.0.1 Sep 26, 2026