Versions in this module Expand all Collapse all v1 v1.3.0 Oct 16, 2026 Changes in this version type Client + func (c *Client) GetClickBrowserStats(ctx context.Context, p *Params) (*OutboundClickBrowserStats, error) + func (c *Client) GetOpenEmailClientStats(ctx context.Context, p *Params) (*OutboundOpenEmailClientStats, error) + func (c *Client) ValidateTemplate(ctx context.Context, t *TemplateToValidate) (*TemplateValidation, error) + type NamedCountStat struct + Counts map[string]int + Date *Time + func (s *NamedCountStat) UnmarshalJSON(b []byte) error + type NamedCountStats struct + Days []NamedCountStat + Totals map[string]int + func (s *NamedCountStats) UnmarshalJSON(b []byte) error + type OutboundClickBrowserStats = NamedCountStats + type OutboundOpenEmailClientStats = NamedCountStats type PlatformStat + WebMail int + type PlatformStats struct + Days []PlatformStat + Desktop int + Mobile int + Unknown int + WebMail int + type TemplateValidationError struct + CharacterPosition int + Line int + Message string v1.2.0 Oct 12, 2026 v1.1.0 Oct 7, 2026 Changes in this version + const TrackLinksHTMLOnly + const TrackLinksTextOnly + type DNSRecord struct + Name string + RecordType string + Valid int + Value string type DomainDetails + SPFHost string + SPFTextValue *DNSRecord type MessageStreamArchiveResponse + ArchivedAt *Time type OutboundStats + ClickRate float64 + Clicked int + OpenRate float64 + Opened int + Unsubscribed int v1.0.0 Oct 5, 2026 Changes in this version + const AccountTokenHeader + const DefaultAPIURL + const DefaultConnectTimeout + const DefaultReadTimeout + const MessageStreamBroadcasts + const MessageStreamInbound + const MessageStreamTransactional + const ServerTokenHeader + const TemplateTypeLayout + const TemplateTypeStandard + const TrackLinksHTML + const TrackLinksHTMLAndText + const TrackLinksNone + const TrackLinksText + const Version + var ErrInternalServer = errors.New("haskimail: внутренняя ошибка сервера") + var ErrInvalidAPIKey = errors.New("haskimail: неверный API-токен") + var ErrInvalidMessage = errors.New("haskimail: некорректный запрос") + var ErrTimeout = errors.New("haskimail: таймаут запроса") + var ErrUnknown = errors.New("haskimail: неизвестная ошибка") + var TimeLocation = time.Local + func Bool(v bool) *bool + func FormatRecipients(rs ...Recipient) string + func FormatRecipientsMap(m map[string]string) string + func Int(v int) *int + func ParseTime(s string) (time.Time, error) + func String(v string) *string + type AccountClient struct + func NewAccountClient(accountToken string, opts ...Option) *AccountClient + func (b AccountClient) BaseURL() string + func (c *AccountClient) CreateDomain(ctx context.Context, d *Domain) (*DomainDetails, error) + func (c *AccountClient) CreateSenderSignature(ctx context.Context, s *SignatureToCreate) (*SignatureDetails, error) + func (c *AccountClient) CreateServer(ctx context.Context, s *Server) (*Server, error) + func (c *AccountClient) DeleteDomain(ctx context.Context, id int64) (*RequestResponse, error) + func (c *AccountClient) DeleteSenderSignature(ctx context.Context, id int64) (*RequestResponse, error) + func (c *AccountClient) DeleteServer(ctx context.Context, id int64) (*RequestResponse, error) + func (c *AccountClient) GetDomainDetails(ctx context.Context, id int64) (*DomainDetails, error) + func (c *AccountClient) GetDomains(ctx context.Context) (*Domains, error) + func (c *AccountClient) GetSenderSignatureDetails(ctx context.Context, id int64) (*SignatureDetails, error) + func (c *AccountClient) GetSenderSignatures(ctx context.Context, p *Params) (*Signatures, error) + func (c *AccountClient) GetServer(ctx context.Context, id int64) (*Server, error) + func (c *AccountClient) GetServers(ctx context.Context, p *Params) (*Servers, error) + func (c *AccountClient) PushTemplates(ctx context.Context, r *TemplatesPushRequest) (*TemplatesPush, error) + func (c *AccountClient) RequestNewSenderSignatureDKIM(ctx context.Context, id int64) (*RequestResponse, error) + func (c *AccountClient) ResendSenderSignatureConfirmation(ctx context.Context, id int64) (*RequestResponse, error) + func (c *AccountClient) SetDomain(ctx context.Context, id int64, d *Domain) (*DomainDetails, error) + func (c *AccountClient) SetSenderSignature(ctx context.Context, id int64, s *SignatureToCreate) (*SignatureDetails, error) + func (c *AccountClient) SetServer(ctx context.Context, id int64, s *Server) (*Server, error) + func (c *AccountClient) VerifyDomainDKIM(ctx context.Context, id int64) (*DomainDetails, error) + func (c *AccountClient) VerifyDomainSPF(ctx context.Context, id int64) (*DomainDetails, error) + func (c *AccountClient) VerifySenderSignatureSPF(ctx context.Context, id int64) (*SignatureDetails, error) + type Attachment struct + Content string + ContentID string + ContentLength int + ContentType string + Name string + func AttachmentFromFile(path, contentID string) (Attachment, error) + func NewAttachment(name string, content []byte, contentType, contentID string) Attachment + type BaseTemplate struct + Active *bool + Alias string + LayoutTemplate string + Name string + TemplateID int64 + TemplateType string + type Bounce struct + BouncedAt *Time + CanActivate bool + Content string + Description string + Details string + DumpAvailable bool + Email string + From string + ID int64 + Inactive bool + MessageID string + MessageStream string + Name string + RecordType string + ServerID int64 + Subject string + Tag string + Type string + TypeCode int + type BounceStat struct + DMARCPolicy int + Date *Time + HardBounce int + SMTPAPIError int + SoftBounce int + Subscribe int + Transient int + Unknown int + type BounceType struct + Count int + Name string + Type string + type BounceWebhook struct + Metadata map[string]string + type BounceWebhookTrigger struct + Enabled *bool + IncludeContent *bool + type Bounces struct + Bounces []Bounce + TotalCount int + type ClickLocationStat struct + Date *Time + HTML int + Text int + type ClickStat struct + Clicks int + Date *Time + Unique int + type ClickWebhook struct + Metadata map[string]string + type Client struct + func NewClient(serverToken string, opts ...Option) *Client + func (b Client) BaseURL() string + func (c *Client) ActivateBounce(ctx context.Context, id int64) (*Bounce, error) + func (c *Client) ArchiveMessageStream(ctx context.Context, id string) (*MessageStreamArchiveResponse, error) + func (c *Client) CreateMessageStream(ctx context.Context, s *MessageStream) (*MessageStream, error) + func (c *Client) CreateSuppressions(ctx context.Context, messageStream string, e SuppressionEntries) (*SuppressionStatuses, error) + func (c *Client) CreateTemplate(ctx context.Context, t *Template) (*Template, error) + func (c *Client) CreateWebhook(ctx context.Context, w *Webhook) (*Webhook, error) + func (c *Client) DeleteSuppressions(ctx context.Context, messageStream string, e SuppressionEntries) (*SuppressionStatuses, error) + func (c *Client) DeleteTemplate(ctx context.Context, id int64) (*RequestResponse, error) + func (c *Client) DeleteTemplateByAlias(ctx context.Context, alias string) (*RequestResponse, error) + func (c *Client) DeleteWebhook(ctx context.Context, id int64) (*RequestResponse, error) + func (c *Client) DeliverMessage(ctx context.Context, m *Message) (*MessageResponse, error) + func (c *Client) DeliverMessageWithTemplate(ctx context.Context, m *TemplatedMessage) (*MessageResponse, error) + func (c *Client) DeliverMessages(ctx context.Context, ms []Message) ([]MessageResponse, error) + func (c *Client) DeliverMessagesWithTemplate(ctx context.Context, ms []TemplatedMessage) ([]MessageResponse, error) + func (c *Client) GetBounce(ctx context.Context, id int64) (*Bounce, error) + func (c *Client) GetBounceStats(ctx context.Context, p *Params) (*OutboundBounceStats, error) + func (c *Client) GetBounces(ctx context.Context, p *Params) (*Bounces, error) + func (c *Client) GetClickLocationStats(ctx context.Context, p *Params) (*OutboundClickLocationStats, error) + func (c *Client) GetClickPlatformStats(ctx context.Context, p *Params) (*OutboundClickPlatformStats, error) + func (c *Client) GetClickStats(ctx context.Context, p *Params) (*OutboundClickStats, error) + func (c *Client) GetDeliveryStats(ctx context.Context) (*DeliveryStats, error) + func (c *Client) GetMessageClicks(ctx context.Context, p *Params) (*OutboundMessageClicks, error) + func (c *Client) GetMessageClicksByID(ctx context.Context, messageID string, p *Params) (*OutboundMessageClicks, error) + func (c *Client) GetMessageDetails(ctx context.Context, messageID string) (*OutboundMessageDetails, error) + func (c *Client) GetMessageOpens(ctx context.Context, p *Params) (*OutboundMessageOpens, error) + func (c *Client) GetMessageOpensByID(ctx context.Context, messageID string, p *Params) (*OutboundMessageOpens, error) + func (c *Client) GetMessageStream(ctx context.Context, id string) (*MessageStream, error) + func (c *Client) GetMessageStreams(ctx context.Context) (*MessageStreams, error) + func (c *Client) GetMessages(ctx context.Context, p *Params) (*OutboundMessages, error) + func (c *Client) GetOpenPlatformStats(ctx context.Context, p *Params) (*OutboundOpenPlatformStats, error) + func (c *Client) GetOpenStats(ctx context.Context, p *Params) (*OutboundOpenStats, error) + func (c *Client) GetOutboundStats(ctx context.Context, p *Params) (*OutboundStats, error) + func (c *Client) GetSendStats(ctx context.Context, p *Params) (*OutboundSendStats, error) + func (c *Client) GetSpamStats(ctx context.Context, p *Params) (*OutboundSpamStats, error) + func (c *Client) GetSuppressions(ctx context.Context, messageStream string, p *Params) (*Suppressions, error) + func (c *Client) GetTemplate(ctx context.Context, id int64) (*Template, error) + func (c *Client) GetTemplateByAlias(ctx context.Context, alias string) (*Template, error) + func (c *Client) GetTemplates(ctx context.Context, p *Params) (*Templates, error) + func (c *Client) GetWebhook(ctx context.Context, id int64) (*Webhook, error) + func (c *Client) GetWebhooks(ctx context.Context, p *Params) (*Webhooks, error) + func (c *Client) SetMessageStream(ctx context.Context, id string, s *MessageStream) (*MessageStream, error) + func (c *Client) SetTemplate(ctx context.Context, id int64, t *Template) (*Template, error) + func (c *Client) SetTemplateByAlias(ctx context.Context, alias string, t *Template) (*Template, error) + func (c *Client) SetWebhook(ctx context.Context, id int64, w *Webhook) (*Webhook, error) + func (c *Client) UnarchiveMessageStream(ctx context.Context, id string) (*MessageStreamUnarchiveResponse, error) + type DayStats struct + Days []T + type DeliveryStats struct + Bounces []BounceType + InactiveMails int + type DeliveryWebhook struct + DeliveredAt *Time + Details string + MessageID string + MessageStream string + Metadata map[string]string + Recipient string + RecordType string + ServerID int64 + Tag string + type Domain struct + DKIMVerified bool + ID int64 + Name string + ReturnPathDomainVerified bool + SPFVerified bool + WeakDKIM bool + type DomainDetails struct + DKIMHost string + DKIMPendingHost string + DKIMPendingTextValue string + DKIMRevokedHost string + DKIMRevokedTextValue string + DKIMTextValue string + DKIMUpdateStatus string + ReturnPathDomain string + ReturnPathDomainCNAMEValue string + SafeToRemoveRevokedKeyFromDNS bool + type Domains struct + Domains []Domain + TotalCount int + type Error struct + Body []byte + ErrorCode int + Message string + StatusCode int + func (e *Error) Error() string + func (e *Error) Unwrap() error + type HTTPAuth struct + Password string + Username string + type Header struct + Name string + Value string + type Message struct + Attachments []Attachment + Bcc string + Cc string + From string + HTMLBody string + Headers []Header + MessageStream string + Metadata map[string]string + ReplyTo string + Subject string + Tag string + TextBody string + To string + TrackLinks string + TrackOpens *bool + func (m *Message) AddAttachment(a Attachment) + func (m *Message) AddHeader(name, value string) + func (m *Message) AddMetadata(key, value string) + type MessageResponse struct + Bcc string + Cc string + ErrorCode int + Message string + MessageID string + SubmittedAt *Time + To string + type MessageStream struct + ArchivedAt *Time + CreatedAt *Time + Description string + ID string + MessageStreamType string + Name string + ServerID int64 + SubscriptionManagementConfiguration *SubscriptionManagementConfiguration + UpdatedAt *Time + type MessageStreamArchiveResponse struct + ExpectedPurgeDate *Time + ID string + ServerID int64 + type MessageStreamUnarchiveResponse = MessageStream + type MessageStreams struct + MessageStreams []MessageStream + TotalCount int + type OpenStat struct + Date *Time + Opens int + Unique int + type OpenWebhook struct + FirstOpen bool + Metadata map[string]string + type OpenWebhookTrigger struct + Enabled *bool + PostFirstOpenOnly *bool + type Option func(*config) + func WithBaseURL(host string) Option + func WithConnectTimeout(d time.Duration) Option + func WithHTTPClient(hc *http.Client) Option + func WithHeader(name, value string) Option + func WithInsecure() Option + func WithReadTimeout(d time.Duration) Option + func WithSecureConnection(secure bool) Option + func WithUserAgent(ua string) Option + type OutboundBounceStats = DayStats[BounceStat] + type OutboundClickLocationStats = DayStats[ClickLocationStat] + type OutboundClickPlatformStats = DayStats[PlatformStat] + type OutboundClickStats = DayStats[ClickStat] + type OutboundMessage struct + From string + MessageID string + MessageStream string + ReceivedAt *Time + Recipient string + Status string + Subject string + Tag string + type OutboundMessageClick struct + ClickLocation string + OriginalLink string + type OutboundMessageClicks struct + Clicks []OutboundMessageClick + TotalCount int + type OutboundMessageDetails struct + Body string + HTMLBody string + MessageEvents []OutboundMessageDetailsEvent + TextBody string + type OutboundMessageDetailsEvent struct + Details map[string]string + ReceivedAt *Time + Recipient string + Type string + type OutboundMessageOpen struct + Browser string + Country string + From string + Language string + MessageID string + MessageStream string + OS string + ReceivedAt *Time + Recipient string + RecordType string + Region string + Subject string + Tag string + UserAgent string + Webservice string + type OutboundMessageOpens struct + Opens []OutboundMessageOpen + TotalCount int + type OutboundMessages struct + Messages []OutboundMessage + TotalCount int + type OutboundOpenPlatformStats = DayStats[PlatformStat] + type OutboundOpenStats = DayStats[OpenStat] + type OutboundSendStats = DayStats[SentStat] + type OutboundSpamStats = DayStats[SpamStat] + type OutboundStats struct + BounceRate float64 + Bounced int + Opens int + SMTPAPIErrors int + Sent int + SpamComplaints int + SpamComplaintsRate float64 + TotalClicks int + TotalTrackedLinksSent int + Tracked int + UniqueLinksClicked int + UniqueOpens int + WithClientRecorded int + WithLinkTracking int + WithOpenTracking int + WithPlatformRecorded int + WithReadTimeRecorded int + type Params struct + func NewParams() *Params + func (p *Params) Bool(name string, value bool) *Params + func (p *Params) Date(name string, value time.Time) *Params + func (p *Params) Encode() string + func (p *Params) Int(name string, value int) *Params + func (p *Params) String(name, value string) *Params + type PlatformStat struct + Date *Time + Desktop int + Mobile int + Unknown int + Webmail int + type Recipient struct + Email string + Name string + type RequestResponse struct + ErrorCode int + Message string + type SentStat struct + Date *Time + Sent int + type Server struct + APITokens []string + BounceHookURL string + ClickHookURL string + Color string + DeliveryHookURL string + DeliveryType string + EnableSMTPAPIErrorHooks *bool + ID int64 + InboundAddress string + InboundDomain string + InboundHash string + InboundSpamThreshold *int + IncludeBounceContentInHook *bool + Name string + OpenHookURL string + PostFirstOpenOnly *bool + RawEmailEnabled *bool + SMTPAPIActivated *bool + ServerLink string + TrackLinks string + TrackOpens *bool + type Servers struct + Servers []Server + TotalCount int + type Signature struct + Confirmed bool + Domain string + EmailAddress string + ID int64 + Name string + ReplyToEmailAddress string + type SignatureDetails struct + ConfirmationPersonalNote string + DKIMHost string + DKIMTextValue string + DKIMVerified bool + ReturnPathDomain string + ReturnPathDomainCNAMEValue string + ReturnPathDomainVerified bool + SPFVerified bool + type SignatureToCreate struct + ConfirmationPersonalNote string + FromEmail string + Name string + ReplyToEmail string + ReturnPathDomain string + type Signatures struct + SenderSignatures []Signature + TotalCount int + type SpamStat struct + Date *Time + SpamComplaint int + type SpamWebhookTrigger = BounceWebhookTrigger + type SubscriptionChange = WebhookTrigger + type SubscriptionManagementConfiguration struct + UnsubscribeHandlingType string + type Suppression struct + CreatedAt *Time + EmailAddress string + Origin string + SuppressionReason string + type SuppressionEntries struct + Suppressions []SuppressionEntry + func NewSuppressionEntries(emails ...string) SuppressionEntries + type SuppressionEntry struct + EmailAddress string + type SuppressionStatus struct + EmailAddress string + Message string + Status string + type SuppressionStatuses struct + Suppressions []SuppressionStatus + type Suppressions struct + Suppressions []Suppression + type Template struct + AssociatedServerID int64 + HTMLBody string + Subject string + TextBody string + type TemplateContent struct + HTMLBody string + Subject string + TextBody string + type TemplateToValidate struct + HTMLBody string + InlineCSSForHTMLTestRender *bool + LayoutTemplate string + Subject string + TemplateType string + TestRenderModel any + TextBody string + type TemplateValidation struct + AllContentIsValid bool + HTMLBody *TemplateValidationField + Subject *TemplateValidationField + SuggestedTemplateModel any + TextBody *TemplateValidationField + type TemplateValidationField struct + ContentIsValid bool + RenderedContent string + ValidationErrors []string + type TemplatedMessage struct + Attachments []Attachment + Bcc string + Cc string + From string + Headers []Header + InlineCSS *bool + MessageStream string + Metadata map[string]string + ReplyTo string + Tag string + TemplateAlias string + TemplateID int64 + TemplateModel any + To string + TrackLinks string + TrackOpens *bool + func (m *TemplatedMessage) AddAttachment(a Attachment) + func (m *TemplatedMessage) AddHeader(name, value string) + func (m *TemplatedMessage) AddMetadata(key, value string) + type Templates struct + Templates []BaseTemplate + TotalCount int + type TemplatesPush struct + Templates []TemplatesPushAction + TotalCount int + type TemplatesPushAction struct + Action string + Alias string + Name string + TemplateID int64 + type TemplatesPushRequest struct + DestinationServerID int64 + PerformChanges *bool + SourceServerID int64 + type Time struct + func (t *Time) UnmarshalJSON(b []byte) error + func (t Time) MarshalJSON() ([]byte, error) + type Webhook struct + HTTPAuth *HTTPAuth + HTTPHeaders []Header + ID int64 + MessageStream string + Triggers *WebhookTriggers + URL string + type WebhookTrigger struct + Enabled *bool + type WebhookTriggers struct + Bounce *BounceWebhookTrigger + Click *WebhookTrigger + Delivery *WebhookTrigger + Open *OpenWebhookTrigger + SpamComplaint *SpamWebhookTrigger + SubscriptionChange *SubscriptionChange + type Webhooks struct + Webhooks []Webhook