sendgrid

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	AddContactsEndpoint = "/v3/marketing/contacts"
)
View Source
const SUBSYTEM = "sendgrid"

Variables

This section is empty.

Functions

This section is empty.

Types

type AddContactsRequest

type AddContactsRequest struct {
	ListIds  []string  `json:"list_ids"`
	Contacts []Contact `json:"contacts"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(config *Config) *Client

func (*Client) AddContacts

func (s *Client) AddContacts(ctx context.Context, contacts []Contact) (*ImportContactsResponse, error)

type Config

type Config struct {
	Host           string   `yaml:"host" json:"host" mapstructure:"host" validate:"required,url"`             // sendgrid api host, usually https://api.sendgrid.com
	ApiKey         string   `yaml:"api_key" json:"api_key" mapstructure:"api_key" validate:"required"`        // sendgrid api key with appropriate permissions
	ContactListIds []string `yaml:"contact_list_ids" json:"contact_list_ids" mapstructure:"contact_list_ids"` // ids of the contact lists to which users should be added
}

type Contact

type Contact struct {
	Email        string      `json:"email"`
	CustomFields interface{} `json:"custom_fields,omitempty"`
}

type ImportContactsResponse

type ImportContactsResponse struct {
	JobId string `json:"job_id"`
}

Jump to

Keyboard shortcuts

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