Documentation
¶
Index ¶
- Constants
- func AddContacts(apiKey string, data *AddContactData) (err error)
- func FieldDefinitions(apiKey string) (string, error)
- func GetRecipient(msg *sgmail.SGMailV3) (recipient string, err error)
- func MarketingLists(apiKey, pageToken string) (string, error)
- func WriteMIME(msg *sgmail.SGMailV3, path string) (err error)
- type AddContactData
- type Contact
- type CustomFields
Constants ¶
View Source
const ( Host = "https://api.sendgrid.com" ContactsEP = "/v3/marketing/contacts" ListsEP = "/v3/marketing/lists" FieldsEP = "/v3/marketing/field_definitions" )
Variables ¶
This section is empty.
Functions ¶
func AddContacts ¶ added in v0.5.0
func AddContacts(apiKey string, data *AddContactData) (err error)
Add contacts to SendGrid marketing lists.
func FieldDefinitions ¶ added in v0.5.0
Fetch field definitions from SendGrid.
func MarketingLists ¶ added in v0.5.0
Fetch lists of contacts from SendGrid.
Types ¶
type AddContactData ¶ added in v0.5.0
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"`
}
Contact contains contact information for a user, for adding users to marketing lists and sending emails.
func (Contact) FullName ¶
FullName attempts to construct the contact's full name from existing name fields.
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.
Click to show internal directories.
Click to hide internal directories.