sendgrid

package
v1.38.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Context context.Context
	Client  *rest.Client
	Key     string
}

func New

func New(c context.Context, settings integration.SendGrid) *API

func (API) Request

func (api API) Request(method string, url string, params map[string]string, body []byte) (*rest.Response, error)

Make a single API call to Sendgrid

func (API) Send

func (api API) Send(message *email.Message) error

Send email

func (API) Subscribe

func (api API) Subscribe(list *email.List, sub *email.Subscriber) error

Add subscriber to list

func (API) UpdateContact

func (api API) UpdateContact(sub *email.Subscriber) (*Contact, error)

Update or create contact if it doesn't exist

type Contact

type Contact struct {
	Id string `json:"id"`
}

type ContactResponse

type ContactResponse struct {
	NewCount            int      `json:"new_count"`
	UpdatedCounti       int      `json:"unmodified_count"`
	ErrorCount          int      `json:"error_count"`
	ErrorIndices        []int    `json:"error_indices"`
	Errors              []Error  `json:"errors"`
	PersistedRecipients []string `json:"persisted_recipients"`
}

type Error

type Error struct {
	Message      string `json:"message"`
	ErrorIndices []int  `json:"error_indices"`
}

Jump to

Keyboard shortcuts

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