Documentation
¶
Overview ¶
Package letmesendemail provides an idiomatic Go client for the letmesend.email API.
Index ¶
- Constants
- func ModelToMap(v interface{}) (map[string]interface{}, error)
- func Version() string
- type ApiError
- type AuthenticationError
- type AuthorizationError
- type Config
- type ConflictError
- type ContactCategoriesResource
- func (r *ContactCategoriesResource) Create(ctx context.Context, name string, slug *string) (*ContactCategoryItem, error)
- func (r *ContactCategoriesResource) Delete(ctx context.Context, id string) (*StatusResponse, error)
- func (r *ContactCategoriesResource) Get(ctx context.Context, id string) (*ContactCategoryItem, error)
- func (r *ContactCategoriesResource) List(ctx context.Context, perPage *int, after, before *string) (*ContactCategoryListResponse, error)
- func (r *ContactCategoriesResource) Update(ctx context.Context, id, name string, slug *string) (*ContactCategoryItem, error)
- type ContactCategoryItem
- type ContactCategoryListResponse
- type ContactItem
- type ContactListResponse
- type ContactUpdateResponse
- type ContactsResource
- func (r *ContactsResource) Create(ctx context.Context, req *CreateContactRequest) (*ContactItem, error)
- func (r *ContactsResource) Delete(ctx context.Context, id string) (*StatusResponse, error)
- func (r *ContactsResource) Get(ctx context.Context, id string) (*ContactItem, error)
- func (r *ContactsResource) List(ctx context.Context, perPage *int, after, before *string) (*ContactListResponse, error)
- func (r *ContactsResource) Update(ctx context.Context, id string, req *UpdateContactRequest) (*ContactUpdateResponse, error)
- type CreateContactRequest
- type CreateEmailTopicRequest
- type DomainItem
- type DomainListResponse
- type DomainsResource
- type EmailAttachment
- type EmailListItem
- type EmailListResponse
- type EmailTopicDomainRef
- type EmailTopicItem
- type EmailTopicListResponse
- type EmailTopicsResource
- func (r *EmailTopicsResource) Create(ctx context.Context, req *CreateEmailTopicRequest) (*EmailTopicItem, error)
- func (r *EmailTopicsResource) Delete(ctx context.Context, id string) (*StatusResponse, error)
- func (r *EmailTopicsResource) Get(ctx context.Context, id string) (*EmailTopicItem, error)
- func (r *EmailTopicsResource) List(ctx context.Context, perPage *int, after, before *string) (*EmailTopicListResponse, error)
- func (r *EmailTopicsResource) Update(ctx context.Context, id string, req *UpdateEmailTopicRequest) (*EmailTopicItem, error)
- type EmailsResource
- func (r *EmailsResource) Get(ctx context.Context, id string) (*ShowEmailResponse, error)
- func (r *EmailsResource) List(ctx context.Context, perPage *int, after, before *string) (*EmailListResponse, error)
- func (r *EmailsResource) Send(ctx context.Context, req *SendEmailRequest) (*SendEmailResponse, error)
- func (r *EmailsResource) SendWithTemplate(ctx context.Context, req *SendWithTemplateRequest) (*SendEmailResponse, error)
- func (r *EmailsResource) Verify(ctx context.Context, email string) (*VerifyEmailResponse, error)
- type LetMeSendEmail
- type LetMeSendEmailError
- type NetworkError
- type NotFoundError
- type Option
- type PaginationInfo
- type RateLimitError
- type Recipient
- type SendAttachment
- type SendEmailRequest
- type SendEmailResponse
- type SendWithTemplateRequest
- type SerializationError
- type ShowEmailResponse
- type StatusResponse
- type TemplateVariable
- type TimeoutError
- type UpdateContactRequest
- type UpdateEmailTopicRequest
- type ValidationError
- type VerifyEmailResponse
- type WebhookSigningError
- type WebhookVerificationError
Constants ¶
const ( // DefaultBaseURL is the production API endpoint used by new clients. DefaultBaseURL = "https://letmesend.email/api/v1" // DefaultTimeoutMs is the per-attempt timeout in milliseconds. DefaultTimeoutMs = 30_000 // DefaultRetries disables automatic retries unless explicitly configured. DefaultRetries = 0 // MaxRetryDelay is the maximum retry delay in seconds. MaxRetryDelay = 300 // MaxRetries is the maximum accepted retry count. MaxRetries = 20 )
Variables ¶
This section is empty.
Functions ¶
func ModelToMap ¶
ModelToMap converts any JSON-serializable SDK model into independent plain data.
Types ¶
type ApiError ¶
type ApiError struct{ LetMeSendEmailError }
ApiError represents a generic API error (5xx or otherwise unclassified).
type AuthenticationError ¶
type AuthenticationError struct{ LetMeSendEmailError }
AuthenticationError represents a 401 response.
func (*AuthenticationError) Unwrap ¶
func (e *AuthenticationError) Unwrap() error
Unwrap exposes the common SDK error metadata.
type AuthorizationError ¶
type AuthorizationError struct{ LetMeSendEmailError }
AuthorizationError represents a 403 response.
func (*AuthorizationError) Unwrap ¶
func (e *AuthorizationError) Unwrap() error
Unwrap exposes the common SDK error metadata.
type Config ¶
type Config struct {
// APIKey is the bearer token used for API authentication.
APIKey string
// BaseURL overrides the API endpoint. It must be an absolute HTTP(S) URL.
BaseURL string
// TimeoutMs is the per-attempt timeout in milliseconds.
TimeoutMs int
// Retries is the maximum number of retries after the initial attempt.
Retries int
// HTTPClient optionally supplies a custom HTTP transport.
HTTPClient *http.Client
}
Config controls client authentication, transport, timeout, and retry behavior.
type ConflictError ¶
type ConflictError struct{ LetMeSendEmailError }
ConflictError represents a 409 response.
func (*ConflictError) Unwrap ¶
func (e *ConflictError) Unwrap() error
Unwrap exposes the common SDK error metadata.
type ContactCategoriesResource ¶
type ContactCategoriesResource struct {
// contains filtered or unexported fields
}
ContactCategoriesResource provides contact-category operations.
func (*ContactCategoriesResource) Create ¶
func (r *ContactCategoriesResource) Create(ctx context.Context, name string, slug *string) (*ContactCategoryItem, error)
Create creates a contact category.
func (*ContactCategoriesResource) Delete ¶
func (r *ContactCategoriesResource) Delete(ctx context.Context, id string) (*StatusResponse, error)
Delete deletes one contact category.
func (*ContactCategoriesResource) Get ¶
func (r *ContactCategoriesResource) Get(ctx context.Context, id string) (*ContactCategoryItem, error)
Get retrieves one contact category.
func (*ContactCategoriesResource) List ¶
func (r *ContactCategoriesResource) List(ctx context.Context, perPage *int, after, before *string) (*ContactCategoryListResponse, error)
List returns one cursor-paginated page of contact categories.
func (*ContactCategoriesResource) Update ¶
func (r *ContactCategoriesResource) Update(ctx context.Context, id, name string, slug *string) (*ContactCategoryItem, error)
Update updates one contact category.
type ContactCategoryItem ¶
type ContactCategoryItem struct {
ID string `json:"id"`
Name string `json:"name"`
Slug string `json:"slug"`
}
ContactCategoryItem represents a contact category.
func (*ContactCategoryItem) ToMap ¶
func (c *ContactCategoryItem) ToMap() (map[string]interface{}, error)
ToMap returns the category as a map[string]interface{}.
type ContactCategoryListResponse ¶
type ContactCategoryListResponse struct {
Data []ContactCategoryItem `json:"data"`
Pagination PaginationInfo `json:"pagination"`
}
ContactCategoryListResponse is the paginated list response for contact categories.
func (*ContactCategoryListResponse) ToMap ¶
func (c *ContactCategoryListResponse) ToMap() (map[string]interface{}, error)
ToMap returns the response as a map[string]interface{}.
type ContactItem ¶
type ContactItem struct {
ID string `json:"id"`
Email string `json:"email"`
FirstName *string `json:"first_name"`
LastName *string `json:"last_name"`
Phone *string `json:"phone"`
IsGloballyUnsubscribed bool `json:"is_globally_unsubscribed"`
CreatedAt string `json:"created_at"`
Categories []ContactCategoryItem `json:"categories,omitempty"`
}
ContactItem represents a contact returned by the API.
func (*ContactItem) ToMap ¶
func (c *ContactItem) ToMap() (map[string]interface{}, error)
ToMap returns the contact as a map[string]interface{}.
type ContactListResponse ¶
type ContactListResponse struct {
Data []ContactItem `json:"data"`
Pagination PaginationInfo `json:"pagination"`
}
ContactListResponse is the paginated list response for contacts.
func (*ContactListResponse) ToMap ¶
func (c *ContactListResponse) ToMap() (map[string]interface{}, error)
ToMap returns the response as a map[string]interface{}.
type ContactUpdateResponse ¶
type ContactUpdateResponse struct {
ID string `json:"id"`
}
ContactUpdateResponse is the response from updating a contact.
func (*ContactUpdateResponse) ToMap ¶
func (c *ContactUpdateResponse) ToMap() (map[string]interface{}, error)
ToMap returns the response as a map[string]interface{}.
type ContactsResource ¶
type ContactsResource struct {
// contains filtered or unexported fields
}
ContactsResource provides contact operations.
func (*ContactsResource) Create ¶
func (r *ContactsResource) Create(ctx context.Context, req *CreateContactRequest) (*ContactItem, error)
Create creates a contact.
func (*ContactsResource) Delete ¶
func (r *ContactsResource) Delete(ctx context.Context, id string) (*StatusResponse, error)
Delete deletes one contact.
func (*ContactsResource) Get ¶
func (r *ContactsResource) Get(ctx context.Context, id string) (*ContactItem, error)
Get retrieves one contact.
func (*ContactsResource) List ¶
func (r *ContactsResource) List(ctx context.Context, perPage *int, after, before *string) (*ContactListResponse, error)
List returns one cursor-paginated page of contacts.
func (*ContactsResource) Update ¶
func (r *ContactsResource) Update(ctx context.Context, id string, req *UpdateContactRequest) (*ContactUpdateResponse, error)
Update updates one contact.
type CreateContactRequest ¶
type CreateContactRequest struct {
Email string `json:"email"`
FirstName *string `json:"first_name,omitempty"`
LastName *string `json:"last_name,omitempty"`
Phone *string `json:"phone,omitempty"`
IsGloballyUnsubscribed *bool `json:"is_globally_unsubscribed,omitempty"`
Categories []string `json:"categories,omitempty"`
EmailTopics []string `json:"email_topics,omitempty"`
}
CreateContactRequest is the request payload for creating a contact.
func (*CreateContactRequest) ToMap ¶
func (c *CreateContactRequest) ToMap() (map[string]interface{}, error)
ToMap returns an independent JSON-compatible request representation.
type CreateEmailTopicRequest ¶
type CreateEmailTopicRequest struct {
Name string `json:"name"`
Slug string `json:"slug"`
AutoSubscribe *bool `json:"auto_subscribe,omitempty"`
Public *bool `json:"public,omitempty"`
Description *string `json:"description,omitempty"`
Domain *EmailTopicDomainRef `json:"domain,omitempty"`
}
CreateEmailTopicRequest is the request payload for creating an email topic.
func (*CreateEmailTopicRequest) ToMap ¶
func (c *CreateEmailTopicRequest) ToMap() (map[string]interface{}, error)
ToMap returns an independent JSON-compatible request representation.
type DomainItem ¶
type DomainItem struct {
ID string `json:"id"`
DomainName string `json:"domain_name"`
Status string `json:"status"`
CreatedAt string `json:"created_at"`
}
DomainItem represents a sending domain.
func (*DomainItem) ToMap ¶
func (d *DomainItem) ToMap() (map[string]interface{}, error)
ToMap returns the domain as a map[string]interface{}.
type DomainListResponse ¶
type DomainListResponse struct {
Data []DomainItem `json:"data"`
Pagination PaginationInfo `json:"pagination"`
}
DomainListResponse is the paginated list response for domains.
func (*DomainListResponse) ToMap ¶
func (d *DomainListResponse) ToMap() (map[string]interface{}, error)
ToMap returns the response as a map[string]interface{}.
type DomainsResource ¶
type DomainsResource struct {
// contains filtered or unexported fields
}
DomainsResource provides sending-domain operations.
func (*DomainsResource) Get ¶
func (r *DomainsResource) Get(ctx context.Context, id string) (*DomainItem, error)
Get retrieves one sending domain.
func (*DomainsResource) List ¶
func (r *DomainsResource) List(ctx context.Context, perPage *int, after, before *string) (*DomainListResponse, error)
List returns one cursor-paginated page of domains.
func (*DomainsResource) Verify ¶
func (r *DomainsResource) Verify(ctx context.Context, domain string) (*StatusResponse, error)
Verify requests verification of a sending domain.
type EmailAttachment ¶
type EmailAttachment struct {
ID string `json:"id"`
Name string `json:"name"`
Mime string `json:"mime"`
ContentID string `json:"content_id"`
ContentDisposition string `json:"content_disposition"`
Size int `json:"size"`
DownloadURL string `json:"download_url"`
}
EmailAttachment contains details about an email attachment.
func (*EmailAttachment) ToMap ¶
func (a *EmailAttachment) ToMap() (map[string]interface{}, error)
ToMap returns the attachment as a map[string]interface{}.
type EmailListItem ¶
type EmailListItem struct {
ID string `json:"id"`
Status string `json:"status"`
Subject *string `json:"subject"`
EventName *string `json:"event_name"`
Type string `json:"type"`
CreatedAt string `json:"created_at"`
SentAt *string `json:"sent_at"`
RecipientsCount int `json:"recipients_count"`
AttachmentsCount int `json:"attachments_count"`
}
EmailListItem is a single item in the email list response.
func (*EmailListItem) ToMap ¶
func (e *EmailListItem) ToMap() (map[string]interface{}, error)
ToMap returns the item as a map[string]interface{}.
type EmailListResponse ¶
type EmailListResponse struct {
Data []EmailListItem `json:"data"`
Pagination PaginationInfo `json:"pagination"`
}
EmailListResponse is the paginated list response for emails.
func (*EmailListResponse) ToMap ¶
func (e *EmailListResponse) ToMap() (map[string]interface{}, error)
ToMap returns the response as a map[string]interface{}.
type EmailTopicDomainRef ¶
EmailTopicDomainRef represents a domain reference on email topics.
func (*EmailTopicDomainRef) ToMap ¶
func (e *EmailTopicDomainRef) ToMap() (map[string]interface{}, error)
ToMap returns an independent JSON-compatible representation.
type EmailTopicItem ¶
type EmailTopicItem struct {
ID string `json:"id"`
Name string `json:"name"`
Slug string `json:"slug"`
Description *string `json:"description"`
AutoSubscribe bool `json:"auto_subscribe"`
Public bool `json:"public"`
CreatedAt string `json:"created_at"`
Domain *EmailTopicDomainRef `json:"domain,omitempty"`
}
EmailTopicItem represents an email topic.
func (*EmailTopicItem) ToMap ¶
func (e *EmailTopicItem) ToMap() (map[string]interface{}, error)
ToMap returns the topic as a map[string]interface{}.
type EmailTopicListResponse ¶
type EmailTopicListResponse struct {
Data []EmailTopicItem `json:"data"`
Pagination PaginationInfo `json:"pagination"`
}
EmailTopicListResponse is the paginated list response for email topics.
func (*EmailTopicListResponse) ToMap ¶
func (e *EmailTopicListResponse) ToMap() (map[string]interface{}, error)
ToMap returns the response as a map[string]interface{}.
type EmailTopicsResource ¶
type EmailTopicsResource struct {
// contains filtered or unexported fields
}
EmailTopicsResource provides email-topic operations.
func (*EmailTopicsResource) Create ¶
func (r *EmailTopicsResource) Create(ctx context.Context, req *CreateEmailTopicRequest) (*EmailTopicItem, error)
Create creates an email topic.
func (*EmailTopicsResource) Delete ¶
func (r *EmailTopicsResource) Delete(ctx context.Context, id string) (*StatusResponse, error)
Delete deletes one email topic.
func (*EmailTopicsResource) Get ¶
func (r *EmailTopicsResource) Get(ctx context.Context, id string) (*EmailTopicItem, error)
Get retrieves one email topic.
func (*EmailTopicsResource) List ¶
func (r *EmailTopicsResource) List(ctx context.Context, perPage *int, after, before *string) (*EmailTopicListResponse, error)
List returns one cursor-paginated page of email topics.
func (*EmailTopicsResource) Update ¶
func (r *EmailTopicsResource) Update(ctx context.Context, id string, req *UpdateEmailTopicRequest) (*EmailTopicItem, error)
Update updates one email topic.
type EmailsResource ¶
type EmailsResource struct {
// contains filtered or unexported fields
}
EmailsResource provides email sending, verification, listing, and retrieval.
func (*EmailsResource) Get ¶
func (r *EmailsResource) Get(ctx context.Context, id string) (*ShowEmailResponse, error)
Get retrieves detailed information for one email.
func (*EmailsResource) List ¶
func (r *EmailsResource) List(ctx context.Context, perPage *int, after, before *string) (*EmailListResponse, error)
List returns one cursor-paginated page of emails.
func (*EmailsResource) Send ¶
func (r *EmailsResource) Send(ctx context.Context, req *SendEmailRequest) (*SendEmailResponse, error)
Send sends a regular email.
func (*EmailsResource) SendWithTemplate ¶
func (r *EmailsResource) SendWithTemplate(ctx context.Context, req *SendWithTemplateRequest) (*SendEmailResponse, error)
SendWithTemplate sends an email rendered from a template.
func (*EmailsResource) Verify ¶
func (r *EmailsResource) Verify(ctx context.Context, email string) (*VerifyEmailResponse, error)
Verify verifies an email address.
type LetMeSendEmail ¶
type LetMeSendEmail struct {
// Emails provides email sending, verification, listing, and retrieval.
Emails *EmailsResource
// Domains provides sending-domain operations.
Domains *DomainsResource
// Contacts provides contact operations.
Contacts *ContactsResource
// ContactCategories provides contact-category operations.
ContactCategories *ContactCategoriesResource
// EmailTopics provides email-topic operations.
EmailTopics *EmailTopicsResource
// contains filtered or unexported fields
}
LetMeSendEmail is the SDK client and exposes each supported API resource.
func MustNew ¶
func MustNew(apiKey string, opts ...Option) *LetMeSendEmail
MustNew creates a new SDK client and panics if configuration is invalid.
type LetMeSendEmailError ¶
type LetMeSendEmailError struct {
// Message describes the error.
Message string
// StatusCode is the HTTP status code, or 0 for client-side errors.
StatusCode int
// APICode is the API error code from the response body.
APICode string
// ValidationErrors maps field names to error messages for 422 responses.
ValidationErrors map[string][]string
// RequestID is the x-request-id header value.
RequestID string
// ResponseHeaders contains the HTTP response headers.
ResponseHeaders map[string]string
// RawBody is the raw response body string.
RawBody string
}
LetMeSendEmailError is the base error type for all SDK errors.
func (*LetMeSendEmailError) Error ¶
func (e *LetMeSendEmailError) Error() string
Error returns the error message.
type NetworkError ¶
type NetworkError struct{ LetMeSendEmailError }
NetworkError represents a network-level error (connection refused, DNS failure, etc.).
func (*NetworkError) Unwrap ¶
func (e *NetworkError) Unwrap() error
Unwrap exposes the common SDK error metadata.
type NotFoundError ¶
type NotFoundError struct{ LetMeSendEmailError }
NotFoundError represents a 404 response.
func (*NotFoundError) Unwrap ¶
func (e *NotFoundError) Unwrap() error
Unwrap exposes the common SDK error metadata.
type Option ¶
type Option func(*Config)
Option customizes client configuration during construction.
func WithBaseURL ¶
WithBaseURL overrides the default API endpoint.
func WithHTTPClient ¶
WithHTTPClient injects a custom HTTP client while retaining SDK timeout handling.
func WithRetries ¶
WithRetries sets the number of retries after the initial attempt.
func WithTimeout ¶
WithTimeout sets the per-attempt timeout in milliseconds.
type PaginationInfo ¶
type PaginationInfo struct {
HasMore bool `json:"has_more"`
PerPage int `json:"per_page"`
Fetched int `json:"fetched"`
Total int `json:"total"`
}
PaginationInfo contains pagination metadata returned by list endpoints.
func (*PaginationInfo) ToMap ¶
func (p *PaginationInfo) ToMap() (map[string]interface{}, error)
ToMap returns the pagination info as a map[string]interface{}.
type RateLimitError ¶
type RateLimitError struct {
LetMeSendEmailError
// RetryAfter is the number of seconds to wait before retrying.
RetryAfter int
// Limit is the total rate limit allowance.
Limit int
// Remaining is the remaining rate limit allowance.
Remaining int
// ResetAt is the timestamp when the rate limit resets.
ResetAt string
}
RateLimitError represents a 429 response.
func (*RateLimitError) Unwrap ¶
func (e *RateLimitError) Unwrap() error
Unwrap exposes the common SDK error metadata.
type Recipient ¶
type Recipient struct {
Type string `json:"type"`
Status string `json:"status"`
EmailAddress string `json:"email_address"`
BounceType *string `json:"bounce_type"`
BounceReason *string `json:"bounce_reason"`
BouncedAt *string `json:"bounced_at"`
ComplaintType *string `json:"complaint_type"`
ComplainedAt *string `json:"complained_at"`
IsSuppressed bool `json:"is_suppressed"`
SuppressionReason *string `json:"suppression_reason"`
OpenedAt *string `json:"opened_at"`
OpenCount int `json:"open_count"`
ClickedAt *string `json:"clicked_at"`
ClickCount int `json:"click_count"`
FailedAt *string `json:"failed_at"`
ErrorMessage *string `json:"error_message"`
DeliveredAt *string `json:"delivered_at"`
SentAt *string `json:"sent_at"`
}
Recipient contains details about an email recipient.
type SendAttachment ¶
type SendAttachment struct {
Name string `json:"name,omitempty"`
Path string `json:"path,omitempty"`
Content string `json:"content,omitempty"`
Mime string `json:"mime,omitempty"`
ContentID string `json:"content_id,omitempty"`
ContentDisposition string `json:"content_disposition,omitempty"`
}
SendAttachment represents a file attached to an email.
func (*SendAttachment) ToMap ¶
func (s *SendAttachment) ToMap() (map[string]interface{}, error)
ToMap returns an independent JSON-compatible representation.
type SendEmailRequest ¶
type SendEmailRequest struct {
From string `json:"from"`
To []string `json:"to"`
Subject string `json:"subject"`
HTML *string `json:"html,omitempty"`
Text *string `json:"text,omitempty"`
Type *string `json:"type,omitempty"`
EventName *string `json:"event_name,omitempty"`
EmailTopicID *string `json:"email_topic_id,omitempty"`
ReplyTo []string `json:"reply_to,omitempty"`
Cc []string `json:"cc,omitempty"`
Bcc []string `json:"bcc,omitempty"`
Headers map[string]string `json:"headers,omitempty"`
Attachments []SendAttachment `json:"attachments,omitempty"`
IdempotencyKey string `json:"-"`
}
SendEmailRequest is the request payload for sending an email.
func (*SendEmailRequest) ToMap ¶
func (s *SendEmailRequest) ToMap() (map[string]interface{}, error)
ToMap returns the API request body without the idempotency header value.
type SendEmailResponse ¶
type SendEmailResponse struct {
ID string `json:"id"`
Status string `json:"status"`
Emails []string `json:"emails"`
RestrictedEmails []string `json:"restricted_emails"`
Duplicate bool `json:"duplicate"`
}
SendEmailResponse is the response after sending an email.
func (*SendEmailResponse) ToMap ¶
func (s *SendEmailResponse) ToMap() (map[string]interface{}, error)
ToMap returns the response as a map[string]interface{}.
type SendWithTemplateRequest ¶
type SendWithTemplateRequest struct {
From string `json:"from"`
To []string `json:"to"`
TemplateID string `json:"template_id"`
Subject *string `json:"subject,omitempty"`
TemplateVariables []TemplateVariable `json:"template_variables,omitempty"`
Type *string `json:"type,omitempty"`
EventName *string `json:"event_name,omitempty"`
EmailTopicID *string `json:"email_topic_id,omitempty"`
ReplyTo []string `json:"reply_to,omitempty"`
Cc []string `json:"cc,omitempty"`
Bcc []string `json:"bcc,omitempty"`
Headers map[string]string `json:"headers,omitempty"`
Attachments []SendAttachment `json:"attachments,omitempty"`
IdempotencyKey string `json:"-"`
}
SendWithTemplateRequest is the request payload for sending a templated email.
func (*SendWithTemplateRequest) ToMap ¶
func (s *SendWithTemplateRequest) ToMap() (map[string]interface{}, error)
ToMap returns the API request body without the idempotency header value.
type SerializationError ¶
type SerializationError struct{ LetMeSendEmailError }
SerializationError represents a local request or model serialization failure.
func (*SerializationError) Unwrap ¶
func (e *SerializationError) Unwrap() error
Unwrap exposes the common SDK error metadata.
type ShowEmailResponse ¶
type ShowEmailResponse struct {
ID string `json:"id"`
Status string `json:"status"`
Subject *string `json:"subject"`
EventName *string `json:"event_name"`
Type string `json:"type"`
CreatedAt string `json:"created_at"`
SentAt *string `json:"sent_at"`
RecipientsCount int `json:"recipients_count"`
AttachmentsCount int `json:"attachments_count"`
Recipients []Recipient `json:"recipients"`
Attachments []EmailAttachment `json:"attachments"`
}
ShowEmailResponse is the detailed response for a single email, including recipients and attachments.
func (*ShowEmailResponse) ToMap ¶
func (s *ShowEmailResponse) ToMap() (map[string]interface{}, error)
ToMap returns the response as a map[string]interface{}.
type StatusResponse ¶
type StatusResponse struct {
Status string `json:"status"`
Message *string `json:"message,omitempty"`
}
StatusResponse is a generic status response returned by operations like domain verification.
func (*StatusResponse) ToMap ¶
func (s *StatusResponse) ToMap() (map[string]interface{}, error)
ToMap returns the response as a map[string]interface{}.
type TemplateVariable ¶
type TemplateVariable struct {
Key string `json:"key"`
Type string `json:"type"`
Value interface{} `json:"value"`
}
TemplateVariable represents a variable used in template-based emails.
func (*TemplateVariable) ToMap ¶
func (t *TemplateVariable) ToMap() (map[string]interface{}, error)
ToMap returns an independent JSON-compatible representation.
type TimeoutError ¶
type TimeoutError struct{ LetMeSendEmailError }
TimeoutError represents a request timeout.
func (*TimeoutError) Unwrap ¶
func (e *TimeoutError) Unwrap() error
Unwrap exposes the common SDK error metadata.
type UpdateContactRequest ¶
type UpdateContactRequest struct {
FirstName *string `json:"first_name,omitempty"`
LastName *string `json:"last_name,omitempty"`
Phone *string `json:"phone,omitempty"`
IsGloballyUnsubscribed *bool `json:"is_globally_unsubscribed,omitempty"`
Categories []string `json:"categories,omitempty"`
EmailTopics []string `json:"email_topics,omitempty"`
SyncCategories *bool `json:"sync_categories,omitempty"`
SyncEmailTopics *bool `json:"sync_email_topics,omitempty"`
}
UpdateContactRequest is the request payload for updating a contact.
func (*UpdateContactRequest) ToMap ¶
func (u *UpdateContactRequest) ToMap() (map[string]interface{}, error)
ToMap returns an independent JSON-compatible request representation.
type UpdateEmailTopicRequest ¶
type UpdateEmailTopicRequest struct {
Name *string `json:"name,omitempty"`
Slug *string `json:"slug,omitempty"`
Description *string `json:"description,omitempty"`
Public *bool `json:"public,omitempty"`
AutoSubscribe *bool `json:"auto_subscribe,omitempty"`
}
UpdateEmailTopicRequest is the request payload for updating an email topic.
func (*UpdateEmailTopicRequest) ToMap ¶
func (u *UpdateEmailTopicRequest) ToMap() (map[string]interface{}, error)
ToMap returns an independent JSON-compatible request representation.
type ValidationError ¶
type ValidationError struct{ LetMeSendEmailError }
ValidationError represents a 400, 413, or 422 response.
func (*ValidationError) Unwrap ¶
func (e *ValidationError) Unwrap() error
Unwrap exposes the common SDK error metadata.
type VerifyEmailResponse ¶
type VerifyEmailResponse struct {
Email string `json:"email"`
Score int `json:"score"`
Status string `json:"status"`
DomainExists bool `json:"domain_exists"`
Disposable bool `json:"disposable"`
RoleBased bool `json:"role_based"`
HasMailbox bool `json:"has_mailbox"`
ReceiveEmail bool `json:"receive_email"`
MXRecords bool `json:"mx_records"`
ValidSyntax bool `json:"valid_syntax"`
BelongsTo *string `json:"belongs_to"`
}
VerifyEmailResponse is the response from email address verification.
func (*VerifyEmailResponse) ToMap ¶
func (v *VerifyEmailResponse) ToMap() (map[string]interface{}, error)
ToMap returns the response as a map[string]interface{}.
type WebhookSigningError ¶
type WebhookSigningError = webhooks.WebhookSigningError
WebhookSigningError is a compatibility alias for webhooks.WebhookSigningError.
type WebhookVerificationError ¶
type WebhookVerificationError = webhooks.WebhookVerificationError
WebhookVerificationError is a compatibility alias for webhooks.WebhookVerificationError.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
attachments
command
|
|
|
errors
command
|
|
|
idempotency
command
|
|
|
pagination
command
|
|
|
send
command
|
|
|
template
command
|
|
|
webhooks
command
|
|
|
Package webhooks provides webhook signature verification for letmesend.email.
|
Package webhooks provides webhook signature verification for letmesend.email. |