sendgrid

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2026 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UpsertContactPayloadType       = "sendgrid.contact.upserted"
	UpsertContactFailedPayloadType = "sendgrid.contact.failed"
	UpsertContactFailedChannel     = "failed"
)
View Source
const (
	SendEmailPayloadType       = "sendgrid.email.sent"
	SendEmailFailedPayloadType = "sendgrid.email.failed"
	SendEmailFailedChannel     = "failed"
)
View Source
const EmailEventPayloadType = "sendgrid.email.event"

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	StatusCode int
	Body       string
}

func (*APIError) Error

func (e *APIError) Error() string

type Client

type Client struct {
	APIKey  string
	BaseURL string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(httpClient core.HTTPContext, ctx core.IntegrationContext) (*Client, error)

func (*Client) EnableEventWebhookSignature

func (c *Client) EnableEventWebhookSignature() (string, error)

func (*Client) GetEventWebhookSettings

func (c *Client) GetEventWebhookSettings() (*EventWebhookSettings, error)

func (*Client) SendEmail

func (c *Client) SendEmail(request MailSendRequest) (*MailSendResult, error)

func (*Client) UpdateEventWebhookSettings

func (c *Client) UpdateEventWebhookSettings(settings EventWebhookSettings) error

func (*Client) UpsertContact

func (c *Client) UpsertContact(request UpsertContactsRequest) (*UpsertContactResult, error)

func (*Client) Verify

func (c *Client) Verify() error

type Configuration

type Configuration struct {
	APIKey    string `json:"apiKey"`
	FromName  string `json:"fromName"`
	FromEmail string `json:"fromEmail"`
}

type ContactInput

type ContactInput struct {
	Email        string         `json:"email"`
	FirstName    string         `json:"first_name,omitempty"`
	LastName     string         `json:"last_name,omitempty"`
	CustomFields map[string]any `json:"custom_fields,omitempty"`
}

type CreateOrUpdateContact

type CreateOrUpdateContact struct{}

func (*CreateOrUpdateContact) Actions

func (c *CreateOrUpdateContact) Actions() []core.Action

func (*CreateOrUpdateContact) Cancel

func (*CreateOrUpdateContact) Cleanup

func (c *CreateOrUpdateContact) Cleanup(ctx core.SetupContext) error

func (*CreateOrUpdateContact) Color

func (c *CreateOrUpdateContact) Color() string

func (*CreateOrUpdateContact) Configuration

func (c *CreateOrUpdateContact) Configuration() []configuration.Field

func (*CreateOrUpdateContact) Description

func (c *CreateOrUpdateContact) Description() string

func (*CreateOrUpdateContact) Documentation

func (c *CreateOrUpdateContact) Documentation() string

func (*CreateOrUpdateContact) ExampleOutput

func (c *CreateOrUpdateContact) ExampleOutput() map[string]any

func (*CreateOrUpdateContact) Execute

func (*CreateOrUpdateContact) HandleAction

func (c *CreateOrUpdateContact) HandleAction(ctx core.ActionContext) error

func (*CreateOrUpdateContact) HandleWebhook

func (c *CreateOrUpdateContact) HandleWebhook(ctx core.WebhookRequestContext) (int, error)

func (*CreateOrUpdateContact) Icon

func (c *CreateOrUpdateContact) Icon() string

func (*CreateOrUpdateContact) Label

func (c *CreateOrUpdateContact) Label() string

func (*CreateOrUpdateContact) Name

func (c *CreateOrUpdateContact) Name() string

func (*CreateOrUpdateContact) OutputChannels

func (c *CreateOrUpdateContact) OutputChannels(configuration any) []core.OutputChannel

func (*CreateOrUpdateContact) ProcessQueueItem

func (c *CreateOrUpdateContact) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)

func (*CreateOrUpdateContact) Setup

type CreateOrUpdateContactConfiguration

type CreateOrUpdateContactConfiguration struct {
	Email        string         `json:"email" mapstructure:"email"`
	FirstName    string         `json:"firstName" mapstructure:"firstName"`
	LastName     string         `json:"lastName" mapstructure:"lastName"`
	ListIDs      []string       `json:"listIds" mapstructure:"listIds"`
	CustomFields map[string]any `json:"customFields" mapstructure:"customFields"`
}

type CreateOrUpdateContactFailure

type CreateOrUpdateContactFailure struct {
	Error        string `json:"error"`
	StatusCode   int    `json:"statusCode,omitempty"`
	ResponseBody string `json:"responseBody,omitempty"`
}

type CreateOrUpdateContactMetadata

type CreateOrUpdateContactMetadata struct {
	Email string `json:"email" mapstructure:"email"`
}

type EmailAddress

type EmailAddress struct {
	Email string `json:"email"`
	Name  string `json:"name,omitempty"`
}

type EmailContent

type EmailContent struct {
	Type  string `json:"type"`
	Value string `json:"value"`
}

type EventWebhookSettings

type EventWebhookSettings struct {
	Enabled          bool   `json:"enabled"`
	URL              string `json:"url"`
	Processed        bool   `json:"processed"`
	Delivered        bool   `json:"delivered"`
	Deferred         bool   `json:"deferred"`
	Bounce           bool   `json:"bounce"`
	Dropped          bool   `json:"dropped"`
	Open             bool   `json:"open"`
	Click            bool   `json:"click"`
	SpamReport       bool   `json:"spam_report"`
	Unsubscribe      bool   `json:"unsubscribe"`
	GroupUnsubscribe bool   `json:"group_unsubscribe"`
	GroupResubscribe bool   `json:"group_resubscribe"`
}

type MailSendRequest

type MailSendRequest struct {
	Personalizations []Personalization `json:"personalizations"`
	From             EmailAddress      `json:"from"`
	ReplyTo          *EmailAddress     `json:"reply_to,omitempty"`
	Subject          string            `json:"subject,omitempty"`
	Content          []EmailContent    `json:"content,omitempty"`
	TemplateID       string            `json:"template_id,omitempty"`
	Categories       []string          `json:"categories,omitempty"`
}

type MailSendResult

type MailSendResult struct {
	MessageID  string `json:"messageId"`
	StatusCode int    `json:"statusCode"`
	Status     string `json:"status"`
}

type Metadata

type Metadata struct {
}

type OnEmailEvent

type OnEmailEvent struct{}

func (*OnEmailEvent) Actions

func (t *OnEmailEvent) Actions() []core.Action

func (*OnEmailEvent) Cleanup

func (t *OnEmailEvent) Cleanup(ctx core.TriggerContext) error

func (*OnEmailEvent) Color

func (t *OnEmailEvent) Color() string

func (*OnEmailEvent) Configuration

func (t *OnEmailEvent) Configuration() []configuration.Field

func (*OnEmailEvent) Description

func (t *OnEmailEvent) Description() string

func (*OnEmailEvent) Documentation

func (t *OnEmailEvent) Documentation() string

func (*OnEmailEvent) ExampleData

func (t *OnEmailEvent) ExampleData() map[string]any

func (*OnEmailEvent) HandleAction

func (t *OnEmailEvent) HandleAction(ctx core.TriggerActionContext) (map[string]any, error)

func (*OnEmailEvent) HandleWebhook

func (t *OnEmailEvent) HandleWebhook(ctx core.WebhookRequestContext) (int, error)

func (*OnEmailEvent) Icon

func (t *OnEmailEvent) Icon() string

func (*OnEmailEvent) Label

func (t *OnEmailEvent) Label() string

func (*OnEmailEvent) Name

func (t *OnEmailEvent) Name() string

func (*OnEmailEvent) Setup

func (t *OnEmailEvent) Setup(ctx core.TriggerContext) error

type OnEmailEventConfiguration

type OnEmailEventConfiguration struct {
	EventTypes     []string                  `json:"eventTypes" mapstructure:"eventTypes"`
	CategoryFilter []configuration.Predicate `json:"categoryFilter" mapstructure:"categoryFilter"`
}

type Personalization

type Personalization struct {
	To                  []EmailAddress `json:"to,omitempty"`
	Cc                  []EmailAddress `json:"cc,omitempty"`
	Bcc                 []EmailAddress `json:"bcc,omitempty"`
	DynamicTemplateData map[string]any `json:"dynamic_template_data,omitempty"`
	Subject             string         `json:"subject,omitempty"`
}

type SendEmail

type SendEmail struct{}

func (*SendEmail) Actions

func (c *SendEmail) Actions() []core.Action

func (*SendEmail) Cancel

func (c *SendEmail) Cancel(ctx core.ExecutionContext) error

func (*SendEmail) Cleanup

func (c *SendEmail) Cleanup(ctx core.SetupContext) error

func (*SendEmail) Color

func (c *SendEmail) Color() string

func (*SendEmail) Configuration

func (c *SendEmail) Configuration() []configuration.Field

func (*SendEmail) Description

func (c *SendEmail) Description() string

func (*SendEmail) Documentation

func (c *SendEmail) Documentation() string

func (*SendEmail) ExampleOutput

func (c *SendEmail) ExampleOutput() map[string]any

func (*SendEmail) Execute

func (c *SendEmail) Execute(ctx core.ExecutionContext) error

func (*SendEmail) HandleAction

func (c *SendEmail) HandleAction(ctx core.ActionContext) error

func (*SendEmail) HandleWebhook

func (c *SendEmail) HandleWebhook(ctx core.WebhookRequestContext) (int, error)

func (*SendEmail) Icon

func (c *SendEmail) Icon() string

func (*SendEmail) Label

func (c *SendEmail) Label() string

func (*SendEmail) Name

func (c *SendEmail) Name() string

func (*SendEmail) OutputChannels

func (c *SendEmail) OutputChannels(configuration any) []core.OutputChannel

func (*SendEmail) ProcessQueueItem

func (c *SendEmail) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)

func (*SendEmail) Setup

func (c *SendEmail) Setup(ctx core.SetupContext) error

type SendEmailConfiguration

type SendEmailConfiguration struct {
	To           string         `json:"to" mapstructure:"to"`
	Subject      string         `json:"subject" mapstructure:"subject"`
	Body         string         `json:"body" mapstructure:"body"`
	Mode         string         `json:"mode" mapstructure:"mode"`
	HTMLBody     string         `json:"htmlBody" mapstructure:"htmlBody"`
	Cc           string         `json:"cc" mapstructure:"cc"`
	Bcc          string         `json:"bcc" mapstructure:"bcc"`
	FromName     string         `json:"fromName" mapstructure:"fromName"`
	FromEmail    string         `json:"fromEmail" mapstructure:"fromEmail"`
	ReplyTo      string         `json:"replyTo" mapstructure:"replyTo"`
	Categories   string         `json:"categories" mapstructure:"categories"`
	TemplateID   string         `json:"templateId" mapstructure:"templateId"`
	TemplateData map[string]any `json:"templateData" mapstructure:"templateData"`
}

type SendEmailFailure

type SendEmailFailure struct {
	Error        string `json:"error"`
	StatusCode   int    `json:"statusCode,omitempty"`
	ResponseBody string `json:"responseBody,omitempty"`
}

type SendEmailMetadata

type SendEmailMetadata struct {
	To        []string `json:"to" mapstructure:"to"`
	Subject   string   `json:"subject" mapstructure:"subject"`
	FromEmail string   `json:"fromEmail" mapstructure:"fromEmail"`
}

type SendGrid

type SendGrid struct{}

func (*SendGrid) Actions

func (s *SendGrid) Actions() []core.Action

func (*SendGrid) Cleanup

func (s *SendGrid) Cleanup(ctx core.IntegrationCleanupContext) error

func (*SendGrid) Components

func (s *SendGrid) Components() []core.Component

func (*SendGrid) Configuration

func (s *SendGrid) Configuration() []configuration.Field

func (*SendGrid) Description

func (s *SendGrid) Description() string

func (*SendGrid) HandleAction

func (s *SendGrid) HandleAction(ctx core.IntegrationActionContext) error

func (*SendGrid) HandleRequest

func (s *SendGrid) HandleRequest(ctx core.HTTPRequestContext)

func (*SendGrid) Icon

func (s *SendGrid) Icon() string

func (*SendGrid) Instructions

func (s *SendGrid) Instructions() string

func (*SendGrid) Label

func (s *SendGrid) Label() string

func (*SendGrid) ListResources

func (s *SendGrid) ListResources(resourceType string, ctx core.ListResourcesContext) ([]core.IntegrationResource, error)

func (*SendGrid) Name

func (s *SendGrid) Name() string

func (*SendGrid) Sync

func (s *SendGrid) Sync(ctx core.SyncContext) error

func (*SendGrid) Triggers

func (s *SendGrid) Triggers() []core.Trigger

type SendGridWebhookHandler

type SendGridWebhookHandler struct{}

func (*SendGridWebhookHandler) Cleanup

func (*SendGridWebhookHandler) CompareConfig

func (s *SendGridWebhookHandler) CompareConfig(a, b any) (bool, error)

func (*SendGridWebhookHandler) Setup

type SignedWebhookResponse

type SignedWebhookResponse struct {
	Enabled   bool   `json:"enabled"`
	PublicKey string `json:"public_key"`
}

type SignedWebhookSettings

type SignedWebhookSettings struct {
	Enabled bool `json:"enabled"`
}

type UpsertContactResult

type UpsertContactResult struct {
	JobID      string `json:"jobId"`
	StatusCode int    `json:"statusCode"`
	Status     string `json:"status"`
}

type UpsertContactsRequest

type UpsertContactsRequest struct {
	Contacts []ContactInput `json:"contacts"`
	ListIDs  []string       `json:"list_ids,omitempty"`
}

type UpsertContactsResponse

type UpsertContactsResponse struct {
	JobID string `json:"job_id"`
}

Jump to

Keyboard shortcuts

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