Documentation
¶
Index ¶
- func Bool(b bool) param.Opt[bool]
- func BoolPtr(v bool) *bool
- func DefaultClientOptions() []option.RequestOption
- func File(rdr io.Reader, filename string, contentType string) file
- func Float(f float64) param.Opt[float64]
- func FloatPtr(v float64) *float64
- func Int(i int64) param.Opt[int64]
- func IntPtr(v int64) *int64
- func Opt[T comparable](v T) param.Opt[T]
- func Ptr[T any](v T) *T
- func String(s string) param.Opt[string]
- func StringPtr(v string) *string
- func Time(t time.Time) param.Opt[time.Time]
- func TimePtr(v time.Time) *time.Time
- type APIMeta
- type Client
- func (r *Client) Delete(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, ...) error
- func (r *Client) Get(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Patch(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Post(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Put(ctx context.Context, path string, params any, res any, ...) error
- type DNSRecord
- type DNSRecordStatus
- type DNSRecordType
- type DomainDeleteResponse
- type DomainDeleteResponseData
- type DomainGetResponse
- type DomainGetResponseData
- type DomainGetResponseDataDNSRecords
- type DomainListResponse
- type DomainListResponseData
- type DomainListResponseDataDomain
- type DomainNewParams
- type DomainNewResponse
- type DomainNewResponseData
- type DomainNewResponseDataDNSRecords
- type DomainService
- func (r *DomainService) Delete(ctx context.Context, domainID string, opts ...option.RequestOption) (res *DomainDeleteResponse, err error)
- func (r *DomainService) Get(ctx context.Context, domainID string, opts ...option.RequestOption) (res *DomainGetResponse, err error)
- func (r *DomainService) List(ctx context.Context, opts ...option.RequestOption) (res *DomainListResponse, err error)
- func (r *DomainService) New(ctx context.Context, body DomainNewParams, opts ...option.RequestOption) (res *DomainNewResponse, err error)
- func (r *DomainService) Verify(ctx context.Context, domainID string, opts ...option.RequestOption) (res *DomainVerifyResponse, err error)
- type DomainVerifyResponse
- type DomainVerifyResponseData
- type DomainVerifyResponseDataDNSRecords
- type EmailGetDeliveriesResponse
- type EmailGetDeliveriesResponseData
- type EmailGetDeliveriesResponseDataDelivery
- type EmailGetParams
- type EmailGetResponse
- type EmailGetResponseData
- type EmailGetResponseDataDelivery
- type EmailListParams
- type EmailListParamsStatus
- type EmailListResponse
- type EmailListResponseStatus
- type EmailRetryResponse
- type EmailRetryResponseData
- type EmailSendBatchParams
- type EmailSendBatchParamsEmail
- type EmailSendBatchResponse
- type EmailSendBatchResponseData
- type EmailSendBatchResponseDataMessage
- type EmailSendParams
- type EmailSendParamsAttachment
- type EmailSendRawParams
- type EmailSendRawResponse
- type EmailSendRawResponseData
- type EmailSendResponse
- type EmailSendResponseData
- type EmailService
- func (r *EmailService) Get(ctx context.Context, emailID string, query EmailGetParams, ...) (res *EmailGetResponse, err error)
- func (r *EmailService) GetDeliveries(ctx context.Context, emailID string, opts ...option.RequestOption) (res *EmailGetDeliveriesResponse, err error)
- func (r *EmailService) List(ctx context.Context, query EmailListParams, opts ...option.RequestOption) (res *pagination.PageNumberPagination[EmailListResponse], err error)
- func (r *EmailService) ListAutoPaging(ctx context.Context, query EmailListParams, opts ...option.RequestOption) *pagination.PageNumberPaginationAutoPager[EmailListResponse]
- func (r *EmailService) Retry(ctx context.Context, emailID string, opts ...option.RequestOption) (res *EmailRetryResponse, err error)
- func (r *EmailService) Send(ctx context.Context, params EmailSendParams, opts ...option.RequestOption) (res *EmailSendResponse, err error)
- func (r *EmailService) SendBatch(ctx context.Context, params EmailSendBatchParams, opts ...option.RequestOption) (res *EmailSendBatchResponse, err error)
- func (r *EmailService) SendRaw(ctx context.Context, body EmailSendRawParams, opts ...option.RequestOption) (res *EmailSendRawResponse, err error)
- type Error
- type SuppressionBulkNewParams
- type SuppressionBulkNewParamsSuppression
- type SuppressionBulkNewResponse
- type SuppressionBulkNewResponseData
- type SuppressionDeleteResponse
- type SuppressionDeleteResponseData
- type SuppressionGetResponse
- type SuppressionGetResponseData
- type SuppressionListParams
- type SuppressionListResponse
- type SuppressionNewParams
- type SuppressionNewResponse
- type SuppressionNewResponseData
- type SuppressionService
- func (r *SuppressionService) BulkNew(ctx context.Context, body SuppressionBulkNewParams, ...) (res *SuppressionBulkNewResponse, err error)
- func (r *SuppressionService) Delete(ctx context.Context, email string, opts ...option.RequestOption) (res *SuppressionDeleteResponse, err error)
- func (r *SuppressionService) Get(ctx context.Context, email string, opts ...option.RequestOption) (res *SuppressionGetResponse, err error)
- func (r *SuppressionService) List(ctx context.Context, query SuppressionListParams, opts ...option.RequestOption) (res *pagination.PageNumberPagination[SuppressionListResponse], err error)
- func (r *SuppressionService) ListAutoPaging(ctx context.Context, query SuppressionListParams, opts ...option.RequestOption) *pagination.PageNumberPaginationAutoPager[SuppressionListResponse]
- func (r *SuppressionService) New(ctx context.Context, body SuppressionNewParams, opts ...option.RequestOption) (res *SuppressionNewResponse, err error)
- type TrackDomain
- type TrackDomainDNSRecord
- type TrackDomainDNSStatus
- type TrackingDeleteResponse
- type TrackingDeleteResponseData
- type TrackingGetResponse
- type TrackingListResponse
- type TrackingListResponseData
- type TrackingNewParams
- type TrackingNewResponse
- type TrackingService
- func (r *TrackingService) Delete(ctx context.Context, trackingID string, opts ...option.RequestOption) (res *TrackingDeleteResponse, err error)
- func (r *TrackingService) Get(ctx context.Context, trackingID string, opts ...option.RequestOption) (res *TrackingGetResponse, err error)
- func (r *TrackingService) List(ctx context.Context, opts ...option.RequestOption) (res *TrackingListResponse, err error)
- func (r *TrackingService) New(ctx context.Context, body TrackingNewParams, opts ...option.RequestOption) (res *TrackingNewResponse, err error)
- func (r *TrackingService) Update(ctx context.Context, trackingID string, body TrackingUpdateParams, ...) (res *TrackingUpdateResponse, err error)
- func (r *TrackingService) Verify(ctx context.Context, trackingID string, opts ...option.RequestOption) (res *TrackingVerifyResponse, err error)
- type TrackingUpdateParams
- type TrackingUpdateResponse
- type TrackingVerifyResponse
- type TrackingVerifyResponseData
- type TrackingVerifyResponseDataDNSRecord
- type WebhookDeleteResponse
- type WebhookDeleteResponseData
- type WebhookGetResponse
- type WebhookGetResponseData
- type WebhookListResponse
- type WebhookListResponseData
- type WebhookListResponseDataWebhook
- type WebhookNewParams
- type WebhookNewResponse
- type WebhookNewResponseData
- type WebhookService
- func (r *WebhookService) Delete(ctx context.Context, webhookID string, opts ...option.RequestOption) (res *WebhookDeleteResponse, err error)
- func (r *WebhookService) Get(ctx context.Context, webhookID string, opts ...option.RequestOption) (res *WebhookGetResponse, err error)
- func (r *WebhookService) List(ctx context.Context, opts ...option.RequestOption) (res *WebhookListResponse, err error)
- func (r *WebhookService) New(ctx context.Context, body WebhookNewParams, opts ...option.RequestOption) (res *WebhookNewResponse, err error)
- func (r *WebhookService) Test(ctx context.Context, webhookID string, body WebhookTestParams, ...) (res *WebhookTestResponse, err error)
- func (r *WebhookService) Update(ctx context.Context, webhookID string, body WebhookUpdateParams, ...) (res *WebhookUpdateResponse, err error)
- type WebhookTestParams
- type WebhookTestParamsEvent
- type WebhookTestResponse
- type WebhookTestResponseData
- type WebhookUpdateParams
- type WebhookUpdateResponse
- type WebhookUpdateResponseData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultClientOptions ¶
func DefaultClientOptions() []option.RequestOption
DefaultClientOptions read from the environment (ARK_API_KEY, ARK_BASE_URL). This should be used to initialize new clients.
func Opt ¶
func Opt[T comparable](v T) param.Opt[T]
Types ¶
type Client ¶
type Client struct {
Options []option.RequestOption
Emails EmailService
Domains DomainService
Suppressions SuppressionService
Webhooks WebhookService
Tracking TrackingService
}
Client creates a struct with services and top level methods that help with interacting with the ark API. You should not instantiate this client directly, and instead use the NewClient method instead.
func NewClient ¶
func NewClient(opts ...option.RequestOption) (r Client)
NewClient generates a new client with the default option read from the environment (ARK_API_KEY, ARK_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.
func (*Client) Delete ¶
func (r *Client) Delete(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Execute ¶
func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, opts ...option.RequestOption) error
Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.
If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.
The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned url.Values will be used as query strings to the url.
If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.
Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.
The response body will be deserialized into the res variable, depending on its type:
- A pointer to a *http.Response is populated by the raw response.
- A pointer to a byte array will be populated with the contents of the request body.
- A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
- A nil value will not read the response body.
For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.
func (*Client) Get ¶
func (r *Client) Get(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Patch ¶
func (r *Client) Patch(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
type DNSRecord ¶
type DNSRecord struct {
// DNS record name (hostname)
Name string `json:"name,required"`
// DNS record type
//
// Any of "TXT", "CNAME", "MX".
Type DNSRecordType `json:"type,required"`
// DNS record value
Value string `json:"value,required"`
// DNS verification status:
//
// - `OK` - Record is correctly configured
// - `Missing` - Record not found in DNS
// - `Invalid` - Record exists but has wrong value
// - `null` - Not yet checked
//
// Any of "OK", "Missing", "Invalid".
Status DNSRecordStatus `json:"status,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Name respjson.Field
Type respjson.Field
Value respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*DNSRecord) UnmarshalJSON ¶
type DNSRecordStatus ¶
type DNSRecordStatus string
DNS verification status:
- `OK` - Record is correctly configured - `Missing` - Record not found in DNS - `Invalid` - Record exists but has wrong value - `null` - Not yet checked
const ( DNSRecordStatusOk DNSRecordStatus = "OK" DNSRecordStatusMissing DNSRecordStatus = "Missing" DNSRecordStatusInvalid DNSRecordStatus = "Invalid" )
type DNSRecordType ¶
type DNSRecordType string
DNS record type
const ( DNSRecordTypeTxt DNSRecordType = "TXT" DNSRecordTypeCname DNSRecordType = "CNAME" DNSRecordTypeMx DNSRecordType = "MX" )
type DomainDeleteResponse ¶ added in v0.3.0
type DomainDeleteResponse struct {
Data DomainDeleteResponseData `json:"data,required"`
Meta shared.APIMeta `json:"meta,required"`
Success bool `json:"success,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Meta respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (DomainDeleteResponse) RawJSON ¶ added in v0.3.0
func (r DomainDeleteResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*DomainDeleteResponse) UnmarshalJSON ¶ added in v0.3.0
func (r *DomainDeleteResponse) UnmarshalJSON(data []byte) error
type DomainDeleteResponseData ¶ added in v0.3.0
type DomainDeleteResponseData struct {
Message string `json:"message,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (DomainDeleteResponseData) RawJSON ¶ added in v0.3.0
func (r DomainDeleteResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*DomainDeleteResponseData) UnmarshalJSON ¶ added in v0.3.0
func (r *DomainDeleteResponseData) UnmarshalJSON(data []byte) error
type DomainGetResponse ¶ added in v0.3.0
type DomainGetResponse struct {
Data DomainGetResponseData `json:"data,required"`
Meta shared.APIMeta `json:"meta,required"`
Success bool `json:"success,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Meta respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (DomainGetResponse) RawJSON ¶ added in v0.3.0
func (r DomainGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*DomainGetResponse) UnmarshalJSON ¶ added in v0.3.0
func (r *DomainGetResponse) UnmarshalJSON(data []byte) error
type DomainGetResponseData ¶ added in v0.3.0
type DomainGetResponseData struct {
// Domain ID
ID string `json:"id,required"`
CreatedAt time.Time `json:"createdAt,required" format:"date-time"`
DNSRecords DomainGetResponseDataDNSRecords `json:"dnsRecords,required"`
// Domain name
Name string `json:"name,required"`
Uuid string `json:"uuid,required" format:"uuid"`
// Whether DNS is verified
Verified bool `json:"verified,required"`
// When the domain was verified (null if not verified)
VerifiedAt time.Time `json:"verifiedAt,nullable" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
DNSRecords respjson.Field
Name respjson.Field
Uuid respjson.Field
Verified respjson.Field
VerifiedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (DomainGetResponseData) RawJSON ¶ added in v0.3.0
func (r DomainGetResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*DomainGetResponseData) UnmarshalJSON ¶ added in v0.3.0
func (r *DomainGetResponseData) UnmarshalJSON(data []byte) error
type DomainGetResponseDataDNSRecords ¶ added in v0.3.0
type DomainGetResponseDataDNSRecords struct {
Dkim DNSRecord `json:"dkim,required"`
ReturnPath DNSRecord `json:"returnPath,required"`
Spf DNSRecord `json:"spf,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Dkim respjson.Field
ReturnPath respjson.Field
Spf respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (DomainGetResponseDataDNSRecords) RawJSON ¶ added in v0.3.0
func (r DomainGetResponseDataDNSRecords) RawJSON() string
Returns the unmodified JSON received from the API
func (*DomainGetResponseDataDNSRecords) UnmarshalJSON ¶ added in v0.3.0
func (r *DomainGetResponseDataDNSRecords) UnmarshalJSON(data []byte) error
type DomainListResponse ¶
type DomainListResponse struct {
Data DomainListResponseData `json:"data,required"`
Meta shared.APIMeta `json:"meta,required"`
Success bool `json:"success,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Meta respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (DomainListResponse) RawJSON ¶
func (r DomainListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*DomainListResponse) UnmarshalJSON ¶
func (r *DomainListResponse) UnmarshalJSON(data []byte) error
type DomainListResponseData ¶
type DomainListResponseData struct {
Domains []DomainListResponseDataDomain `json:"domains,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Domains respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (DomainListResponseData) RawJSON ¶
func (r DomainListResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*DomainListResponseData) UnmarshalJSON ¶
func (r *DomainListResponseData) UnmarshalJSON(data []byte) error
type DomainListResponseDataDomain ¶
type DomainListResponseDataDomain struct {
// Domain ID
ID string `json:"id,required"`
DNSOk bool `json:"dnsOk,required"`
Name string `json:"name,required"`
Verified bool `json:"verified,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
DNSOk respjson.Field
Name respjson.Field
Verified respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (DomainListResponseDataDomain) RawJSON ¶
func (r DomainListResponseDataDomain) RawJSON() string
Returns the unmodified JSON received from the API
func (*DomainListResponseDataDomain) UnmarshalJSON ¶
func (r *DomainListResponseDataDomain) UnmarshalJSON(data []byte) error
type DomainNewParams ¶
type DomainNewParams struct {
// Domain name (e.g., "mail.example.com")
Name string `json:"name,required"`
// contains filtered or unexported fields
}
func (DomainNewParams) MarshalJSON ¶
func (r DomainNewParams) MarshalJSON() (data []byte, err error)
func (*DomainNewParams) UnmarshalJSON ¶
func (r *DomainNewParams) UnmarshalJSON(data []byte) error
type DomainNewResponse ¶ added in v0.3.0
type DomainNewResponse struct {
Data DomainNewResponseData `json:"data,required"`
Meta shared.APIMeta `json:"meta,required"`
Success bool `json:"success,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Meta respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (DomainNewResponse) RawJSON ¶ added in v0.3.0
func (r DomainNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*DomainNewResponse) UnmarshalJSON ¶ added in v0.3.0
func (r *DomainNewResponse) UnmarshalJSON(data []byte) error
type DomainNewResponseData ¶ added in v0.3.0
type DomainNewResponseData struct {
// Domain ID
ID string `json:"id,required"`
CreatedAt time.Time `json:"createdAt,required" format:"date-time"`
DNSRecords DomainNewResponseDataDNSRecords `json:"dnsRecords,required"`
// Domain name
Name string `json:"name,required"`
Uuid string `json:"uuid,required" format:"uuid"`
// Whether DNS is verified
Verified bool `json:"verified,required"`
// When the domain was verified (null if not verified)
VerifiedAt time.Time `json:"verifiedAt,nullable" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
DNSRecords respjson.Field
Name respjson.Field
Uuid respjson.Field
Verified respjson.Field
VerifiedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (DomainNewResponseData) RawJSON ¶ added in v0.3.0
func (r DomainNewResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*DomainNewResponseData) UnmarshalJSON ¶ added in v0.3.0
func (r *DomainNewResponseData) UnmarshalJSON(data []byte) error
type DomainNewResponseDataDNSRecords ¶ added in v0.3.0
type DomainNewResponseDataDNSRecords struct {
Dkim DNSRecord `json:"dkim,required"`
ReturnPath DNSRecord `json:"returnPath,required"`
Spf DNSRecord `json:"spf,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Dkim respjson.Field
ReturnPath respjson.Field
Spf respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (DomainNewResponseDataDNSRecords) RawJSON ¶ added in v0.3.0
func (r DomainNewResponseDataDNSRecords) RawJSON() string
Returns the unmodified JSON received from the API
func (*DomainNewResponseDataDNSRecords) UnmarshalJSON ¶ added in v0.3.0
func (r *DomainNewResponseDataDNSRecords) UnmarshalJSON(data []byte) error
type DomainService ¶
type DomainService struct {
Options []option.RequestOption
}
DomainService contains methods and other services that help with interacting with the ark API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewDomainService method instead.
func NewDomainService ¶
func NewDomainService(opts ...option.RequestOption) (r DomainService)
NewDomainService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*DomainService) Delete ¶
func (r *DomainService) Delete(ctx context.Context, domainID string, opts ...option.RequestOption) (res *DomainDeleteResponse, err error)
Remove a sending domain. You will no longer be able to send emails from this domain.
**Warning:** This action cannot be undone.
func (*DomainService) Get ¶
func (r *DomainService) Get(ctx context.Context, domainID string, opts ...option.RequestOption) (res *DomainGetResponse, err error)
Get detailed information about a domain including DNS record status
func (*DomainService) List ¶
func (r *DomainService) List(ctx context.Context, opts ...option.RequestOption) (res *DomainListResponse, err error)
Get all sending domains with their verification status
func (*DomainService) New ¶
func (r *DomainService) New(ctx context.Context, body DomainNewParams, opts ...option.RequestOption) (res *DomainNewResponse, err error)
Add a new domain for sending emails. Returns DNS records that must be configured before the domain can be verified.
**Required DNS records:**
- **SPF** - TXT record for sender authentication - **DKIM** - TXT record for email signing - **Return Path** - CNAME for bounce handling
After adding DNS records, call `POST /domains/{id}/verify` to verify.
func (*DomainService) Verify ¶
func (r *DomainService) Verify(ctx context.Context, domainID string, opts ...option.RequestOption) (res *DomainVerifyResponse, err error)
Check if DNS records are correctly configured and verify the domain. Returns the current status of each required DNS record.
Call this after you've added the DNS records shown when creating the domain.
type DomainVerifyResponse ¶ added in v0.3.0
type DomainVerifyResponse struct {
Data DomainVerifyResponseData `json:"data,required"`
Meta shared.APIMeta `json:"meta,required"`
Success bool `json:"success,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Meta respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (DomainVerifyResponse) RawJSON ¶ added in v0.3.0
func (r DomainVerifyResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*DomainVerifyResponse) UnmarshalJSON ¶ added in v0.3.0
func (r *DomainVerifyResponse) UnmarshalJSON(data []byte) error
type DomainVerifyResponseData ¶ added in v0.3.0
type DomainVerifyResponseData struct {
// Domain ID
ID string `json:"id,required"`
CreatedAt time.Time `json:"createdAt,required" format:"date-time"`
DNSRecords DomainVerifyResponseDataDNSRecords `json:"dnsRecords,required"`
// Domain name
Name string `json:"name,required"`
Uuid string `json:"uuid,required" format:"uuid"`
// Whether DNS is verified
Verified bool `json:"verified,required"`
// When the domain was verified (null if not verified)
VerifiedAt time.Time `json:"verifiedAt,nullable" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
DNSRecords respjson.Field
Name respjson.Field
Uuid respjson.Field
Verified respjson.Field
VerifiedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (DomainVerifyResponseData) RawJSON ¶ added in v0.3.0
func (r DomainVerifyResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*DomainVerifyResponseData) UnmarshalJSON ¶ added in v0.3.0
func (r *DomainVerifyResponseData) UnmarshalJSON(data []byte) error
type DomainVerifyResponseDataDNSRecords ¶ added in v0.3.0
type DomainVerifyResponseDataDNSRecords struct {
Dkim DNSRecord `json:"dkim,required"`
ReturnPath DNSRecord `json:"returnPath,required"`
Spf DNSRecord `json:"spf,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Dkim respjson.Field
ReturnPath respjson.Field
Spf respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (DomainVerifyResponseDataDNSRecords) RawJSON ¶ added in v0.3.0
func (r DomainVerifyResponseDataDNSRecords) RawJSON() string
Returns the unmodified JSON received from the API
func (*DomainVerifyResponseDataDNSRecords) UnmarshalJSON ¶ added in v0.3.0
func (r *DomainVerifyResponseDataDNSRecords) UnmarshalJSON(data []byte) error
type EmailGetDeliveriesResponse ¶
type EmailGetDeliveriesResponse struct {
Data EmailGetDeliveriesResponseData `json:"data,required"`
Meta shared.APIMeta `json:"meta,required"`
Success bool `json:"success,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Meta respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (EmailGetDeliveriesResponse) RawJSON ¶
func (r EmailGetDeliveriesResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*EmailGetDeliveriesResponse) UnmarshalJSON ¶
func (r *EmailGetDeliveriesResponse) UnmarshalJSON(data []byte) error
type EmailGetDeliveriesResponseData ¶
type EmailGetDeliveriesResponseData struct {
Deliveries []EmailGetDeliveriesResponseDataDelivery `json:"deliveries,required"`
// Internal message ID
MessageID string `json:"messageId,required"`
// Message token
MessageToken string `json:"messageToken,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Deliveries respjson.Field
MessageID respjson.Field
MessageToken respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (EmailGetDeliveriesResponseData) RawJSON ¶
func (r EmailGetDeliveriesResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*EmailGetDeliveriesResponseData) UnmarshalJSON ¶
func (r *EmailGetDeliveriesResponseData) UnmarshalJSON(data []byte) error
type EmailGetDeliveriesResponseDataDelivery ¶ added in v0.3.0
type EmailGetDeliveriesResponseDataDelivery struct {
// Delivery attempt ID
ID string `json:"id,required"`
// Delivery status (lowercase)
Status string `json:"status,required"`
// Unix timestamp
Timestamp float64 `json:"timestamp,required"`
// ISO 8601 timestamp
TimestampISO time.Time `json:"timestampIso,required" format:"date-time"`
// SMTP response code
Code int64 `json:"code"`
// Status details
Details string `json:"details"`
// SMTP server response from the receiving mail server
Output string `json:"output"`
// Whether TLS was used
SentWithSsl bool `json:"sentWithSsl"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Status respjson.Field
Timestamp respjson.Field
TimestampISO respjson.Field
Code respjson.Field
Details respjson.Field
Output respjson.Field
SentWithSsl respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (EmailGetDeliveriesResponseDataDelivery) RawJSON ¶ added in v0.3.0
func (r EmailGetDeliveriesResponseDataDelivery) RawJSON() string
Returns the unmodified JSON received from the API
func (*EmailGetDeliveriesResponseDataDelivery) UnmarshalJSON ¶ added in v0.3.0
func (r *EmailGetDeliveriesResponseDataDelivery) UnmarshalJSON(data []byte) error
type EmailGetParams ¶
type EmailGetParams struct {
// Comma-separated list of fields to include:
//
// - `content` - HTML and plain text body
// - `headers` - Email headers
// - `deliveries` - Delivery attempt history
// - `activity` - Opens and clicks
Expand param.Opt[string] `query:"expand,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (EmailGetParams) URLQuery ¶
func (r EmailGetParams) URLQuery() (v url.Values, err error)
URLQuery serializes EmailGetParams's query parameters as `url.Values`.
type EmailGetResponse ¶
type EmailGetResponse struct {
Data EmailGetResponseData `json:"data,required"`
Meta shared.APIMeta `json:"meta,required"`
Success bool `json:"success,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Meta respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (EmailGetResponse) RawJSON ¶
func (r EmailGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*EmailGetResponse) UnmarshalJSON ¶
func (r *EmailGetResponse) UnmarshalJSON(data []byte) error
type EmailGetResponseData ¶
type EmailGetResponseData struct {
// Internal message ID
ID string `json:"id,required"`
// Unique message token used to retrieve this email via API. Combined with id to
// form the full message identifier: msg*{id}*{token} Use this token with GET
// /emails/{emailId} where emailId = "msg*{id}*{token}"
Token string `json:"token,required"`
// Sender address
From string `json:"from,required"`
// Message direction
//
// Any of "outgoing", "incoming".
Scope string `json:"scope,required"`
// Current delivery status:
//
// - `pending` - Email accepted, waiting to be processed
// - `sent` - Email transmitted to recipient's mail server
// - `softfail` - Temporary delivery failure, will retry
// - `hardfail` - Permanent delivery failure
// - `bounced` - Email bounced back
// - `held` - Held for manual review
//
// Any of "pending", "sent", "softfail", "hardfail", "bounced", "held".
Status string `json:"status,required"`
// Email subject line
Subject string `json:"subject,required"`
// Unix timestamp when the email was sent
Timestamp float64 `json:"timestamp,required"`
// ISO 8601 formatted timestamp
TimestampISO time.Time `json:"timestampIso,required" format:"date-time"`
// Recipient address
To string `json:"to,required" format:"email"`
// Delivery attempt history (included if expand=deliveries)
Deliveries []EmailGetResponseDataDelivery `json:"deliveries"`
// Email headers (included if expand=headers)
Headers map[string]string `json:"headers"`
// HTML body content (included if expand=content)
HTMLBody string `json:"htmlBody"`
// SMTP Message-ID header
MessageID string `json:"messageId"`
// Plain text body (included if expand=content)
PlainBody string `json:"plainBody"`
// Whether the message was flagged as spam
Spam bool `json:"spam"`
// Spam score (if applicable)
SpamScore float64 `json:"spamScore"`
// Optional categorization tag
Tag string `json:"tag"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Token respjson.Field
From respjson.Field
Scope respjson.Field
Status respjson.Field
Subject respjson.Field
Timestamp respjson.Field
TimestampISO respjson.Field
To respjson.Field
Deliveries respjson.Field
Headers respjson.Field
HTMLBody respjson.Field
MessageID respjson.Field
PlainBody respjson.Field
Spam respjson.Field
SpamScore respjson.Field
Tag respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (EmailGetResponseData) RawJSON ¶
func (r EmailGetResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*EmailGetResponseData) UnmarshalJSON ¶
func (r *EmailGetResponseData) UnmarshalJSON(data []byte) error
type EmailGetResponseDataDelivery ¶ added in v0.3.0
type EmailGetResponseDataDelivery struct {
// Delivery attempt ID
ID string `json:"id,required"`
// Delivery status (lowercase)
Status string `json:"status,required"`
// Unix timestamp
Timestamp float64 `json:"timestamp,required"`
// ISO 8601 timestamp
TimestampISO time.Time `json:"timestampIso,required" format:"date-time"`
// SMTP response code
Code int64 `json:"code"`
// Status details
Details string `json:"details"`
// SMTP server response from the receiving mail server
Output string `json:"output"`
// Whether TLS was used
SentWithSsl bool `json:"sentWithSsl"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Status respjson.Field
Timestamp respjson.Field
TimestampISO respjson.Field
Code respjson.Field
Details respjson.Field
Output respjson.Field
SentWithSsl respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (EmailGetResponseDataDelivery) RawJSON ¶ added in v0.3.0
func (r EmailGetResponseDataDelivery) RawJSON() string
Returns the unmodified JSON received from the API
func (*EmailGetResponseDataDelivery) UnmarshalJSON ¶ added in v0.3.0
func (r *EmailGetResponseDataDelivery) UnmarshalJSON(data []byte) error
type EmailListParams ¶
type EmailListParams struct {
// Return emails sent after this timestamp (Unix seconds or ISO 8601)
After param.Opt[string] `query:"after,omitzero" json:"-"`
// Return emails sent before this timestamp
Before param.Opt[string] `query:"before,omitzero" json:"-"`
// Filter by sender email address
From param.Opt[string] `query:"from,omitzero" format:"email" json:"-"`
// Page number (starts at 1)
Page param.Opt[int64] `query:"page,omitzero" json:"-"`
// Results per page (max 100)
PerPage param.Opt[int64] `query:"perPage,omitzero" json:"-"`
// Filter by tag
Tag param.Opt[string] `query:"tag,omitzero" json:"-"`
// Filter by recipient email address
To param.Opt[string] `query:"to,omitzero" format:"email" json:"-"`
// Filter by delivery status:
//
// - `pending` - Email accepted, waiting to be processed
// - `sent` - Email transmitted to recipient's mail server
// - `softfail` - Temporary delivery failure, will retry
// - `hardfail` - Permanent delivery failure
// - `bounced` - Email bounced back
// - `held` - Held for manual review
//
// Any of "pending", "sent", "softfail", "hardfail", "bounced", "held".
Status EmailListParamsStatus `query:"status,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (EmailListParams) URLQuery ¶
func (r EmailListParams) URLQuery() (v url.Values, err error)
URLQuery serializes EmailListParams's query parameters as `url.Values`.
type EmailListParamsStatus ¶
type EmailListParamsStatus string
Filter by delivery status:
- `pending` - Email accepted, waiting to be processed - `sent` - Email transmitted to recipient's mail server - `softfail` - Temporary delivery failure, will retry - `hardfail` - Permanent delivery failure - `bounced` - Email bounced back - `held` - Held for manual review
const ( EmailListParamsStatusPending EmailListParamsStatus = "pending" EmailListParamsStatusSent EmailListParamsStatus = "sent" EmailListParamsStatusSoftfail EmailListParamsStatus = "softfail" EmailListParamsStatusHardfail EmailListParamsStatus = "hardfail" EmailListParamsStatusBounced EmailListParamsStatus = "bounced" EmailListParamsStatusHeld EmailListParamsStatus = "held" )
type EmailListResponse ¶
type EmailListResponse struct {
// Internal message ID
ID string `json:"id,required"`
Token string `json:"token,required"`
From string `json:"from,required"`
// Current delivery status:
//
// - `pending` - Email accepted, waiting to be processed
// - `sent` - Email transmitted to recipient's mail server
// - `softfail` - Temporary delivery failure, will retry
// - `hardfail` - Permanent delivery failure
// - `bounced` - Email bounced back
// - `held` - Held for manual review
//
// Any of "pending", "sent", "softfail", "hardfail", "bounced", "held".
Status EmailListResponseStatus `json:"status,required"`
Subject string `json:"subject,required"`
Timestamp float64 `json:"timestamp,required"`
TimestampISO time.Time `json:"timestampIso,required" format:"date-time"`
To string `json:"to,required" format:"email"`
Tag string `json:"tag"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Token respjson.Field
From respjson.Field
Status respjson.Field
Subject respjson.Field
Timestamp respjson.Field
TimestampISO respjson.Field
To respjson.Field
Tag respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (EmailListResponse) RawJSON ¶
func (r EmailListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*EmailListResponse) UnmarshalJSON ¶
func (r *EmailListResponse) UnmarshalJSON(data []byte) error
type EmailListResponseStatus ¶ added in v0.4.0
type EmailListResponseStatus string
Current delivery status:
- `pending` - Email accepted, waiting to be processed - `sent` - Email transmitted to recipient's mail server - `softfail` - Temporary delivery failure, will retry - `hardfail` - Permanent delivery failure - `bounced` - Email bounced back - `held` - Held for manual review
const ( EmailListResponseStatusPending EmailListResponseStatus = "pending" EmailListResponseStatusSent EmailListResponseStatus = "sent" EmailListResponseStatusSoftfail EmailListResponseStatus = "softfail" EmailListResponseStatusHardfail EmailListResponseStatus = "hardfail" EmailListResponseStatusBounced EmailListResponseStatus = "bounced" EmailListResponseStatusHeld EmailListResponseStatus = "held" )
type EmailRetryResponse ¶
type EmailRetryResponse struct {
Data EmailRetryResponseData `json:"data,required"`
Meta shared.APIMeta `json:"meta,required"`
Success bool `json:"success,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Meta respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (EmailRetryResponse) RawJSON ¶
func (r EmailRetryResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*EmailRetryResponse) UnmarshalJSON ¶
func (r *EmailRetryResponse) UnmarshalJSON(data []byte) error
type EmailRetryResponseData ¶
type EmailRetryResponseData struct {
Message string `json:"message,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (EmailRetryResponseData) RawJSON ¶
func (r EmailRetryResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*EmailRetryResponseData) UnmarshalJSON ¶
func (r *EmailRetryResponseData) UnmarshalJSON(data []byte) error
type EmailSendBatchParams ¶
type EmailSendBatchParams struct {
Emails []EmailSendBatchParamsEmail `json:"emails,omitzero,required"`
// Sender email for all messages
From string `json:"from,required"`
IdempotencyKey param.Opt[string] `header:"Idempotency-Key,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (EmailSendBatchParams) MarshalJSON ¶
func (r EmailSendBatchParams) MarshalJSON() (data []byte, err error)
func (*EmailSendBatchParams) UnmarshalJSON ¶
func (r *EmailSendBatchParams) UnmarshalJSON(data []byte) error
type EmailSendBatchParamsEmail ¶
type EmailSendBatchParamsEmail struct {
Subject string `json:"subject,required"`
To []string `json:"to,omitzero,required" format:"email"`
HTML param.Opt[string] `json:"html,omitzero"`
Tag param.Opt[string] `json:"tag,omitzero"`
Text param.Opt[string] `json:"text,omitzero"`
// Custom key-value pairs attached to an email for webhook correlation.
//
// When you send an email with metadata, these key-value pairs are:
//
// - **Stored** with the message
// - **Returned** in all webhook event payloads (MessageSent, MessageBounced, etc.)
// - **Never visible** to email recipients
//
// This is useful for correlating webhook events with your internal systems (e.g.,
// user IDs, order IDs, campaign identifiers).
Metadata map[string]string `json:"metadata,omitzero"`
// contains filtered or unexported fields
}
The properties Subject, To are required.
func (EmailSendBatchParamsEmail) MarshalJSON ¶
func (r EmailSendBatchParamsEmail) MarshalJSON() (data []byte, err error)
func (*EmailSendBatchParamsEmail) UnmarshalJSON ¶
func (r *EmailSendBatchParamsEmail) UnmarshalJSON(data []byte) error
type EmailSendBatchResponse ¶
type EmailSendBatchResponse struct {
Data EmailSendBatchResponseData `json:"data,required"`
Meta shared.APIMeta `json:"meta,required"`
Success bool `json:"success,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Meta respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (EmailSendBatchResponse) RawJSON ¶
func (r EmailSendBatchResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*EmailSendBatchResponse) UnmarshalJSON ¶
func (r *EmailSendBatchResponse) UnmarshalJSON(data []byte) error
type EmailSendBatchResponseData ¶
type EmailSendBatchResponseData struct {
// Successfully accepted emails
Accepted int64 `json:"accepted,required"`
// Failed emails
Failed int64 `json:"failed,required"`
// Map of recipient email to message info
Messages map[string]EmailSendBatchResponseDataMessage `json:"messages,required"`
// Total emails in the batch
Total int64 `json:"total,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Accepted respjson.Field
Failed respjson.Field
Messages respjson.Field
Total respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (EmailSendBatchResponseData) RawJSON ¶
func (r EmailSendBatchResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*EmailSendBatchResponseData) UnmarshalJSON ¶
func (r *EmailSendBatchResponseData) UnmarshalJSON(data []byte) error
type EmailSendBatchResponseDataMessage ¶
type EmailSendBatchResponseDataMessage struct {
// Message ID
ID string `json:"id,required"`
Token string `json:"token,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Token respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (EmailSendBatchResponseDataMessage) RawJSON ¶
func (r EmailSendBatchResponseDataMessage) RawJSON() string
Returns the unmodified JSON received from the API
func (*EmailSendBatchResponseDataMessage) UnmarshalJSON ¶
func (r *EmailSendBatchResponseDataMessage) UnmarshalJSON(data []byte) error
type EmailSendParams ¶
type EmailSendParams struct {
// Sender email address. Must be from a verified domain.
//
// **Supported formats:**
//
// - Email only: `[email protected]`
// - With display name: `Acme <[email protected]>`
// - With quoted name: `"Acme Support" <[email protected]>`
//
// The domain portion must match a verified sending domain in your account.
From string `json:"from,required"`
// Email subject line
Subject string `json:"subject,required"`
// Recipient email addresses (max 50)
To []string `json:"to,omitzero,required" format:"email"`
// HTML body content (accepts null). Maximum 5MB (5,242,880 characters). Combined
// with attachments, the total message must not exceed 14MB.
HTML param.Opt[string] `json:"html,omitzero"`
// Reply-to address (accepts null)
ReplyTo param.Opt[string] `json:"replyTo,omitzero" format:"email"`
// Tag for categorization and filtering (accepts null)
Tag param.Opt[string] `json:"tag,omitzero"`
// Plain text body (accepts null, auto-generated from HTML if not provided).
// Maximum 5MB (5,242,880 characters).
Text param.Opt[string] `json:"text,omitzero"`
IdempotencyKey param.Opt[string] `header:"Idempotency-Key,omitzero" json:"-"`
// File attachments (accepts null)
Attachments []EmailSendParamsAttachment `json:"attachments,omitzero"`
// BCC recipients (accepts null)
Bcc []string `json:"bcc,omitzero" format:"email"`
// CC recipients (accepts null)
Cc []string `json:"cc,omitzero" format:"email"`
// Custom email headers (accepts null)
Headers map[string]string `json:"headers,omitzero"`
// Custom key-value pairs attached to an email for webhook correlation.
//
// When you send an email with metadata, these key-value pairs are:
//
// - **Stored** with the message
// - **Returned** in all webhook event payloads (MessageSent, MessageBounced, etc.)
// - **Never visible** to email recipients
//
// This is useful for correlating webhook events with your internal systems (e.g.,
// user IDs, order IDs, campaign identifiers).
Metadata map[string]string `json:"metadata,omitzero"`
// contains filtered or unexported fields
}
func (EmailSendParams) MarshalJSON ¶
func (r EmailSendParams) MarshalJSON() (data []byte, err error)
func (*EmailSendParams) UnmarshalJSON ¶
func (r *EmailSendParams) UnmarshalJSON(data []byte) error
type EmailSendParamsAttachment ¶
type EmailSendParamsAttachment struct {
// Base64-encoded file content
Content string `json:"content,required"`
// MIME type
ContentType string `json:"contentType,required"`
// Attachment filename
Filename string `json:"filename,required"`
// contains filtered or unexported fields
}
The properties Content, ContentType, Filename are required.
func (EmailSendParamsAttachment) MarshalJSON ¶
func (r EmailSendParamsAttachment) MarshalJSON() (data []byte, err error)
func (*EmailSendParamsAttachment) UnmarshalJSON ¶
func (r *EmailSendParamsAttachment) UnmarshalJSON(data []byte) error
type EmailSendRawParams ¶
type EmailSendRawParams struct {
// Base64-encoded RFC 2822 message
Data string `json:"data,required"`
// Envelope sender address
MailFrom string `json:"mailFrom,required" format:"email"`
// Envelope recipient addresses
RcptTo []string `json:"rcptTo,omitzero,required" format:"email"`
// Whether this is a bounce message (accepts null)
Bounce param.Opt[bool] `json:"bounce,omitzero"`
// contains filtered or unexported fields
}
func (EmailSendRawParams) MarshalJSON ¶
func (r EmailSendRawParams) MarshalJSON() (data []byte, err error)
func (*EmailSendRawParams) UnmarshalJSON ¶
func (r *EmailSendRawParams) UnmarshalJSON(data []byte) error
type EmailSendRawResponse ¶ added in v0.3.0
type EmailSendRawResponse struct {
Data EmailSendRawResponseData `json:"data,required"`
Meta shared.APIMeta `json:"meta,required"`
Success bool `json:"success,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Meta respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (EmailSendRawResponse) RawJSON ¶ added in v0.3.0
func (r EmailSendRawResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*EmailSendRawResponse) UnmarshalJSON ¶ added in v0.3.0
func (r *EmailSendRawResponse) UnmarshalJSON(data []byte) error
type EmailSendRawResponseData ¶ added in v0.3.0
type EmailSendRawResponseData struct {
// Unique message ID (format: msg*{id}*{token})
ID string `json:"id,required"`
// Current delivery status
//
// Any of "pending", "sent".
Status string `json:"status,required"`
// List of recipient addresses
To []string `json:"to,required" format:"email"`
// SMTP Message-ID header value
MessageID string `json:"messageId"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Status respjson.Field
To respjson.Field
MessageID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (EmailSendRawResponseData) RawJSON ¶ added in v0.3.0
func (r EmailSendRawResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*EmailSendRawResponseData) UnmarshalJSON ¶ added in v0.3.0
func (r *EmailSendRawResponseData) UnmarshalJSON(data []byte) error
type EmailSendResponse ¶ added in v0.3.0
type EmailSendResponse struct {
Data EmailSendResponseData `json:"data,required"`
Meta shared.APIMeta `json:"meta,required"`
Success bool `json:"success,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Meta respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (EmailSendResponse) RawJSON ¶ added in v0.3.0
func (r EmailSendResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*EmailSendResponse) UnmarshalJSON ¶ added in v0.3.0
func (r *EmailSendResponse) UnmarshalJSON(data []byte) error
type EmailSendResponseData ¶ added in v0.3.0
type EmailSendResponseData struct {
// Unique message ID (format: msg*{id}*{token})
ID string `json:"id,required"`
// Current delivery status
//
// Any of "pending", "sent".
Status string `json:"status,required"`
// List of recipient addresses
To []string `json:"to,required" format:"email"`
// SMTP Message-ID header value
MessageID string `json:"messageId"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Status respjson.Field
To respjson.Field
MessageID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (EmailSendResponseData) RawJSON ¶ added in v0.3.0
func (r EmailSendResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*EmailSendResponseData) UnmarshalJSON ¶ added in v0.3.0
func (r *EmailSendResponseData) UnmarshalJSON(data []byte) error
type EmailService ¶
type EmailService struct {
Options []option.RequestOption
}
EmailService contains methods and other services that help with interacting with the ark API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewEmailService method instead.
func NewEmailService ¶
func NewEmailService(opts ...option.RequestOption) (r EmailService)
NewEmailService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*EmailService) Get ¶
func (r *EmailService) Get(ctx context.Context, emailID string, query EmailGetParams, opts ...option.RequestOption) (res *EmailGetResponse, err error)
Retrieve detailed information about a specific email including delivery status, timestamps, and optionally the email content.
Use the `expand` parameter to include additional data like the HTML/text body, headers, or delivery attempts.
func (*EmailService) GetDeliveries ¶
func (r *EmailService) GetDeliveries(ctx context.Context, emailID string, opts ...option.RequestOption) (res *EmailGetDeliveriesResponse, err error)
Get the history of delivery attempts for an email, including SMTP response codes and timestamps.
func (*EmailService) List ¶
func (r *EmailService) List(ctx context.Context, query EmailListParams, opts ...option.RequestOption) (res *pagination.PageNumberPagination[EmailListResponse], err error)
Retrieve a paginated list of sent emails. Results are ordered by send time, newest first.
Use filters to narrow down results by status, recipient, sender, or tag.
**Related endpoints:**
- `GET /emails/{id}` - Get full details of a specific email - `POST /emails` - Send a new email
func (*EmailService) ListAutoPaging ¶ added in v0.4.0
func (r *EmailService) ListAutoPaging(ctx context.Context, query EmailListParams, opts ...option.RequestOption) *pagination.PageNumberPaginationAutoPager[EmailListResponse]
Retrieve a paginated list of sent emails. Results are ordered by send time, newest first.
Use filters to narrow down results by status, recipient, sender, or tag.
**Related endpoints:**
- `GET /emails/{id}` - Get full details of a specific email - `POST /emails` - Send a new email
func (*EmailService) Retry ¶
func (r *EmailService) Retry(ctx context.Context, emailID string, opts ...option.RequestOption) (res *EmailRetryResponse, err error)
Retry delivery of a failed or soft-bounced email. Creates a new delivery attempt.
Only works for emails that have failed or are in a retryable state.
func (*EmailService) Send ¶
func (r *EmailService) Send(ctx context.Context, params EmailSendParams, opts ...option.RequestOption) (res *EmailSendResponse, err error)
Send a single email message. The email is accepted for immediate delivery and typically delivered within seconds.
**Example use case:** Send a password reset email to a user.
**Required fields:** `from`, `to`, `subject`, and either `html` or `text`
**Idempotency:** Supports `Idempotency-Key` header for safe retries.
**Related endpoints:**
- `GET /emails/{id}` - Track delivery status - `GET /emails/{id}/deliveries` - View delivery attempts - `POST /emails/{id}/retry` - Retry failed delivery
func (*EmailService) SendBatch ¶
func (r *EmailService) SendBatch(ctx context.Context, params EmailSendBatchParams, opts ...option.RequestOption) (res *EmailSendBatchResponse, err error)
Send up to 100 emails in a single request. Useful for sending personalized emails to multiple recipients efficiently.
Each email in the batch can have different content and recipients. Failed emails don't affect other emails in the batch.
**Idempotency:** Supports `Idempotency-Key` header for safe retries.
func (*EmailService) SendRaw ¶
func (r *EmailService) SendRaw(ctx context.Context, body EmailSendRawParams, opts ...option.RequestOption) (res *EmailSendRawResponse, err error)
Send a pre-formatted RFC 2822 MIME message. Use this for advanced use cases or when migrating from systems that generate raw email content.
The `data` field should contain the base64-encoded raw email.
type SuppressionBulkNewParams ¶
type SuppressionBulkNewParams struct {
Suppressions []SuppressionBulkNewParamsSuppression `json:"suppressions,omitzero,required"`
// contains filtered or unexported fields
}
func (SuppressionBulkNewParams) MarshalJSON ¶
func (r SuppressionBulkNewParams) MarshalJSON() (data []byte, err error)
func (*SuppressionBulkNewParams) UnmarshalJSON ¶
func (r *SuppressionBulkNewParams) UnmarshalJSON(data []byte) error
type SuppressionBulkNewParamsSuppression ¶
type SuppressionBulkNewParamsSuppression struct {
Address string `json:"address,required" format:"email"`
// Reason for suppression (accepts null)
Reason param.Opt[string] `json:"reason,omitzero"`
// contains filtered or unexported fields
}
The property Address is required.
func (SuppressionBulkNewParamsSuppression) MarshalJSON ¶
func (r SuppressionBulkNewParamsSuppression) MarshalJSON() (data []byte, err error)
func (*SuppressionBulkNewParamsSuppression) UnmarshalJSON ¶
func (r *SuppressionBulkNewParamsSuppression) UnmarshalJSON(data []byte) error
type SuppressionBulkNewResponse ¶
type SuppressionBulkNewResponse struct {
Data SuppressionBulkNewResponseData `json:"data,required"`
Meta shared.APIMeta `json:"meta,required"`
Success bool `json:"success,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Meta respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SuppressionBulkNewResponse) RawJSON ¶
func (r SuppressionBulkNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SuppressionBulkNewResponse) UnmarshalJSON ¶
func (r *SuppressionBulkNewResponse) UnmarshalJSON(data []byte) error
type SuppressionBulkNewResponseData ¶
type SuppressionBulkNewResponseData struct {
// Newly suppressed addresses
Added int64 `json:"added,required"`
// Invalid addresses skipped
Failed int64 `json:"failed,required"`
// Total addresses in request
TotalRequested int64 `json:"totalRequested,required"`
// Already suppressed addresses (updated reason)
Updated int64 `json:"updated,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Added respjson.Field
Failed respjson.Field
TotalRequested respjson.Field
Updated respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SuppressionBulkNewResponseData) RawJSON ¶
func (r SuppressionBulkNewResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*SuppressionBulkNewResponseData) UnmarshalJSON ¶
func (r *SuppressionBulkNewResponseData) UnmarshalJSON(data []byte) error
type SuppressionDeleteResponse ¶ added in v0.3.0
type SuppressionDeleteResponse struct {
Data SuppressionDeleteResponseData `json:"data,required"`
Meta shared.APIMeta `json:"meta,required"`
Success bool `json:"success,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Meta respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SuppressionDeleteResponse) RawJSON ¶ added in v0.3.0
func (r SuppressionDeleteResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SuppressionDeleteResponse) UnmarshalJSON ¶ added in v0.3.0
func (r *SuppressionDeleteResponse) UnmarshalJSON(data []byte) error
type SuppressionDeleteResponseData ¶ added in v0.3.0
type SuppressionDeleteResponseData struct {
Message string `json:"message,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SuppressionDeleteResponseData) RawJSON ¶ added in v0.3.0
func (r SuppressionDeleteResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*SuppressionDeleteResponseData) UnmarshalJSON ¶ added in v0.3.0
func (r *SuppressionDeleteResponseData) UnmarshalJSON(data []byte) error
type SuppressionGetResponse ¶
type SuppressionGetResponse struct {
Data SuppressionGetResponseData `json:"data,required"`
Meta shared.APIMeta `json:"meta,required"`
Success bool `json:"success,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Meta respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SuppressionGetResponse) RawJSON ¶
func (r SuppressionGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SuppressionGetResponse) UnmarshalJSON ¶
func (r *SuppressionGetResponse) UnmarshalJSON(data []byte) error
type SuppressionGetResponseData ¶
type SuppressionGetResponseData struct {
// The email address that was checked
Address string `json:"address,required" format:"email"`
// Whether the address is currently suppressed
Suppressed bool `json:"suppressed,required"`
// When the suppression was created (if suppressed)
CreatedAt time.Time `json:"createdAt,nullable" format:"date-time"`
// Reason for suppression (if suppressed)
Reason string `json:"reason,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Address respjson.Field
Suppressed respjson.Field
CreatedAt respjson.Field
Reason respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SuppressionGetResponseData) RawJSON ¶
func (r SuppressionGetResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*SuppressionGetResponseData) UnmarshalJSON ¶
func (r *SuppressionGetResponseData) UnmarshalJSON(data []byte) error
type SuppressionListParams ¶
type SuppressionListParams struct {
Page param.Opt[int64] `query:"page,omitzero" json:"-"`
PerPage param.Opt[int64] `query:"perPage,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (SuppressionListParams) URLQuery ¶
func (r SuppressionListParams) URLQuery() (v url.Values, err error)
URLQuery serializes SuppressionListParams's query parameters as `url.Values`.
type SuppressionListResponse ¶
type SuppressionListResponse struct {
// Suppression ID
ID string `json:"id,required"`
Address string `json:"address,required" format:"email"`
CreatedAt time.Time `json:"createdAt,required" format:"date-time"`
Reason string `json:"reason"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Address respjson.Field
CreatedAt respjson.Field
Reason respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SuppressionListResponse) RawJSON ¶
func (r SuppressionListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SuppressionListResponse) UnmarshalJSON ¶
func (r *SuppressionListResponse) UnmarshalJSON(data []byte) error
type SuppressionNewParams ¶
type SuppressionNewParams struct {
// Email address to suppress
Address string `json:"address,required" format:"email"`
// Reason for suppression (accepts null)
Reason param.Opt[string] `json:"reason,omitzero"`
// contains filtered or unexported fields
}
func (SuppressionNewParams) MarshalJSON ¶
func (r SuppressionNewParams) MarshalJSON() (data []byte, err error)
func (*SuppressionNewParams) UnmarshalJSON ¶
func (r *SuppressionNewParams) UnmarshalJSON(data []byte) error
type SuppressionNewResponse ¶
type SuppressionNewResponse struct {
Data SuppressionNewResponseData `json:"data,required"`
Meta shared.APIMeta `json:"meta,required"`
Success bool `json:"success,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Meta respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SuppressionNewResponse) RawJSON ¶
func (r SuppressionNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SuppressionNewResponse) UnmarshalJSON ¶
func (r *SuppressionNewResponse) UnmarshalJSON(data []byte) error
type SuppressionNewResponseData ¶
type SuppressionNewResponseData struct {
// Suppression ID
ID string `json:"id,required"`
Address string `json:"address,required" format:"email"`
CreatedAt time.Time `json:"createdAt,required" format:"date-time"`
// Reason for suppression
Reason string `json:"reason"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Address respjson.Field
CreatedAt respjson.Field
Reason respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SuppressionNewResponseData) RawJSON ¶
func (r SuppressionNewResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*SuppressionNewResponseData) UnmarshalJSON ¶
func (r *SuppressionNewResponseData) UnmarshalJSON(data []byte) error
type SuppressionService ¶
type SuppressionService struct {
Options []option.RequestOption
}
SuppressionService contains methods and other services that help with interacting with the ark API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSuppressionService method instead.
func NewSuppressionService ¶
func NewSuppressionService(opts ...option.RequestOption) (r SuppressionService)
NewSuppressionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*SuppressionService) BulkNew ¶
func (r *SuppressionService) BulkNew(ctx context.Context, body SuppressionBulkNewParams, opts ...option.RequestOption) (res *SuppressionBulkNewResponse, err error)
Add up to 1000 email addresses to the suppression list at once
func (*SuppressionService) Delete ¶
func (r *SuppressionService) Delete(ctx context.Context, email string, opts ...option.RequestOption) (res *SuppressionDeleteResponse, err error)
Remove an email address from the suppression list. The address will be able to receive emails again.
func (*SuppressionService) Get ¶
func (r *SuppressionService) Get(ctx context.Context, email string, opts ...option.RequestOption) (res *SuppressionGetResponse, err error)
Check if a specific email address is on the suppression list
func (*SuppressionService) List ¶
func (r *SuppressionService) List(ctx context.Context, query SuppressionListParams, opts ...option.RequestOption) (res *pagination.PageNumberPagination[SuppressionListResponse], err error)
Get all email addresses on the suppression list. These addresses will not receive any emails.
func (*SuppressionService) ListAutoPaging ¶ added in v0.4.0
func (r *SuppressionService) ListAutoPaging(ctx context.Context, query SuppressionListParams, opts ...option.RequestOption) *pagination.PageNumberPaginationAutoPager[SuppressionListResponse]
Get all email addresses on the suppression list. These addresses will not receive any emails.
func (*SuppressionService) New ¶
func (r *SuppressionService) New(ctx context.Context, body SuppressionNewParams, opts ...option.RequestOption) (res *SuppressionNewResponse, err error)
Add an email address to the suppression list. The address will not receive any emails until removed.
type TrackDomain ¶
type TrackDomain struct {
// Track domain ID
ID string `json:"id,required"`
// When the track domain was created
CreatedAt time.Time `json:"createdAt,required" format:"date-time"`
// Whether DNS is correctly configured
DNSOk bool `json:"dnsOk,required"`
// ID of the parent sending domain
DomainID string `json:"domainId,required"`
// Full domain name
FullName string `json:"fullName,required"`
// Subdomain name
Name string `json:"name,required"`
// Whether SSL is enabled for tracking URLs
SslEnabled bool `json:"sslEnabled,required"`
// Whether click tracking is enabled
TrackClicks bool `json:"trackClicks,required"`
// Whether open tracking is enabled
TrackOpens bool `json:"trackOpens,required"`
// When DNS was last checked
DNSCheckedAt time.Time `json:"dnsCheckedAt,nullable" format:"date-time"`
// DNS error message if verification failed
DNSError string `json:"dnsError,nullable"`
// Required DNS record configuration
DNSRecord TrackDomainDNSRecord `json:"dnsRecord,nullable"`
// Current DNS verification status
//
// Any of "ok", "missing", "invalid".
DNSStatus TrackDomainDNSStatus `json:"dnsStatus,nullable"`
// Domains excluded from click tracking
ExcludedClickDomains string `json:"excludedClickDomains,nullable"`
// When the track domain was last updated
UpdatedAt time.Time `json:"updatedAt,nullable" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
DNSOk respjson.Field
DomainID respjson.Field
FullName respjson.Field
Name respjson.Field
SslEnabled respjson.Field
TrackClicks respjson.Field
TrackOpens respjson.Field
DNSCheckedAt respjson.Field
DNSError respjson.Field
DNSRecord respjson.Field
DNSStatus respjson.Field
ExcludedClickDomains respjson.Field
UpdatedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TrackDomain) RawJSON ¶
func (r TrackDomain) RawJSON() string
Returns the unmodified JSON received from the API
func (*TrackDomain) UnmarshalJSON ¶
func (r *TrackDomain) UnmarshalJSON(data []byte) error
type TrackDomainDNSRecord ¶
type TrackDomainDNSRecord struct {
// DNS record name
Name string `json:"name"`
// DNS record type
Type string `json:"type"`
// DNS record value (target)
Value string `json:"value"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Name respjson.Field
Type respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Required DNS record configuration
func (TrackDomainDNSRecord) RawJSON ¶
func (r TrackDomainDNSRecord) RawJSON() string
Returns the unmodified JSON received from the API
func (*TrackDomainDNSRecord) UnmarshalJSON ¶
func (r *TrackDomainDNSRecord) UnmarshalJSON(data []byte) error
type TrackDomainDNSStatus ¶
type TrackDomainDNSStatus string
Current DNS verification status
const ( TrackDomainDNSStatusOk TrackDomainDNSStatus = "ok" TrackDomainDNSStatusMissing TrackDomainDNSStatus = "missing" TrackDomainDNSStatusInvalid TrackDomainDNSStatus = "invalid" )
type TrackingDeleteResponse ¶ added in v0.3.0
type TrackingDeleteResponse struct {
Data TrackingDeleteResponseData `json:"data,required"`
Meta shared.APIMeta `json:"meta,required"`
Success bool `json:"success,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Meta respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TrackingDeleteResponse) RawJSON ¶ added in v0.3.0
func (r TrackingDeleteResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*TrackingDeleteResponse) UnmarshalJSON ¶ added in v0.3.0
func (r *TrackingDeleteResponse) UnmarshalJSON(data []byte) error
type TrackingDeleteResponseData ¶ added in v0.3.0
type TrackingDeleteResponseData struct {
Message string `json:"message,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TrackingDeleteResponseData) RawJSON ¶ added in v0.3.0
func (r TrackingDeleteResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*TrackingDeleteResponseData) UnmarshalJSON ¶ added in v0.3.0
func (r *TrackingDeleteResponseData) UnmarshalJSON(data []byte) error
type TrackingGetResponse ¶ added in v0.3.0
type TrackingGetResponse struct {
Data TrackDomain `json:"data,required"`
Meta shared.APIMeta `json:"meta,required"`
Success bool `json:"success,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Meta respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TrackingGetResponse) RawJSON ¶ added in v0.3.0
func (r TrackingGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*TrackingGetResponse) UnmarshalJSON ¶ added in v0.3.0
func (r *TrackingGetResponse) UnmarshalJSON(data []byte) error
type TrackingListResponse ¶
type TrackingListResponse struct {
Data TrackingListResponseData `json:"data,required"`
Meta shared.APIMeta `json:"meta,required"`
Success bool `json:"success,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Meta respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TrackingListResponse) RawJSON ¶
func (r TrackingListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*TrackingListResponse) UnmarshalJSON ¶
func (r *TrackingListResponse) UnmarshalJSON(data []byte) error
type TrackingListResponseData ¶
type TrackingListResponseData struct {
TrackDomains []TrackDomain `json:"trackDomains,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
TrackDomains respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TrackingListResponseData) RawJSON ¶
func (r TrackingListResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*TrackingListResponseData) UnmarshalJSON ¶
func (r *TrackingListResponseData) UnmarshalJSON(data []byte) error
type TrackingNewParams ¶
type TrackingNewParams struct {
// ID of the sending domain to attach this track domain to
DomainID int64 `json:"domainId,required"`
// Subdomain name (e.g., 'track' for track.yourdomain.com)
Name string `json:"name,required"`
// Enable SSL for tracking URLs (accepts null, defaults to true)
SslEnabled param.Opt[bool] `json:"sslEnabled,omitzero"`
// Enable click tracking (accepts null, defaults to true)
TrackClicks param.Opt[bool] `json:"trackClicks,omitzero"`
// Enable open tracking (tracking pixel, accepts null, defaults to true)
TrackOpens param.Opt[bool] `json:"trackOpens,omitzero"`
// contains filtered or unexported fields
}
func (TrackingNewParams) MarshalJSON ¶
func (r TrackingNewParams) MarshalJSON() (data []byte, err error)
func (*TrackingNewParams) UnmarshalJSON ¶
func (r *TrackingNewParams) UnmarshalJSON(data []byte) error
type TrackingNewResponse ¶ added in v0.3.0
type TrackingNewResponse struct {
Data TrackDomain `json:"data,required"`
Meta shared.APIMeta `json:"meta,required"`
Success bool `json:"success,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Meta respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TrackingNewResponse) RawJSON ¶ added in v0.3.0
func (r TrackingNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*TrackingNewResponse) UnmarshalJSON ¶ added in v0.3.0
func (r *TrackingNewResponse) UnmarshalJSON(data []byte) error
type TrackingService ¶
type TrackingService struct {
Options []option.RequestOption
}
TrackingService contains methods and other services that help with interacting with the ark API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewTrackingService method instead.
func NewTrackingService ¶
func NewTrackingService(opts ...option.RequestOption) (r TrackingService)
NewTrackingService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*TrackingService) Delete ¶
func (r *TrackingService) Delete(ctx context.Context, trackingID string, opts ...option.RequestOption) (res *TrackingDeleteResponse, err error)
Delete a track domain. This will disable tracking for any emails using this domain.
func (*TrackingService) Get ¶
func (r *TrackingService) Get(ctx context.Context, trackingID string, opts ...option.RequestOption) (res *TrackingGetResponse, err error)
Get details of a specific track domain including DNS configuration
func (*TrackingService) List ¶
func (r *TrackingService) List(ctx context.Context, opts ...option.RequestOption) (res *TrackingListResponse, err error)
List all track domains configured for your server. Track domains enable open and click tracking for your emails.
func (*TrackingService) New ¶
func (r *TrackingService) New(ctx context.Context, body TrackingNewParams, opts ...option.RequestOption) (res *TrackingNewResponse, err error)
Create a new track domain for open/click tracking.
After creation, you must configure a CNAME record pointing to the provided DNS value before tracking will work.
func (*TrackingService) Update ¶
func (r *TrackingService) Update(ctx context.Context, trackingID string, body TrackingUpdateParams, opts ...option.RequestOption) (res *TrackingUpdateResponse, err error)
Update track domain settings.
Use this to:
- Enable/disable click tracking - Enable/disable open tracking - Enable/disable SSL - Set excluded click domains
func (*TrackingService) Verify ¶
func (r *TrackingService) Verify(ctx context.Context, trackingID string, opts ...option.RequestOption) (res *TrackingVerifyResponse, err error)
Check DNS configuration for the track domain.
The track domain requires a CNAME record to be configured before open and click tracking will work. Use this endpoint to verify the DNS is correctly set up.
type TrackingUpdateParams ¶
type TrackingUpdateParams struct {
// Comma-separated list of domains to exclude from click tracking (accepts null)
ExcludedClickDomains param.Opt[string] `json:"excludedClickDomains,omitzero"`
// Enable or disable SSL for tracking URLs (accepts null)
SslEnabled param.Opt[bool] `json:"sslEnabled,omitzero"`
// Enable or disable click tracking (accepts null)
TrackClicks param.Opt[bool] `json:"trackClicks,omitzero"`
// Enable or disable open tracking (accepts null)
TrackOpens param.Opt[bool] `json:"trackOpens,omitzero"`
// contains filtered or unexported fields
}
func (TrackingUpdateParams) MarshalJSON ¶
func (r TrackingUpdateParams) MarshalJSON() (data []byte, err error)
func (*TrackingUpdateParams) UnmarshalJSON ¶
func (r *TrackingUpdateParams) UnmarshalJSON(data []byte) error
type TrackingUpdateResponse ¶ added in v0.3.0
type TrackingUpdateResponse struct {
Data TrackDomain `json:"data,required"`
Meta shared.APIMeta `json:"meta,required"`
Success bool `json:"success,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Meta respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TrackingUpdateResponse) RawJSON ¶ added in v0.3.0
func (r TrackingUpdateResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*TrackingUpdateResponse) UnmarshalJSON ¶ added in v0.3.0
func (r *TrackingUpdateResponse) UnmarshalJSON(data []byte) error
type TrackingVerifyResponse ¶
type TrackingVerifyResponse struct {
Data TrackingVerifyResponseData `json:"data,required"`
Meta shared.APIMeta `json:"meta,required"`
Success bool `json:"success,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Meta respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TrackingVerifyResponse) RawJSON ¶
func (r TrackingVerifyResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*TrackingVerifyResponse) UnmarshalJSON ¶
func (r *TrackingVerifyResponse) UnmarshalJSON(data []byte) error
type TrackingVerifyResponseData ¶
type TrackingVerifyResponseData struct {
// Track domain ID
ID string `json:"id,required"`
// Whether DNS is correctly configured
DNSOk bool `json:"dnsOk,required"`
// Current DNS verification status
//
// Any of "ok", "missing", "invalid".
DNSStatus string `json:"dnsStatus,required"`
// Full domain name
FullName string `json:"fullName,required"`
// When DNS was last checked
DNSCheckedAt time.Time `json:"dnsCheckedAt,nullable" format:"date-time"`
// DNS error message if verification failed
DNSError string `json:"dnsError,nullable"`
// Required DNS record configuration
DNSRecord TrackingVerifyResponseDataDNSRecord `json:"dnsRecord,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
DNSOk respjson.Field
DNSStatus respjson.Field
FullName respjson.Field
DNSCheckedAt respjson.Field
DNSError respjson.Field
DNSRecord respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TrackingVerifyResponseData) RawJSON ¶
func (r TrackingVerifyResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*TrackingVerifyResponseData) UnmarshalJSON ¶
func (r *TrackingVerifyResponseData) UnmarshalJSON(data []byte) error
type TrackingVerifyResponseDataDNSRecord ¶
type TrackingVerifyResponseDataDNSRecord struct {
Name string `json:"name"`
Type string `json:"type"`
Value string `json:"value"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Name respjson.Field
Type respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Required DNS record configuration
func (TrackingVerifyResponseDataDNSRecord) RawJSON ¶
func (r TrackingVerifyResponseDataDNSRecord) RawJSON() string
Returns the unmodified JSON received from the API
func (*TrackingVerifyResponseDataDNSRecord) UnmarshalJSON ¶
func (r *TrackingVerifyResponseDataDNSRecord) UnmarshalJSON(data []byte) error
type WebhookDeleteResponse ¶ added in v0.3.0
type WebhookDeleteResponse struct {
Data WebhookDeleteResponseData `json:"data,required"`
Meta shared.APIMeta `json:"meta,required"`
Success bool `json:"success,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Meta respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WebhookDeleteResponse) RawJSON ¶ added in v0.3.0
func (r WebhookDeleteResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebhookDeleteResponse) UnmarshalJSON ¶ added in v0.3.0
func (r *WebhookDeleteResponse) UnmarshalJSON(data []byte) error
type WebhookDeleteResponseData ¶ added in v0.3.0
type WebhookDeleteResponseData struct {
Message string `json:"message,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WebhookDeleteResponseData) RawJSON ¶ added in v0.3.0
func (r WebhookDeleteResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebhookDeleteResponseData) UnmarshalJSON ¶ added in v0.3.0
func (r *WebhookDeleteResponseData) UnmarshalJSON(data []byte) error
type WebhookGetResponse ¶ added in v0.3.0
type WebhookGetResponse struct {
Data WebhookGetResponseData `json:"data,required"`
Meta shared.APIMeta `json:"meta,required"`
Success bool `json:"success,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Meta respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WebhookGetResponse) RawJSON ¶ added in v0.3.0
func (r WebhookGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebhookGetResponse) UnmarshalJSON ¶ added in v0.3.0
func (r *WebhookGetResponse) UnmarshalJSON(data []byte) error
type WebhookGetResponseData ¶ added in v0.3.0
type WebhookGetResponseData struct {
// Webhook ID
ID string `json:"id,required"`
// Whether subscribed to all events
AllEvents bool `json:"allEvents,required"`
CreatedAt time.Time `json:"createdAt,required" format:"date-time"`
// Whether the webhook is active
Enabled bool `json:"enabled,required"`
// Subscribed events
//
// Any of "MessageSent", "MessageDelayed", "MessageDeliveryFailed", "MessageHeld",
// "MessageBounced", "MessageLinkClicked", "MessageLoaded", "DomainDNSError".
Events []string `json:"events,required"`
// Webhook name for identification
Name string `json:"name,required"`
// Webhook endpoint URL
URL string `json:"url,required" format:"uri"`
Uuid string `json:"uuid,required" format:"uuid"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AllEvents respjson.Field
CreatedAt respjson.Field
Enabled respjson.Field
Events respjson.Field
Name respjson.Field
URL respjson.Field
Uuid respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WebhookGetResponseData) RawJSON ¶ added in v0.3.0
func (r WebhookGetResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebhookGetResponseData) UnmarshalJSON ¶ added in v0.3.0
func (r *WebhookGetResponseData) UnmarshalJSON(data []byte) error
type WebhookListResponse ¶
type WebhookListResponse struct {
Data WebhookListResponseData `json:"data,required"`
Meta shared.APIMeta `json:"meta,required"`
Success bool `json:"success,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Meta respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WebhookListResponse) RawJSON ¶
func (r WebhookListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebhookListResponse) UnmarshalJSON ¶
func (r *WebhookListResponse) UnmarshalJSON(data []byte) error
type WebhookListResponseData ¶
type WebhookListResponseData struct {
Webhooks []WebhookListResponseDataWebhook `json:"webhooks,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Webhooks respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WebhookListResponseData) RawJSON ¶
func (r WebhookListResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebhookListResponseData) UnmarshalJSON ¶
func (r *WebhookListResponseData) UnmarshalJSON(data []byte) error
type WebhookListResponseDataWebhook ¶
type WebhookListResponseDataWebhook struct {
// Webhook ID
ID string `json:"id,required"`
Enabled bool `json:"enabled,required"`
Events []string `json:"events,required"`
Name string `json:"name,required"`
URL string `json:"url,required" format:"uri"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Enabled respjson.Field
Events respjson.Field
Name respjson.Field
URL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WebhookListResponseDataWebhook) RawJSON ¶
func (r WebhookListResponseDataWebhook) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebhookListResponseDataWebhook) UnmarshalJSON ¶
func (r *WebhookListResponseDataWebhook) UnmarshalJSON(data []byte) error
type WebhookNewParams ¶
type WebhookNewParams struct {
// Webhook name for identification
Name string `json:"name,required"`
// HTTPS endpoint URL
URL string `json:"url,required" format:"uri"`
// Subscribe to all events (ignores events array, accepts null)
AllEvents param.Opt[bool] `json:"allEvents,omitzero"`
// Whether the webhook is enabled (accepts null)
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// Events to subscribe to (accepts null):
//
// - `MessageSent` - Email successfully delivered to recipient's server
// - `MessageDelayed` - Temporary delivery failure, will retry
// - `MessageDeliveryFailed` - Permanent delivery failure
// - `MessageHeld` - Email held for manual review
// - `MessageBounced` - Email bounced back
// - `MessageLinkClicked` - Recipient clicked a tracked link
// - `MessageLoaded` - Recipient opened the email (tracking pixel loaded)
// - `DomainDNSError` - DNS configuration issue detected
//
// Any of "MessageSent", "MessageDelayed", "MessageDeliveryFailed", "MessageHeld",
// "MessageBounced", "MessageLinkClicked", "MessageLoaded", "DomainDNSError".
Events []string `json:"events,omitzero"`
// contains filtered or unexported fields
}
func (WebhookNewParams) MarshalJSON ¶
func (r WebhookNewParams) MarshalJSON() (data []byte, err error)
func (*WebhookNewParams) UnmarshalJSON ¶
func (r *WebhookNewParams) UnmarshalJSON(data []byte) error
type WebhookNewResponse ¶ added in v0.3.0
type WebhookNewResponse struct {
Data WebhookNewResponseData `json:"data,required"`
Meta shared.APIMeta `json:"meta,required"`
Success bool `json:"success,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Meta respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WebhookNewResponse) RawJSON ¶ added in v0.3.0
func (r WebhookNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebhookNewResponse) UnmarshalJSON ¶ added in v0.3.0
func (r *WebhookNewResponse) UnmarshalJSON(data []byte) error
type WebhookNewResponseData ¶ added in v0.3.0
type WebhookNewResponseData struct {
// Webhook ID
ID string `json:"id,required"`
// Whether subscribed to all events
AllEvents bool `json:"allEvents,required"`
CreatedAt time.Time `json:"createdAt,required" format:"date-time"`
// Whether the webhook is active
Enabled bool `json:"enabled,required"`
// Subscribed events
//
// Any of "MessageSent", "MessageDelayed", "MessageDeliveryFailed", "MessageHeld",
// "MessageBounced", "MessageLinkClicked", "MessageLoaded", "DomainDNSError".
Events []string `json:"events,required"`
// Webhook name for identification
Name string `json:"name,required"`
// Webhook endpoint URL
URL string `json:"url,required" format:"uri"`
Uuid string `json:"uuid,required" format:"uuid"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AllEvents respjson.Field
CreatedAt respjson.Field
Enabled respjson.Field
Events respjson.Field
Name respjson.Field
URL respjson.Field
Uuid respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WebhookNewResponseData) RawJSON ¶ added in v0.3.0
func (r WebhookNewResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebhookNewResponseData) UnmarshalJSON ¶ added in v0.3.0
func (r *WebhookNewResponseData) UnmarshalJSON(data []byte) error
type WebhookService ¶
type WebhookService struct {
Options []option.RequestOption
}
WebhookService contains methods and other services that help with interacting with the ark API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewWebhookService method instead.
func NewWebhookService ¶
func NewWebhookService(opts ...option.RequestOption) (r WebhookService)
NewWebhookService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*WebhookService) Delete ¶
func (r *WebhookService) Delete(ctx context.Context, webhookID string, opts ...option.RequestOption) (res *WebhookDeleteResponse, err error)
Delete a webhook
func (*WebhookService) Get ¶
func (r *WebhookService) Get(ctx context.Context, webhookID string, opts ...option.RequestOption) (res *WebhookGetResponse, err error)
Get webhook details
func (*WebhookService) List ¶
func (r *WebhookService) List(ctx context.Context, opts ...option.RequestOption) (res *WebhookListResponse, err error)
Get all configured webhook endpoints
func (*WebhookService) New ¶
func (r *WebhookService) New(ctx context.Context, body WebhookNewParams, opts ...option.RequestOption) (res *WebhookNewResponse, err error)
Create a webhook endpoint to receive email event notifications.
**Available events:**
- `MessageSent` - Email accepted by recipient server - `MessageDeliveryFailed` - Delivery permanently failed - `MessageDelayed` - Delivery temporarily failed, will retry - `MessageBounced` - Email bounced - `MessageHeld` - Email held for review - `MessageLinkClicked` - Recipient clicked a link - `MessageLoaded` - Recipient opened the email - `DomainDNSError` - Domain DNS issue detected
func (*WebhookService) Test ¶
func (r *WebhookService) Test(ctx context.Context, webhookID string, body WebhookTestParams, opts ...option.RequestOption) (res *WebhookTestResponse, err error)
Send a test payload to your webhook endpoint and verify it receives the data correctly.
Use this to:
- Verify your webhook URL is accessible - Test your signature verification code - Ensure your server handles the payload format correctly
**Test payload format:** The test payload is identical to real webhook payloads, containing sample data for the specified event type. Your webhook should respond with a 2xx status code.
func (*WebhookService) Update ¶
func (r *WebhookService) Update(ctx context.Context, webhookID string, body WebhookUpdateParams, opts ...option.RequestOption) (res *WebhookUpdateResponse, err error)
Update a webhook
type WebhookTestParams ¶
type WebhookTestParams struct {
// Event type to simulate
//
// Any of "MessageSent", "MessageDelayed", "MessageDeliveryFailed", "MessageHeld",
// "MessageBounced", "MessageLinkClicked", "MessageLoaded", "DomainDNSError".
Event WebhookTestParamsEvent `json:"event,omitzero,required"`
// contains filtered or unexported fields
}
func (WebhookTestParams) MarshalJSON ¶
func (r WebhookTestParams) MarshalJSON() (data []byte, err error)
func (*WebhookTestParams) UnmarshalJSON ¶
func (r *WebhookTestParams) UnmarshalJSON(data []byte) error
type WebhookTestParamsEvent ¶
type WebhookTestParamsEvent string
Event type to simulate
const ( WebhookTestParamsEventMessageSent WebhookTestParamsEvent = "MessageSent" WebhookTestParamsEventMessageDelayed WebhookTestParamsEvent = "MessageDelayed" WebhookTestParamsEventMessageDeliveryFailed WebhookTestParamsEvent = "MessageDeliveryFailed" WebhookTestParamsEventMessageHeld WebhookTestParamsEvent = "MessageHeld" WebhookTestParamsEventMessageBounced WebhookTestParamsEvent = "MessageBounced" WebhookTestParamsEventMessageLinkClicked WebhookTestParamsEvent = "MessageLinkClicked" WebhookTestParamsEventMessageLoaded WebhookTestParamsEvent = "MessageLoaded" WebhookTestParamsEventDomainDNSError WebhookTestParamsEvent = "DomainDNSError" )
type WebhookTestResponse ¶
type WebhookTestResponse struct {
Data WebhookTestResponseData `json:"data,required"`
Meta shared.APIMeta `json:"meta,required"`
Success bool `json:"success,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Meta respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WebhookTestResponse) RawJSON ¶
func (r WebhookTestResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebhookTestResponse) UnmarshalJSON ¶
func (r *WebhookTestResponse) UnmarshalJSON(data []byte) error
type WebhookTestResponseData ¶
type WebhookTestResponseData struct {
// Request duration in milliseconds
Duration int64 `json:"duration,required"`
// Event type that was tested
Event string `json:"event,required"`
// HTTP status code from the webhook endpoint
StatusCode int64 `json:"statusCode,required"`
// Whether the webhook endpoint responded with a 2xx status
Success bool `json:"success,required"`
// Response body from the webhook endpoint (truncated if too long)
Body string `json:"body,nullable"`
// Error message if the request failed
Error string `json:"error,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Duration respjson.Field
Event respjson.Field
StatusCode respjson.Field
Success respjson.Field
Body respjson.Field
Error respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WebhookTestResponseData) RawJSON ¶
func (r WebhookTestResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebhookTestResponseData) UnmarshalJSON ¶
func (r *WebhookTestResponseData) UnmarshalJSON(data []byte) error
type WebhookUpdateParams ¶
type WebhookUpdateParams struct {
AllEvents param.Opt[bool] `json:"allEvents,omitzero"`
Enabled param.Opt[bool] `json:"enabled,omitzero"`
Name param.Opt[string] `json:"name,omitzero"`
URL param.Opt[string] `json:"url,omitzero" format:"uri"`
Events []string `json:"events,omitzero"`
// contains filtered or unexported fields
}
func (WebhookUpdateParams) MarshalJSON ¶
func (r WebhookUpdateParams) MarshalJSON() (data []byte, err error)
func (*WebhookUpdateParams) UnmarshalJSON ¶
func (r *WebhookUpdateParams) UnmarshalJSON(data []byte) error
type WebhookUpdateResponse ¶ added in v0.3.0
type WebhookUpdateResponse struct {
Data WebhookUpdateResponseData `json:"data,required"`
Meta shared.APIMeta `json:"meta,required"`
Success bool `json:"success,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Meta respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WebhookUpdateResponse) RawJSON ¶ added in v0.3.0
func (r WebhookUpdateResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebhookUpdateResponse) UnmarshalJSON ¶ added in v0.3.0
func (r *WebhookUpdateResponse) UnmarshalJSON(data []byte) error
type WebhookUpdateResponseData ¶ added in v0.3.0
type WebhookUpdateResponseData struct {
// Webhook ID
ID string `json:"id,required"`
// Whether subscribed to all events
AllEvents bool `json:"allEvents,required"`
CreatedAt time.Time `json:"createdAt,required" format:"date-time"`
// Whether the webhook is active
Enabled bool `json:"enabled,required"`
// Subscribed events
//
// Any of "MessageSent", "MessageDelayed", "MessageDeliveryFailed", "MessageHeld",
// "MessageBounced", "MessageLinkClicked", "MessageLoaded", "DomainDNSError".
Events []string `json:"events,required"`
// Webhook name for identification
Name string `json:"name,required"`
// Webhook endpoint URL
URL string `json:"url,required" format:"uri"`
Uuid string `json:"uuid,required" format:"uuid"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AllEvents respjson.Field
CreatedAt respjson.Field
Enabled respjson.Field
Events respjson.Field
Name respjson.Field
URL respjson.Field
Uuid respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WebhookUpdateResponseData) RawJSON ¶ added in v0.3.0
func (r WebhookUpdateResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebhookUpdateResponseData) UnmarshalJSON ¶ added in v0.3.0
func (r *WebhookUpdateResponseData) UnmarshalJSON(data []byte) error
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
encoding/json
Package json implements encoding and decoding of JSON as defined in RFC 7159.
|
Package json implements encoding and decoding of JSON as defined in RFC 7159. |
|
encoding/json/shims
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package.
|
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package. |
|
packages
|
|