sendgrid

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2023 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Host     = "https://api.sendgrid.com"
	Contacts = "/v3/marketing/contacts"
)

Variables

This section is empty.

Functions

func GetRecipient

func GetRecipient(msg *sgmail.SGMailV3) (recipient string, err error)

func WriteMIME

func WriteMIME(msg *sgmail.SGMailV3, path string) (err error)

Types

type AddContact

type AddContact struct {
	ListIDs  []string   `json:"list_ids"`
	Contacts []*Contact `json:"contacts"`
}

type Contact

type Contact struct {
	FirstName    string        `json:"first_name"`
	LastName     string        `json:"last_name"`
	Email        string        `json:"email"`
	Country      string        `json:"country"`
	CustomFields *CustomFields `json:"custom_fields"`
}

func (Contact) FullName

func (c Contact) FullName() string

FullName attempts to construct the contact's full name from existing name fields.

func (Contact) NewEmail

func (c Contact) NewEmail() *mail.Email

NewEmail returns the sendgrid email object for constructing emails.

type CustomFields

type CustomFields struct {
	Title                string `json:"e1_T"`
	Organization         string `json:"e2_T"`
	CloudServiceProvider string `json:"e3_T"`
}

TODO: make custom fields request to get field IDs rather than hardcoding.

Jump to

Keyboard shortcuts

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