Versions in this module Expand all Collapse all v0 v0.1.0 Nov 11, 2026 Changes in this version + const DefaultBaseURL + const DefaultTimeout + const DefaultUserAgent + const Version + const WebhookSecretEnv + const WebhookSignatureHeader + var ErrInvalidWebhookSignature = errors.New("wazobiamail: invalid webhook signature") + type APIError struct + Body []byte + Code string + Errors map[string]any + Message string + RetryAfter time.Duration + StatusCode int + func (e *APIError) Error() string + func (e *APIError) IsForbidden() bool + func (e *APIError) IsNotFound() bool + func (e *APIError) IsRateLimited() bool + func (e *APIError) IsUnauthorized() bool + func (e *APIError) IsValidation() bool + type APIKey struct + CreatedAt string + Domain *string + DomainID *string + ExpiresAt *string + ID string + KeyPrefix string + LastUsedAt *string + Name string + RevokedAt *string + Scope string + type APIKeyEnvelope struct + APIKey CreatedAPIKey + type APIKeysService struct + func (s *APIKeysService) Create(ctx context.Context, req CreateAPIKeyRequest) (*APIResponse[APIKeyEnvelope], error) + func (s *APIKeysService) List(ctx context.Context) (*APIResponse[Items[APIKey]], error) + func (s *APIKeysService) Regenerate(ctx context.Context, keyID string) (*APIResponse[APIKeyEnvelope], error) + func (s *APIKeysService) Revoke(ctx context.Context, keyID string) (*APIResponse[map[string]string], error) + type APIResponse struct + Data T + Message string + Success bool + type AccountStatus struct + Plan map[string]any + Units map[string]any + type BillingService struct + func (s *BillingService) CurrentSubscription(ctx context.Context, product string) (*APIResponse[SubscriptionEnvelope], error) + func (s *BillingService) DownloadInvoice(ctx context.Context, invoiceID string) ([]byte, http.Header, error) + func (s *BillingService) ListInvoices(ctx context.Context) (*APIResponse[Page[Invoice]], error) + type Client struct + APIKeys *APIKeysService + Billing *BillingService + Domains *DomainsService + Mailboxes *MailboxesService + Messages *MessagesService + Plans *PlansService + SMTP *SMTPService + Status *StatusService + Support *SupportService + Templates *TemplatesService + Units *UnitsService + Webhooks *WebhooksService + func NewClient(apiKey string, options ...Option) (*Client, error) + func NewClientFromEnv(options ...Option) (*Client, error) + func (c *Client) BaseURL() string + func (c *Client) String() string + type CloudflareConnect struct + AuthorizationURL string + type CloudflareStatus struct + Connected bool + Domain *string + ZoneID *string + type CloudflareSyncRequest struct + DomainID string + type CloudflareSyncResult struct + Added int + Records int + Updated int + VerificationStatus string + Zone string + type CreateAPIKeyRequest struct + DomainID string + ExpiresAt string + Name string + Scope string + type CreateDomainRequest struct + Domain string + HostInboxesOnMainDomain *bool + IsDefault *bool + MailMode string + SendingSubdomain string + UseRootDomain *bool + type CreateMailboxRequest struct + DisplayName string + DomainID string + LocalPart string + Password string + QuotaMB int + Role string + Status string + type CreateSMTPRelayRequest struct + IsDefault *bool + Name string + SMTPHost string + SMTPPassword string + SMTPPort int + SMTPSecurity string + SMTPUsername string + Status string + type CreateSupportTicketRequest struct + Attachments []SupportUpload + Category string + ContentType string + Domain string + Email string + Message string + Name string + Priority string + Subject string + type CreateTemplateRequest struct + AutoSubmitMeta bool + Body string + Category string + Channel string + Components any + Design any + IsSystem bool + Language string + Name string + Subject string + TextBody string + Variables any + type CreatedAPIKey struct + APIKey string + DomainID *string + ExpiresAt *string + ID string + KeyPrefix string + Name string + Scope string + type CreatedCredential struct + Credential MailboxCredential + Password string + type CreatedSupportTicket struct + ID string + TicketID string + type CredentialEnvelope struct + Credential CreatedCredential + type DNSRecord struct + Host string + ID string + LastCheckedAt *string + RecordType string + Status string + TTL int + Value string + type Domain struct + AccountID int64 + CreateDefaultInboxes bool + CreatedAt string + Domain string + DomainRole string + ID string + IsDefault bool + MailMode string + ParentDomainID *string + RequestedDomain *string + VerificationStatus string + type DomainDNS struct + CopyBlock string + Domain string + DomainID string + Provisioning bool + Records []DNSRecord + VerificationStatus string + type DomainDNSEnvelope struct + Domain DomainDNS + type DomainEnvelope struct + Domain Domain + type DomainVerification struct + Checks []VerificationCheck + Domain string + DomainID string + PendingCount int + VerificationStatus string + VerifiedCount int + type DomainsService struct + func (s *DomainsService) CloudflareConnect(ctx context.Context, domainID string) (*APIResponse[CloudflareConnect], error) + func (s *DomainsService) CloudflareDisconnect(ctx context.Context, domainID string) (*APIResponse[map[string]any], error) + func (s *DomainsService) CloudflareStatus(ctx context.Context, domainID string) (*APIResponse[CloudflareStatus], error) + func (s *DomainsService) CloudflareSync(ctx context.Context, domainID string) (*APIResponse[CloudflareSyncResult], error) + func (s *DomainsService) Create(ctx context.Context, req CreateDomainRequest) (*APIResponse[DomainEnvelope], error) + func (s *DomainsService) DNSRecords(ctx context.Context, domainID string) (*APIResponse[DomainDNSEnvelope], error) + func (s *DomainsService) Delete(ctx context.Context, domainID string) (*APIResponse[map[string]string], error) + func (s *DomainsService) Get(ctx context.Context, domainID string) (*APIResponse[DomainEnvelope], error) + func (s *DomainsService) List(ctx context.Context) (*APIResponse[Items[Domain]], error) + func (s *DomainsService) RefreshDNS(ctx context.Context, domainID string) (*APIResponse[VerificationEnvelope], error) + func (s *DomainsService) Update(ctx context.Context, domainID string, req UpdateDomainRequest) (*APIResponse[DomainEnvelope], error) + func (s *DomainsService) Verify(ctx context.Context, domainID string, force bool) (*APIResponse[VerificationEnvelope], error) + type EffectiveLimits struct + AccountID int64 + AdditionalMailboxLimit int + BaseMailboxLimit int + CustomDomainSendingEnabled bool + DomainLimit int + MailboxLimit int + MailboxOpsPerMinute int + MailboxStorageGB int + PlanID string + ReceivingEnabled bool + SendRateLimitPerMinute int + type EmailAddress struct + Email string + Name *string + type EmailLog struct + CreatedAt string + ID string + Recipient *string + Status string + Subject *string + TrackingID string + type EmailLogParams struct + From string + Limit int + Offset int + Status string + To string + type EmailLogs struct + Available bool + EventDetailsAvailable bool + HasMore bool + Messages []EmailLog + type FileUpload struct + Content []byte + ContentType string + FileName string + type InboxAttachment struct + BlobID string + Name string + SizeBytes int64 + Type string + type InboxMessage struct + From []EmailAddress + HasAttachments bool + ID string + IsUnread bool + Preview *string + ReceivedAt *string + SizeBytes int64 + Subject *string + ThreadID *string + To []EmailAddress + type InboxMessageDetail struct + Attachments []InboxAttachment + BCC []EmailAddress + CC []EmailAddress + HTMLBody *string + ReplyTo []EmailAddress + TextBody *string + type Invoice struct + AccountID int64 + Amount float64 + CreatedAt string + Currency string + DueDate *string + ID string + Metadata map[string]any + PaidAt *string + Purpose string + Status string + type Items struct + Items []T + type LimitsEnvelope struct + Limits EffectiveLimits + type ListMessagesParams struct + Limit int + Page int + Search string + UnreadOnly bool + type Mailbox struct + Address string + AutoProvisioned bool + CreatedAt string + DisplayName *string + DomainID string + ID string + IsPlatformSubdomain bool + LocalPart string + Role string + Status string + UpdatedAt string + type MailboxConnection struct + Authentication string + DomainID string + IMAP map[string]any + MailboxID string + POP3 map[string]any + PasswordHint string + SMTP map[string]any + Status string + Username string + type MailboxCredential struct + CreatedAt string + ExpiresAt *string + ID string + MailboxID string + RevokedAt *string + Username string + type MailboxEnvelope struct + Mailbox Mailbox + type MailboxMessages struct + Items []InboxMessage + Limit int + Page int + Total int + type MailboxesService struct + func (s *MailboxesService) Connection(ctx context.Context, mailboxID string) (*APIResponse[MailboxConnection], error) + func (s *MailboxesService) Create(ctx context.Context, req CreateMailboxRequest) (*APIResponse[Mailbox], error) + func (s *MailboxesService) CreateCredential(ctx context.Context, mailboxID string) (*APIResponse[CredentialEnvelope], error) + func (s *MailboxesService) Delete(ctx context.Context, mailboxID string) (*APIResponse[map[string]string], error) + func (s *MailboxesService) DeleteMessage(ctx context.Context, mailboxID, messageID string) (*APIResponse[map[string]any], error) + func (s *MailboxesService) Get(ctx context.Context, mailboxID string) (*APIResponse[MailboxEnvelope], error) + func (s *MailboxesService) GetMessage(ctx context.Context, mailboxID, messageID string) (*APIResponse[InboxMessageDetail], error) + func (s *MailboxesService) List(ctx context.Context) (*APIResponse[[]Mailbox], error) + func (s *MailboxesService) ListMessages(ctx context.Context, mailboxID string, params ListMessagesParams) (*APIResponse[MailboxMessages], error) + func (s *MailboxesService) RevokeCredential(ctx context.Context, mailboxID, credentialID string) (*APIResponse[map[string]string], error) + func (s *MailboxesService) RotateCredential(ctx context.Context, mailboxID string) (*APIResponse[CredentialEnvelope], error) + func (s *MailboxesService) Storage(ctx context.Context) (*APIResponse[map[string]any], error) + func (s *MailboxesService) Update(ctx context.Context, mailboxID string, req UpdateMailboxRequest) (*APIResponse[MailboxEnvelope], error) + type MessagesService struct + func (s *MessagesService) GetTracked(ctx context.Context, trackingID string) (*APIResponse[TrackingDetail], error) + func (s *MessagesService) ListEmailLogs(ctx context.Context, params EmailLogParams) (*APIResponse[EmailLogs], error) + func (s *MessagesService) ListTracked(ctx context.Context, params TrackingListParams) (*APIResponse[TrackingList], error) + func (s *MessagesService) Send(ctx context.Context, req SendMessageRequest) (*APIResponse[SendEnvelope], error) + func (s *MessagesService) SendWithAttachments(ctx context.Context, req SendMessageRequest, files []FileUpload) (*APIResponse[SendEnvelope], error) + func (s *MessagesService) SpamCheck(ctx context.Context, req SpamCheckRequest) (*APIResponse[SpamCheckResult], error) + func (s *MessagesService) UploadAttachment(ctx context.Context, file FileUpload) (*APIResponse[UploadedFileEnvelope], error) + type Option func(*Client) error + func WithAccessToken(token string) Option + func WithAllowUnauthenticated(allow bool) Option + func WithBaseURL(baseURL string) Option + func WithHTTPClient(client *http.Client) Option + func WithHeader(name, value string) Option + func WithTimeout(timeout time.Duration) Option + func WithUserAgent(userAgent string) Option + type Page struct + Items []T + Pagination Pagination + type Pagination struct + HasNext bool + HasPrev bool + Page int + PageSize int + TotalItems int + TotalPages int + type Plan struct + DailyQuota int + DataRetentionDays int + Features any + HourlyQuota int + ID string + Limits any + MonthlyQuota int + NairaPrice float64 + Name string + SendRateLimitPerMinute int + Status string + USDPrice float64 + YearlyNairaPrice *float64 + YearlyUSDPrice *float64 + type PlansService struct + func (s *PlansService) EffectiveLimits(ctx context.Context) (*APIResponse[LimitsEnvelope], error) + func (s *PlansService) List(ctx context.Context) (*APIResponse[Page[Plan]], error) + type PreviewTemplateRequest struct + SampleVariables map[string]any + type PurchaseUnitsRequest struct + Currency string + PackID string + type ReplySupportTicketRequest struct + Attachments []SupportUpload + ContentType string + Message string + type SMTPAccess struct + Configured bool + Connection *SMTPConnection + Eligible bool + Enabled bool + Paid bool + Persona *string + type SMTPConnection struct + Host string + Port int + Security string + Usernames []string + type SMTPRelay struct + AccountID int64 + CreatedAt string + HasPassword bool + ID string + IsDefault bool + Name string + SMTPHost string + SMTPPort int + SMTPSecurity string + SMTPUsername string + Status string + UpdatedAt string + type SMTPRelayEnvelope struct + SMTPRelay SMTPRelay + type SMTPRelaysEnvelope struct + SMTPRelays []SMTPRelay + type SMTPService struct + func (s *SMTPService) Access(ctx context.Context) (*APIResponse[SMTPAccess], error) + func (s *SMTPService) ActivateRelay(ctx context.Context, relayID string) (*APIResponse[SMTPRelayEnvelope], error) + func (s *SMTPService) CreateRelay(ctx context.Context, req CreateSMTPRelayRequest) (*APIResponse[SMTPRelayEnvelope], error) + func (s *SMTPService) DeactivateRelay(ctx context.Context, relayID string) (*APIResponse[SMTPRelayEnvelope], error) + func (s *SMTPService) DeleteRelay(ctx context.Context, relayID string) (*APIResponse[map[string]string], error) + func (s *SMTPService) GetRelay(ctx context.Context, relayID string) (*APIResponse[SMTPRelayEnvelope], error) + func (s *SMTPService) ListRelays(ctx context.Context) (*APIResponse[SMTPRelaysEnvelope], error) + func (s *SMTPService) UpdateAccess(ctx context.Context, enabled bool) (*APIResponse[map[string]bool], error) + func (s *SMTPService) UpdateRelay(ctx context.Context, relayID string, req UpdateSMTPRelayRequest) (*APIResponse[SMTPRelayEnvelope], error) + type SendEnvelope struct + Result SendResult + type SendMessageRequest struct + Attachments []URLAttachment + Bcc []string + Cc []string + EnvelopeSender string + From string + HTML string + IdempotencyKey string + ReplyTo string + Subject string + Text string + To []string + type SendResult struct + Recipients int + Status string + TrackingID string + type SpamCheckRequest struct + From string + HTML string + Headers map[string]string + ReplyTo string + Subject string + Text string + type SpamCheckResult struct + BadgeColor string + DeliverabilityScore int + IsSpam bool + Rating string + Rules []SpamRule + Score float64 + Summary string + Threshold float64 + type SpamRule struct + Code string + Description string + Points float64 + Recommendation string + Title string + type StatusService struct + func (s *StatusService) Get(ctx context.Context) (*APIResponse[AccountStatus], error) + type Subscription struct + AccountID int64 + AutoRenew bool + BillingInterval string + EndDate *string + ID string + Plan map[string]any + PlanID string + StartDate string + Status string + type SubscriptionEnvelope struct + Subscription *Subscription + type SuccessResponse struct + Message string + Success bool + type SupportAttachment struct + ContentType string + Filename string + ID string + SizeBytes int64 + URL string + type SupportListParams struct + Descending bool + Limit int + Page int + Sort string + Status string + type SupportMessage struct + Attachments []SupportAttachment + ContentType string + CreatedAt string + ID string + IsFromStaff bool + Message string + SenderEmail string + SenderName string + TicketID string + type SupportService struct + func (s *SupportService) Create(ctx context.Context, req CreateSupportTicketRequest) (*APIResponse[CreatedSupportTicket], error) + func (s *SupportService) DownloadAttachment(ctx context.Context, attachmentID string) ([]byte, http.Header, error) + func (s *SupportService) Get(ctx context.Context, ticketID string) (*APIResponse[SupportTicket], error) + func (s *SupportService) List(ctx context.Context, params SupportListParams) (*APIResponse[SupportTicketList], error) + func (s *SupportService) MarkRead(ctx context.Context, ticketID string) (*APIResponse[map[string]any], error) + func (s *SupportService) Reply(ctx context.Context, ticketID string, req ReplySupportTicketRequest) (*APIResponse[SupportMessage], error) + type SupportTicket struct + AccountID *int64 + Category string + CreatedAt string + CustomerReadAt *string + Domain *string + Email string + ID string + Messages []SupportMessage + Name string + Priority string + StaffReadAt *string + Status string + Subject string + UpdatedAt string + type SupportTicketList struct + Items []SupportTicket + Page int + Pages int + Total int64 + type SupportUpload struct + Data string + Filename string + type Template struct + AccountID *int64 + Body string + Category string + Channel string + Components any + CreatedAt string + Design any + ID string + IsSystem bool + Language string + MetaTemplateID *string + MetaTemplateName *string + Name string + PreviewImageURL *string + RejectionReason *string + Revision int + Slug string + Status string + Subject string + TextBody string + UpdatedAt string + Variables any + type TemplateList struct + Items []Template + Limit int + Offset int + Total int64 + type TemplateListParams struct + Category string + Channel string + Limit int + Offset int + Search string + Status string + type TemplatePreview struct + CanSend bool + Channel string + RenderedBody string + RenderedText string + Status string + Subject string + type TemplatesService struct + func (s *TemplatesService) Create(ctx context.Context, req CreateTemplateRequest) (*APIResponse[Template], error) + func (s *TemplatesService) Delete(ctx context.Context, templateID string) (*APIResponse[map[string]string], error) + func (s *TemplatesService) Get(ctx context.Context, templateID string) (*APIResponse[Template], error) + func (s *TemplatesService) List(ctx context.Context, params TemplateListParams) (*APIResponse[TemplateList], error) + func (s *TemplatesService) Preview(ctx context.Context, templateID string, req PreviewTemplateRequest) (*APIResponse[TemplatePreview], error) + func (s *TemplatesService) SyncMeta(ctx context.Context, templateID string) (*APIResponse[Template], error) + func (s *TemplatesService) Update(ctx context.Context, templateID string, req UpdateTemplateRequest) (*APIResponse[Template], error) + type TrackingDetail struct + Events []TrackingEvent + Message TrackingMessage + type TrackingEvent struct + ClickURL *string + Engagement map[string]any + EventType string + ID string + OccurredAt string + RecipientEmail *string + type TrackingList struct + Messages []TrackingMessage + Summary TrackingSummary + type TrackingListParams struct + Limit int + Offset int + Status string + type TrackingMessage struct + AcceptedCount int + BouncedCount int + ClickCount int + CreatedAt string + DeliveredCount int + LastClickedAt *string + LastDeliveryEventAt *string + LastOpenedAt *string + OpenCount int + RecipientsCount int + SenderDomain string + Status string + Subject *string + TrackingID string + type TrackingSummary struct + Accepted int64 + Bounced int64 + Clicks int64 + Delivered int64 + Messages int64 + Opens int64 + Recipients int64 + type URLAttachment struct + FileName string + URL string + type UnitLedgerEntry struct + BalanceAfter int64 + CreatedAt string + Delta int64 + ID string + Reason string + Reference *string + type UnitPack struct + Description string + ID string + IsActive bool + Name string + PriceNGNMinor int64 + PriceUSDMinor int64 + SortOrder int + Units int64 + type UnitsService struct + func (s *UnitsService) Ledger(ctx context.Context, page, perPage int) (*APIResponse[Page[UnitLedgerEntry]], error) + func (s *UnitsService) Packs(ctx context.Context) (*APIResponse[Items[UnitPack]], error) + func (s *UnitsService) Purchase(ctx context.Context, req PurchaseUnitsRequest) (*APIResponse[map[string]any], error) + func (s *UnitsService) Summary(ctx context.Context) (*APIResponse[UnitsSummary], error) + type UnitsSummary struct + CanBuyCredits bool + IncludedAllowance int64 + IncludedRemaining int64 + IncludedUsed int64 + PurchasedBalance int64 + Unlimited bool + type UpdateDomainRequest struct + Domain string + IsDefault *bool + MailMode string + UseRootDomain *bool + type UpdateMailboxRequest struct + DisplayName string + Password string + type UpdateSMTPRelayRequest struct + IsDefault *bool + Name string + SMTPHost string + SMTPPassword string + SMTPPort int + SMTPSecurity string + SMTPUsername string + Status string + type UpdateTemplateRequest struct + Body string + Category string + Components any + Design any + Name string + Subject string + TextBody string + Variables any + type UploadedFile struct + ContentType *string + FileName string + PublicURL *string + SizeBytes int64 + type UploadedFileEnvelope struct + File UploadedFile + type VerificationCheck struct + ExpectedValue string + Host string + Matched bool + ObservedValues []string + RecordType string + type VerificationEnvelope struct + Verification DomainVerification + type WebhooksService struct + func (s *WebhooksService) ConstructEvent(payload []byte, signature, secret string, out any) error + func (s *WebhooksService) Sign(payload []byte, secret string) string + func (s *WebhooksService) VerifySignature(payload []byte, signature, secret string) bool