Documentation
¶
Overview ¶
Package cloud is the Mailtrap Sandbox Send API client.
Forwards a stored Message to the connected cloud sandbox at https://sandbox.api.mailtrap.io/api/send/{sandbox_id}. Same payload shape Mailtrap's hosted SDKs emit, with a reserved-headers list that matches the Send API's accepted set, and a transient/permanent error taxonomy so the dispatcher knows when to retry.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client targets a specific sandbox via API token. One Client per connected sandbox; built fresh each call site since auth is cheap.
BaseURL defaults to the production sandbox endpoint when zero. Tests override it by pointing at an httptest.Server; future staging-env support could use it the same way.
func (*Client) Send ¶
func (c *Client) Send(ctx context.Context, m *store.Message, inline, attachments []store.Part) error
Send forwards a Message + its attachments to the connected sandbox. Returns nil on 2xx, ErrPermanent for 4xx (don't retry), or a generic error for 5xx / network blips (do retry).
type PermanentError ¶
type PermanentError struct{ Msg string }
PermanentError signals "don't retry" (bad token, malformed payload, disabled sandbox).
func (*PermanentError) Error ¶
func (e *PermanentError) Error() string