messaging

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 5 Imported by: 0

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

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

func (s *EmailsService) GetRaw(ctx context.Context, id string) (*api.Result, error)

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) ListRaw

func (s *EmailsService) ListRaw(ctx context.Context) (*api.Result, error)

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.

func ParseCreateResult

func ParseCreateResult(r *api.Result) (*Message, error)

ParseCreateResult decodes a Result into a Message.

type MessageRecipient

type MessageRecipient struct {
	Type string `json:"type"`
	ID   string `json:"id"`
}

MessageRecipient represents a recipient of a message.

type MessageSender

type MessageSender struct {
	Type string `json:"type"`
	ID   string `json:"id"`
}

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

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

List returns all subscription types for the workspace.

See: https://developers.intercom.com/docs/references/rest-api/api.intercom.io/subscription-types/listsubscriptiontypes

func (*SubscriptionsService) ListRaw

func (s *SubscriptionsService) ListRaw(ctx context.Context) (*api.Result, error)

ListRaw returns all subscription types with the full HTTP result.

See: https://developers.intercom.com/docs/references/rest-api/api.intercom.io/subscription-types/listsubscriptiontypes

type Translation

type Translation = api.Translation

Translation represents a localised version of a subscription type.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL