Skip to main content

Creating a client

paubox.New accepts optional functional options:

Retry configuration

By default the client retries GET requests up to 3 times on 429 and 5xx responses, with exponential backoff between 500 ms and 30 s.

Send a message

Message fields

The paubox.Ptr[T] helper creates a pointer to any value, which is required for optional fields typed as *T:

Response

Send a batch

Send up to 50 messages in a single API call. Each message gets its own tracking ID.

Check delivery status

disp.Data.Message.MessageDeliveries is a slice of per-recipient records:
Common DeliveryStatus values: delivered, opened, failed, pending.

Dynamic templates

Templates use Handlebars syntax ({{variable_name}}).

Create a template

List templates

Get a template

Update a template

Delete a template

Send a templated message

Error handling

All methods return a typed error. Use errors.As to inspect details and errors.Is to match sentinels:

Sentinel errors