Documentation
¶
Overview ¶
Package messaging provides services for Intercom messaging and email.
MessagesService sends in-app and push messages. EmailsService manages email settings and custom addresses. SubscriptionsService handles subscription type configuration.
Index ¶
- type CreateMessageRequest
- type EmailSetting
- type EmailSettingList
- type EmailsService
- func (s *EmailsService) Get(ctx context.Context, id string) (*EmailSetting, error)
- func (s *EmailsService) GetRaw(ctx context.Context, id string) (*api.Result, error)
- func (s *EmailsService) List(ctx context.Context) (*EmailSettingList, error)
- func (s *EmailsService) ListRaw(ctx context.Context) (*api.Result, error)
- type Message
- type MessageRecipient
- type MessageSender
- type MessagesService
- type SubscriptionType
- type SubscriptionTypeList
- type SubscriptionsService
- type Translation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateMessageRequest ¶
type CreateMessageRequest struct {
MessageType string `json:"message_type"`
Subject string `json:"subject,omitempty"`
Body string `json:"body,omitempty"`
Template string `json:"template,omitempty"`
From MessageSender `json:"from"`
To MessageRecipient `json:"to"`
CC any `json:"cc,omitempty"`
BCC any `json:"bcc,omitempty"`
CreatedAt int64 `json:"created_at,omitempty"`
CreateConversationWithoutContactReply *bool `json:"create_conversation_without_contact_reply,omitempty"`
}
CreateMessageRequest represents the request body for creating a message.
type EmailSetting ¶
type EmailSetting struct {
Type string `json:"type"`
ID string `json:"id"`
Email string `json:"email,omitempty"`
Verified bool `json:"verified,omitempty"`
Domain string `json:"domain,omitempty"`
BrandID string `json:"brand_id,omitempty"`
ForwardingEnabled bool `json:"forwarding_enabled,omitempty"`
ForwardedEmailLastReceivedAt *int64 `json:"forwarded_email_last_received_at,omitempty"`
CreatedAt int64 `json:"created_at,omitempty"`
UpdatedAt int64 `json:"updated_at,omitempty"`
}
EmailSetting represents an Intercom email setting.
func ParseGetResult ¶
func ParseGetResult(r *api.Result) (*EmailSetting, error)
ParseGetResult decodes a Result into an EmailSetting.
type EmailSettingList ¶
type EmailSettingList struct {
Type string `json:"type"`
Data []EmailSetting `json:"data"`
}
EmailSettingList represents the response from the list emails endpoint.
func ParseListResult ¶
func ParseListResult(r *api.Result) (*EmailSettingList, error)
ParseListResult decodes a Result into an EmailSettingList.
type EmailsService ¶
type EmailsService struct {
// contains filtered or unexported fields
}
EmailsService handles communication with the email setting related methods of the Intercom API.
func NewEmailsService ¶
func NewEmailsService(c api.Caller) *EmailsService
NewEmailsService creates a new EmailsService.
func (*EmailsService) Get ¶
func (s *EmailsService) Get(ctx context.Context, id string) (*EmailSetting, error)
Get retrieves an email setting by ID.
See: https://developers.intercom.com/docs/references/rest-api/api.intercom.io/emails/retrieveemail
func (*EmailsService) GetRaw ¶
GetRaw retrieves an email setting by ID with the full HTTP result.
See: https://developers.intercom.com/docs/references/rest-api/api.intercom.io/emails/retrieveemail
func (*EmailsService) List ¶
func (s *EmailsService) List(ctx context.Context) (*EmailSettingList, error)
List returns all email settings.
See: https://developers.intercom.com/docs/references/rest-api/api.intercom.io/emails/listemails
func (*EmailsService) ListRaw ¶
ListRaw returns all email settings with the full HTTP result.
See: https://developers.intercom.com/docs/references/rest-api/api.intercom.io/emails/listemails
type Message ¶
type Message struct {
Type string `json:"type,omitempty"`
ID string `json:"id,omitempty"`
CreatedAt int64 `json:"created_at,omitempty"`
Subject string `json:"subject,omitempty"`
Body string `json:"body,omitempty"`
MessageType string `json:"message_type,omitempty"`
ConversationID string `json:"conversation_id,omitempty"`
}
Message represents an Intercom message.
type MessageRecipient ¶
MessageRecipient represents a recipient of a message.
type MessageSender ¶
MessageSender represents the sender of a message.
type MessagesService ¶
type MessagesService struct {
// contains filtered or unexported fields
}
MessagesService handles communication with the message related methods of the Intercom API.
func NewMessagesService ¶
func NewMessagesService(c api.Caller) *MessagesService
NewMessagesService creates a new MessagesService.
func (*MessagesService) Create ¶
func (s *MessagesService) Create(ctx context.Context, body *CreateMessageRequest) (*Message, error)
Create creates a new message initiated by an admin.
See: https://developers.intercom.com/docs/references/rest-api/api.intercom.io/messages/createmessage
func (*MessagesService) CreateRaw ¶
func (s *MessagesService) CreateRaw(ctx context.Context, body *CreateMessageRequest) (*api.Result, error)
CreateRaw creates a new message initiated by an admin and returns the full HTTP result.
See: https://developers.intercom.com/docs/references/rest-api/api.intercom.io/messages/createmessage
type SubscriptionType ¶
type SubscriptionType = api.SubscriptionType
SubscriptionType represents a subscription type in Intercom.
type SubscriptionTypeList ¶
type SubscriptionTypeList struct {
Type string `json:"type"`
Data []SubscriptionType `json:"data"`
}
SubscriptionTypeList represents the response from listing subscription types.
func ParseSubscriptionListResult ¶
func ParseSubscriptionListResult(r *api.Result) (*SubscriptionTypeList, error)
ParseSubscriptionListResult decodes a Result into a SubscriptionTypeList.
type SubscriptionsService ¶
type SubscriptionsService struct {
// contains filtered or unexported fields
}
SubscriptionsService handles communication with the subscription type related methods of the Intercom API.
func NewSubscriptionsService ¶
func NewSubscriptionsService(c api.Caller) *SubscriptionsService
NewSubscriptionsService creates a new SubscriptionsService.
func (*SubscriptionsService) List ¶
func (s *SubscriptionsService) List(ctx context.Context) (*SubscriptionTypeList, error)
List returns all subscription types for the workspace.
type Translation ¶
type Translation = api.Translation
Translation represents a localised version of a subscription type.