Documentation
¶
Index ¶
- type CreateEmailDomainEndpoint
- type CreateEmailDomainRequest
- type CreateEmailInboxEndpoint
- type CreateEmailInboxRequest
- type DeleteEmailDomainEndpoint
- type DeleteEmailDomainRequest
- type DeleteEmailInboxEndpoint
- type DeleteEmailInboxRequest
- type EmailBridgeSvc
- type EmailBridgeSvcConfig
- type GetEmailDomainEndpoint
- type GetEmailDomainRequest
- type GetEmailInboxEndpoint
- type GetEmailInboxRequest
- type ListEmailDomainsEndpoint
- type ListEmailDomainsRequest
- type ListEmailInboxesEndpoint
- type ListEmailInboxesRequest
- type UpdateEmailInboxEndpoint
- type UpdateEmailInboxRequest
- type VerifyEmailDomainEndpoint
- type VerifyEmailDomainRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateEmailDomainEndpoint ¶
type CreateEmailDomainEndpoint struct{}
Registers a domain you own with the email bridge and returns the DKIM tokens to publish.
The domain starts in `pending`. Publish each returned token as a CNAME record in the domain's DNS, then call the verify action to move it to `verified`; only then can inboxes be created on it.
A domain can only be registered once across the platform, so registering one that is already in use returns a conflict error.
func (*CreateEmailDomainEndpoint) Materialize ¶
func (e *CreateEmailDomainEndpoint) Materialize() *apiendpoint.APIEndpoint[*CreateEmailDomainRequest, *apiresource.EmailDomain]
type CreateEmailDomainRequest ¶
type CreateEmailDomainRequest struct {
// The fully-qualified domain name to register (e.g. `support.acme.com`).
//
// Supply a bare domain, not an email address; the value is lowercased before it is stored.
Domain string `json:"domain" validate:"required"`
}
Request to register a sending/receiving domain with the email bridge.
func (*CreateEmailDomainRequest) SchemaExample ¶
func (*CreateEmailDomainRequest) SchemaExample() any
type CreateEmailInboxEndpoint ¶
type CreateEmailInboxEndpoint struct{}
Provisions a routable inbox address on a verified domain.
Once created, mail arriving at the address opens a customer case conversation and seats the bound agent and the group's members on it; a reply in a thread that already opened one joins that conversation instead.
func (*CreateEmailInboxEndpoint) Materialize ¶
func (e *CreateEmailInboxEndpoint) Materialize() *apiendpoint.APIEndpoint[*CreateEmailInboxRequest, *apiresource.EmailInbox]
type CreateEmailInboxRequest ¶
type CreateEmailInboxRequest struct {
// The verified domain this inbox belongs to.
EmailDomainID string `json:"email_domain_id" validate:"required"`
// The full inbox address (e.g. `support@acme.com`).
//
// Its domain part must match the selected domain, which must already be verified. The address is lowercased before it is stored, and it must not already be in use by another inbox.
Address string `json:"address" validate:"required"`
// Display name for the `From` header of outbound mail.
FromName field.Optional[string] `json:"from_name,omitzero"`
// The agent to bind to this inbox to handle incoming mail.
//
// With no agent bound, mail is still threaded into a conversation for your team, but nothing runs on it automatically.
AgentConfigID field.Optional[string] `json:"agent_config_id,omitzero"`
// How the bound agent decides whether to run on incoming mail.
//
// - `mention`: runs only when the agent is @mentioned, matched against the trigger keywords below.
// - `keyword`: runs when the message contains any of the trigger keywords.
// - `always`: runs on every incoming message.
//
// Leaving this unset makes the agent run on every incoming message, since email has no reliable @mention convention.
AgentTriggerPolicy field.Optional[constants.AgentTriggerPolicy] `json:"agent_trigger_policy,omitzero"`
// The keywords that decide whether the agent runs on an incoming message.
//
// Under the `keyword` policy a keyword matches anywhere in the message; under `mention` it only counts where it is prefixed with `@`.
AgentTriggerKeywords []string `json:"agent_trigger_keywords,omitzero"`
// The messaging group (roster) whose members are seated on every conversation this inbox opens.
//
// Must name a group in your own account. Agents in the group are seated to run only when @mentioned, so they do not all fire alongside the inbox's own agent.
GroupID field.Optional[string] `json:"group_id,omitzero"`
}
Request to provision a routable inbox on a verified domain.
func (*CreateEmailInboxRequest) SchemaExample ¶
func (*CreateEmailInboxRequest) SchemaExample() any
type DeleteEmailDomainEndpoint ¶
type DeleteEmailDomainEndpoint struct{}
Deregisters a domain from the email bridge and removes its sending identity from the mail provider.
Delete the domain's inboxes first: while any inbox still exists on it, this returns a conflict error.
func (*DeleteEmailDomainEndpoint) Materialize ¶
func (e *DeleteEmailDomainEndpoint) Materialize() *apiendpoint.APIEndpoint[*DeleteEmailDomainRequest, *apiresource.EmptyResource]
type DeleteEmailDomainRequest ¶
type DeleteEmailDomainRequest struct {
// Email domain ID.
ID string `path:"id" validate:"required"`
}
Request to delete an email domain.
type DeleteEmailInboxEndpoint ¶
type DeleteEmailInboxEndpoint struct{}
Removes an email inbox.
Mail sent to its address is no longer routed. Conversations the inbox already opened are kept, but replies can no longer be sent on them, so disable the inbox instead of deleting it if you still need to answer open threads.
func (*DeleteEmailInboxEndpoint) Materialize ¶
func (e *DeleteEmailInboxEndpoint) Materialize() *apiendpoint.APIEndpoint[*DeleteEmailInboxRequest, *apiresource.EmptyResource]
type DeleteEmailInboxRequest ¶
type DeleteEmailInboxRequest struct {
// Email inbox ID.
ID string `path:"id" validate:"required"`
}
Request to delete an email inbox.
type EmailBridgeSvc ¶
type EmailBridgeSvc interface {
CreateDomain(ctx context.Context, req *CreateEmailDomainRequest) (*apiresource.EmailDomain, *apierror.APIError)
ListDomains(ctx context.Context, req *ListEmailDomainsRequest) (*apiresource.List[apiresource.EmailDomain], *apierror.APIError)
GetDomain(ctx context.Context, req *GetEmailDomainRequest) (*apiresource.EmailDomain, *apierror.APIError)
VerifyDomain(ctx context.Context, req *VerifyEmailDomainRequest) (*apiresource.EmailDomain, *apierror.APIError)
DeleteDomain(ctx context.Context, req *DeleteEmailDomainRequest) (*apiresource.EmptyResource, *apierror.APIError)
CreateInbox(ctx context.Context, req *CreateEmailInboxRequest) (*apiresource.EmailInbox, *apierror.APIError)
ListInboxes(ctx context.Context, req *ListEmailInboxesRequest) (*apiresource.List[apiresource.EmailInbox], *apierror.APIError)
GetInbox(ctx context.Context, req *GetEmailInboxRequest) (*apiresource.EmailInbox, *apierror.APIError)
UpdateInbox(ctx context.Context, req *UpdateEmailInboxRequest) (*apiresource.EmailInbox, *apierror.APIError)
DeleteInbox(ctx context.Context, req *DeleteEmailInboxRequest) (*apiresource.EmptyResource, *apierror.APIError)
}
EmailBridgeSvc backs the email-domain and email-inbox management endpoints via the notification-service EmailBridgeService gRPC client. The account is derived from the caller identity propagated over gRPC metadata, so requests never embed it.
func NewEmailBridgeSvc ¶
func NewEmailBridgeSvc(config *EmailBridgeSvcConfig) EmailBridgeSvc
type EmailBridgeSvcConfig ¶
type EmailBridgeSvcConfig struct {
// EmailBridgeClient (required) is the notification-service EmailBridgeService gRPC client.
EmailBridgeClient pb.EmailBridgeServiceClient
}
type GetEmailDomainEndpoint ¶
type GetEmailDomainEndpoint struct{}
Returns a single email domain owned by the account.
func (*GetEmailDomainEndpoint) Materialize ¶
func (e *GetEmailDomainEndpoint) Materialize() *apiendpoint.APIEndpoint[*GetEmailDomainRequest, *apiresource.EmailDomain]
type GetEmailDomainRequest ¶
type GetEmailDomainRequest struct {
// Email domain ID.
ID string `path:"id" validate:"required"`
}
Request to read a single email domain.
type GetEmailInboxEndpoint ¶
type GetEmailInboxEndpoint struct{}
Returns a single email inbox owned by the account.
func (*GetEmailInboxEndpoint) Materialize ¶
func (e *GetEmailInboxEndpoint) Materialize() *apiendpoint.APIEndpoint[*GetEmailInboxRequest, *apiresource.EmailInbox]
type GetEmailInboxRequest ¶
type GetEmailInboxRequest struct {
// Email inbox ID.
ID string `path:"id" validate:"required"`
}
Request to read a single email inbox.
type ListEmailDomainsEndpoint ¶
type ListEmailDomainsEndpoint struct{}
Returns the account's registered email domains.
Every domain is returned in a single response; this list is not paginated.
func (*ListEmailDomainsEndpoint) Materialize ¶
func (e *ListEmailDomainsEndpoint) Materialize() *apiendpoint.APIEndpoint[*ListEmailDomainsRequest, *apiresource.List[apiresource.EmailDomain]]
type ListEmailDomainsRequest ¶
type ListEmailDomainsRequest struct{}
Request to list the account's registered email domains.
type ListEmailInboxesEndpoint ¶
type ListEmailInboxesEndpoint struct{}
Returns the account's email inboxes across every registered domain.
Every inbox is returned in a single response; this list is not paginated.
func (*ListEmailInboxesEndpoint) Materialize ¶
func (e *ListEmailInboxesEndpoint) Materialize() *apiendpoint.APIEndpoint[*ListEmailInboxesRequest, *apiresource.List[apiresource.EmailInbox]]
type ListEmailInboxesRequest ¶
type ListEmailInboxesRequest struct{}
Request to list the account's email inboxes.
type UpdateEmailInboxEndpoint ¶
type UpdateEmailInboxEndpoint struct{}
Edits an email inbox's from-name, status, agent configuration, and roster.
Every field except `status` is merged into the inbox's current settings: a field you omit — and an empty array you send — keeps the value it already has, so this endpoint can change a setting but cannot clear one back to unset. The inbox's address and domain are fixed at creation and cannot be changed here.
func (*UpdateEmailInboxEndpoint) Materialize ¶
func (e *UpdateEmailInboxEndpoint) Materialize() *apiendpoint.APIEndpoint[*UpdateEmailInboxRequest, *apiresource.EmailInbox]
type UpdateEmailInboxRequest ¶
type UpdateEmailInboxRequest struct {
// Email inbox ID.
ID string `path:"id" validate:"required"`
// Whether the inbox accepts mail.
//
// - `active`: inbound mail is threaded into a conversation.
// - `disabled`: the inbox stays provisioned and keeps its history, but inbound mail is dropped without being threaded.
Status constants.EmailInboxStatus `json:"status" validate:"required"`
// Display name for the `From` header of outbound mail.
FromName field.Optional[string] `json:"from_name,omitzero"`
// The agent to bind to this inbox to handle incoming mail.
AgentConfigID field.Optional[string] `json:"agent_config_id,omitzero"`
// How the bound agent decides whether to run on incoming mail.
//
// - `mention`: runs only when the agent is @mentioned, matched against the trigger keywords below.
// - `keyword`: runs when the message contains any of the trigger keywords.
// - `always`: runs on every incoming message.
//
// While no policy has been set, the agent runs on every incoming message, since email has no reliable @mention convention.
AgentTriggerPolicy field.Optional[constants.AgentTriggerPolicy] `json:"agent_trigger_policy,omitzero"`
// The keywords that decide whether the agent runs on an incoming message.
//
// Under the `keyword` policy a keyword matches anywhere in the message; under `mention` it only counts where it is prefixed with `@`.
AgentTriggerKeywords []string `json:"agent_trigger_keywords,omitzero"`
// The messaging group (roster) whose members are seated on every conversation this inbox opens.
//
// Must name a group in your own account. Changing it only affects conversations opened afterwards.
GroupID field.Optional[string] `json:"group_id,omitzero"`
}
Request to edit an email inbox's from-name, status, agent configuration, and roster.
func (*UpdateEmailInboxRequest) SchemaExample ¶
func (*UpdateEmailInboxRequest) SchemaExample() any
type VerifyEmailDomainEndpoint ¶
type VerifyEmailDomainEndpoint struct{}
Checks whether the domain's DKIM records have been published and marks it `verified` once they are confirmed.
Call this after publishing the DKIM records returned at registration. It is safe to call repeatedly: a domain whose records are not visible yet is returned unchanged in `pending`, and an already-verified domain is returned as-is without re-checking. DNS propagation can take a while, so expect to poll.
func (*VerifyEmailDomainEndpoint) Materialize ¶
func (e *VerifyEmailDomainEndpoint) Materialize() *apiendpoint.APIEndpoint[*VerifyEmailDomainRequest, *apiresource.EmailDomain]
type VerifyEmailDomainRequest ¶
type VerifyEmailDomainRequest struct {
// Email domain ID.
ID string `path:"id" validate:"required"`
}
Request to re-check a domain's DKIM verification status.
Source Files
¶
- endpoint_create_email_domain.go
- endpoint_create_email_inbox.go
- endpoint_delete_email_domain.go
- endpoint_delete_email_inbox.go
- endpoint_get_email_domain.go
- endpoint_get_email_inbox.go
- endpoint_list_email_domains.go
- endpoint_list_email_inboxes.go
- endpoint_update_email_inbox.go
- endpoint_verify_email_domain.go
- includes.go
- service.go