Documentation
¶
Index ¶
- func Paginate[T any](fetch func(cursor string) ([]T, *Pagination, error)) ([]T, error)
- type APIError
- type APIKeyResponse
- type Attachment
- type Campaign
- type CampaignCreateResponse
- type CampaignListItem
- type Client
- func (c *Client) CheckContactSuppression(email, userID string) (*ContactSuppression, error)
- func (c *Client) CreateCampaign(req CreateCampaignRequest) (*CampaignCreateResponse, error)
- func (c *Client) CreateContact(req CreateContactRequest) (string, error)
- func (c *Client) CreateContactProperty(name, propType string) error
- func (c *Client) DeleteContact(email, userID string) error
- func (c *Client) FindContacts(params FindContactParams) ([]Contact, error)
- func (c *Client) GetAPIKey() (*APIKeyResponse, error)
- func (c *Client) GetCampaign(id string) (*Campaign, error)
- func (c *Client) GetEmailMessage(id string) (*EmailMessage, error)
- func (c *Client) ListCampaigns(params PaginationParams) ([]CampaignListItem, *Pagination, error)
- func (c *Client) ListContactProperties(customOnly bool) ([]ContactProperty, error)
- func (c *Client) ListMailingLists() ([]MailingList, error)
- func (c *Client) ListTransactional(params PaginationParams) ([]TransactionalEmail, *Pagination, error)
- func (c *Client) RemoveContactSuppression(email, userID string) (*ContactSuppressionRemoval, error)
- func (c *Client) SendEvent(req SendEventRequest) error
- func (c *Client) SendTransactional(req SendTransactionalRequest) error
- func (c *Client) UpdateCampaign(id string, req UpdateCampaignRequest) (*Campaign, error)
- func (c *Client) UpdateContact(req UpdateContactRequest) error
- func (c *Client) UpdateEmailMessage(id string, req UpdateEmailMessageRequest) (*EmailMessage, error)
- func (c *Client) WithUserAgent(ua string) *Client
- type Contact
- type ContactProperty
- type ContactSuppression
- type ContactSuppressionRemoval
- type CreateCampaignRequest
- type CreateContactRequest
- type EmailMessage
- type EmailMessageFields
- type FindContactParams
- type LmxWarning
- type MailingList
- type Pagination
- type PaginationParams
- type SendEventRequest
- type SendTransactionalRequest
- type TransactionalEmail
- type UpdateCampaignRequest
- type UpdateContactRequest
- type UpdateEmailMessageRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type APIKeyResponse ¶
type APIKeyResponse struct {
TeamName string `json:"teamName"`
}
type Attachment ¶
type CampaignCreateResponse ¶ added in v0.2.1
type CampaignListItem ¶ added in v0.3.0
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CheckContactSuppression ¶ added in v0.0.2
func (c *Client) CheckContactSuppression(email, userID string) (*ContactSuppression, error)
func (*Client) CreateCampaign ¶ added in v0.2.1
func (c *Client) CreateCampaign(req CreateCampaignRequest) (*CampaignCreateResponse, error)
func (*Client) CreateContact ¶
func (c *Client) CreateContact(req CreateContactRequest) (string, error)
func (*Client) CreateContactProperty ¶
func (*Client) DeleteContact ¶
func (*Client) FindContacts ¶
func (c *Client) FindContacts(params FindContactParams) ([]Contact, error)
func (*Client) GetAPIKey ¶
func (c *Client) GetAPIKey() (*APIKeyResponse, error)
func (*Client) GetCampaign ¶ added in v0.2.1
func (*Client) GetEmailMessage ¶ added in v0.2.1
func (c *Client) GetEmailMessage(id string) (*EmailMessage, error)
func (*Client) ListCampaigns ¶ added in v0.2.1
func (c *Client) ListCampaigns(params PaginationParams) ([]CampaignListItem, *Pagination, error)
func (*Client) ListContactProperties ¶
func (c *Client) ListContactProperties(customOnly bool) ([]ContactProperty, error)
func (*Client) ListMailingLists ¶
func (c *Client) ListMailingLists() ([]MailingList, error)
func (*Client) ListTransactional ¶
func (c *Client) ListTransactional(params PaginationParams) ([]TransactionalEmail, *Pagination, error)
func (*Client) RemoveContactSuppression ¶ added in v0.0.2
func (c *Client) RemoveContactSuppression(email, userID string) (*ContactSuppressionRemoval, error)
func (*Client) SendEvent ¶
func (c *Client) SendEvent(req SendEventRequest) error
func (*Client) SendTransactional ¶
func (c *Client) SendTransactional(req SendTransactionalRequest) error
func (*Client) UpdateCampaign ¶ added in v0.3.0
func (c *Client) UpdateCampaign(id string, req UpdateCampaignRequest) (*Campaign, error)
func (*Client) UpdateContact ¶
func (c *Client) UpdateContact(req UpdateContactRequest) error
func (*Client) UpdateEmailMessage ¶ added in v0.2.1
func (c *Client) UpdateEmailMessage(id string, req UpdateEmailMessageRequest) (*EmailMessage, error)
func (*Client) WithUserAgent ¶
type Contact ¶
type Contact struct {
ID string `json:"id"`
Email string `json:"email"`
FirstName *string `json:"firstName"`
LastName *string `json:"lastName"`
Source string `json:"source"`
Subscribed bool `json:"subscribed"`
UserGroup string `json:"userGroup"`
UserID *string `json:"userId"`
MailingLists map[string]bool `json:"mailingLists"`
OptInStatus *string `json:"optInStatus"`
Custom map[string]any `json:"-"`
}
func (Contact) MarshalJSON ¶ added in v0.0.4
func (*Contact) UnmarshalJSON ¶ added in v0.0.4
type ContactProperty ¶
type ContactSuppression ¶ added in v0.0.2
type ContactSuppressionRemoval ¶ added in v0.0.2
type CreateCampaignRequest ¶ added in v0.2.1
type CreateCampaignRequest struct {
Name string `json:"name"`
}
type CreateContactRequest ¶
type EmailMessage ¶ added in v0.2.1
type EmailMessage struct {
EmailMessageID string `json:"emailMessageId"`
CampaignID *string `json:"campaignId"`
Subject string `json:"subject"`
PreviewText string `json:"previewText"`
FromName string `json:"fromName"`
FromEmail string `json:"fromEmail"`
ReplyToEmail string `json:"replyToEmail"`
LMX string `json:"lmx"`
ContentRevisionID *string `json:"contentRevisionId"`
UpdatedAt string `json:"updatedAt"`
Warnings []LmxWarning `json:"warnings,omitempty"`
}
type EmailMessageFields ¶ added in v0.2.1
type EmailMessageFields struct {
Subject string `json:"subject,omitempty"`
PreviewText string `json:"previewText,omitempty"`
FromName string `json:"fromName,omitempty"`
FromEmail string `json:"fromEmail,omitempty"`
ReplyToEmail string `json:"replyToEmail,omitempty"`
LMX string `json:"lmx,omitempty"`
}
type FindContactParams ¶
type LmxWarning ¶ added in v0.2.1
type MailingList ¶
type Pagination ¶
type PaginationParams ¶
type SendEventRequest ¶
type SendTransactionalRequest ¶
type SendTransactionalRequest struct {
Email string `json:"email"`
TransactionalID string `json:"transactionalId"`
AddToAudience *bool `json:"addToAudience,omitempty"`
DataVariables map[string]any `json:"dataVariables,omitempty"`
Attachments []Attachment `json:"attachments,omitempty"`
IdempotencyKey string `json:"-"`
}
type TransactionalEmail ¶
type UpdateCampaignRequest ¶ added in v0.3.0
type UpdateCampaignRequest struct {
Name string `json:"name"`
}
type UpdateContactRequest ¶
type UpdateEmailMessageRequest ¶ added in v0.2.1
type UpdateEmailMessageRequest struct {
EmailMessageFields
Set map[string]bool
ExpectedRevisionID string
}
Click to show internal directories.
Click to hide internal directories.