openapi

package
v4.0.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2024 License: MIT Imports: 4 Imported by: 0

README

Go API client for

The Twilio SendGrid v3 Mail API allows you to send email at scale over HTTP. The Mail Send endpoint supports many levels of functionality, allowing you to send templates, set categories and custom arguments that can be used to analyze your send, and configure which tracking settings to include such as opens and clicks. You can also group mail sends into batches, allowing you to schedule and cancel sends by their batch IDs.

Overview

This API client was generated by the OpenAPI Generator project from the OpenAPI specs located at twilio/sendgrid-oai. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: 1.0.0
  • Package version:
  • Build date: 2024-10-04T18:29:01.956960+05:30[Asia/Kolkata]
  • Build package: com.sendgrid.oai.go.SendgridGoGenerator For more information, please visit https://support.sendgrid.com/hc/en-us

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/net/context

Put the package under your project folder and add the following in import:

import "./"

Documentation for API Endpoints

All URIs are relative to https://api.sendgrid.com

Class Method HTTP request Description
CreateMailBatch CreateMailBatch Post /v3/mail/batch Create a batch ID.
GetMailBatch GetMailBatch Get /v3/mail/batch/{BatchId} Validate a batch ID.
SendMail SendMail Post /v3/mail/send Send Email with Twilio SendGrid.

Documentation For Models

Documentation For Authorization

BearerAuth

  • Type: HTTP basic authentication

Example

auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{
    UserName: "username",
    Password: "password",
})
r, err := client.Service.Operation(auth, args)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiService

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

func NewApiService

func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService

func NewApiServiceWithClient

func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService

func (*ApiService) CreateMailBatch

func (c *ApiService) CreateMailBatch(params *CreateMailBatchParam) (interface{}, error)

**This operation allows you to generate a new mail batch ID.** Once a batch ID is created, you can associate it with a mail send by passing it in the request body of the [Mail Send operation](https://docs.sendgrid.com/api-reference/mail-send/mail-send). This makes it possible to group multiple requests to the Mail Send operation by assigning them the same batch ID. A batch ID that's associated with a mail send can be used to access and modify the associated send. For example, you can pause or cancel a send using its batch ID. See the [Scheduled Sends API](https://www.twilio.com/docs/sendgrid/api-reference/cancel-scheduled-sends) for more information about pausing and cancelling a mail send.

func (*ApiService) GetMailBatch

func (c *ApiService) GetMailBatch(params *GetMailBatchParam) (interface{}, error)

**This operation allows you to validate a mail batch ID.** If you provide a valid batch ID, this operation will return a `200` status code and the batch ID itself. If you provide an invalid batch ID, you will receive a `400` level status code and an error message. A batch ID does not need to be assigned to a send to be considered valid. A successful response means only that the batch ID has been created, but it does not indicate that the ID has been assigned to a send.

func (*ApiService) SendMail

func (c *ApiService) SendMail(params *SendMailParam) (interface{}, error)

*The Mail Send operation allows you to send email over SendGrid's v3 Web API* For an overview of this API, including its features and limitations, please see the [Mail Send API overview page](https://www.twilio.com/docs/sendgrid/api-reference/mail-send) The overview page also includes links to SendGrid's Email API quickstarts and helper libraries to get you working with this endpoint even faster.

type ContentEncoding

type ContentEncoding string

ContentEncoding the model 'ContentEncoding'

const (
	CONTENTENCODING_GZIP ContentEncoding = "gzip"
)

List of ContentEncoding

type CreateMailBatchParam

type CreateMailBatchParam struct {
	// Use the `on-behalf-of` header to make API calls for a particular Subuser through the parent account. You can use this header to automate bulk updates or to administer a Subuser without changing the authentication in your code. You will use the parent account's API key when using this header.
	Onbehalfof *string `json:"on-behalf-of,omitempty"`
}

func (*CreateMailBatchParam) SetOnbehalfof

func (params *CreateMailBatchParam) SetOnbehalfof(Onbehalfof string) *CreateMailBatchParam

type Disposition

type Disposition string

Disposition the model 'Disposition'

const (
	DISPOSITION_INLINE     Disposition = "inline"
	DISPOSITION_ATTACHMENT Disposition = "attachment"
)

List of Disposition

type ErrorResponse

type ErrorResponse struct {
	Errors *[]ErrorResponseErrorsInner `json:"errors,omitempty"`
	// When applicable, this property value will be an error ID.
	Id *string `json:"id,omitempty"`
}

ErrorResponse struct for ErrorResponse

type ErrorResponseErrorsInner

type ErrorResponseErrorsInner struct {
	// An error message.
	Message *string `json:"message,omitempty"`
	// When applicable, this property value will be the field that generated the error.
	Field *string `json:"field,omitempty"`
	// When applicable, this property value will be helper text or a link to documentation to help you troubleshoot the error.
	Help *map[string]interface{} `json:"help,omitempty"`
}

ErrorResponseErrorsInner struct for ErrorResponseErrorsInner

type GetMailBatchParam

type GetMailBatchParam struct {
	// Use the `on-behalf-of` header to make API calls for a particular Subuser through the parent account. You can use this header to automate bulk updates or to administer a Subuser without changing the authentication in your code. You will use the parent account's API key when using this header.
	Onbehalfof *string `json:"on-behalf-of,omitempty"`
}

func (*GetMailBatchParam) SetOnbehalfof

func (params *GetMailBatchParam) SetOnbehalfof(Onbehalfof string) *GetMailBatchParam

type MailBatchResponse

type MailBatchResponse struct {
	// A mail batch ID.
	BatchId *string `json:"batch_id,omitempty"`
}

MailBatchResponse struct for MailBatchResponse

type MailFrom

type MailFrom struct {
	// The email address from which messages are sent. This address should be a verified sender in your Twilio SendGrid account. Email addresses specified in `personalizations` will override addresses set at the message level outside of the `personalizations` object.
	Email string `json:"email"`
	// A name or title associated with the email address such as \"Support\" or \"Alex\".
	Name *string `json:"name,omitempty"`
}

MailFrom struct for MailFrom

type MailTo

type MailTo struct {
	// An email address to which a message is sent. Email addresses specified in `personalizations` will override addresses set at the message level outside of the `personalizations` object.
	Email string `json:"email"`
	// A name or title associated with the email address such as \"Alex\".
	Name *string `json:"name,omitempty"`
}

MailTo struct for MailTo

type SendMailParam

type SendMailParam struct {
	// Use this header when sending a gzip compressed mail body. Mail body compression is available to some high volume accounts. Submit a [request to support](https://support.sendgrid.com/hc/en-us) to have gzip enabled on your account.
	ContentEncoding *ContentEncoding `json:"Content-Encoding,omitempty"`
	//
	SendMailRequest *SendMailRequest `json:"SendMailRequest,omitempty"`
}

func (*SendMailParam) SetContentEncoding

func (params *SendMailParam) SetContentEncoding(ContentEncoding ContentEncoding) *SendMailParam

func (*SendMailParam) SetSendMailRequest

func (params *SendMailParam) SetSendMailRequest(SendMailRequest SendMailRequest) *SendMailParam

type SendMailRequest

type SendMailRequest struct {
	// An array of messages and their metadata. Each object within the `personalizations` array can be thought of as a mail envelope—it defines who should receive an individual message and how that message should be handled. See [**Personalizations**](https://sendgrid.com/docs/for-developers/sending-email/personalizations/) for more information.
	Personalizations []SendMailRequestPersonalizationsInner `json:"personalizations"`
	From             MailFrom                               `json:"from"`
	ReplyTo          *MailTo                                `json:"reply_to,omitempty"`
	// An array of recipients to whom replies will be sent. Each object in this array must contain a recipient's email address. Each object in the array may optionally contain a recipient's name. You can use either the `reply_to` property or `reply_to_list` property but not both.
	ReplyToList *[]MailTo `json:"reply_to_list,omitempty"`
	// The global or _message level_ subject of your email. Subject lines set in personalizations objects will override this global subject line. See line length limits specified in [RFC 2822](https://www.rfc-editor.org/rfc/rfc2822#section-2.1.1) for guidance on subject line character limits.
	Subject *string `json:"subject,omitempty"`
	// An array of objects, each containing a message body's content and [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types). You must specify at least one MIME type and may include multiple. To include more than one MIME type, add an object for each type to the array.
	Content *[]SendMailRequestContentInner `json:"content,omitempty"`
	// An array of objects where you can define any attachments to be included with the message. Each object contains a `content` property, which must be a Base64 encoded string of the attachment itself, and `type`, `filename`, `disposition`, and `content_id` properties that tell SendGrid how to handle the attachment.
	Attachments *[]SendMailRequestAttachmentsInner `json:"attachments,omitempty"`
	// An email template ID. A template that contains a subject and content—either text or html—will override any subject and content values specified at the `personalizations` or message level. If a template ID begins with `d-`, it is a dynamic template and will work with the `dynamic_template_data` property. If the template ID does not begin with `d-`, it is a standard SendGrid template and will work with the `substitutions` property. See [**How to Send an Email with Dynamic Templates**](https://docs.sendgrid.com/ui/sending-email/how-to-send-an-email-with-dynamic-templates) for more information about working with templates.
	TemplateId *string `json:"template_id,omitempty"`
	// A collection of JSON property name and property value pairs allowing you to specify handling instructions for your email. You may not override the following headers: `x-sg-id`, `x-sg-eid`, `received`, `dkim-signature`, `Content-Type`, `Content-Transfer-Encoding`, `To`, `From`, `Subject`, `Reply-To`, `CC`, `BCC`.
	Headers *map[string]interface{} `json:"headers,omitempty"`
	// An array of category names assigned to this message. Categories allow you to group messages by categories you define. Categories should be used sparingly to create general groups that are relevant to you. Categories are not meant to be used to track individual mail sends. For more granular categorization and tracking, use the `custom_args` property. A category name cannot exceed 255 characters. See [**Working with Categories**](https://docs.sendgrid.com/for-developers/sending-email/categories) for more information.
	Categories *[]string `json:"categories,omitempty"`
	// Values that are specific to the entire send that will be carried along with the email and its activity data. Substitutions will not be made on custom arguments, so any string that is assigned to this property will be assumed to be the custom argument that you would like to be used. This parameter is overridden by `custom_args` set at the personalizations level. Total `custom_args` size may not exceed 10,000 bytes.
	CustomArgs *string `json:"custom_args,omitempty"`
	// A [unix timestamp](https://en.wikipedia.org/wiki/Unix_time) allowing you to specify when your email should be sent. A send cannot be scheduled more than 72 hours in advance. This property may be overridden by the `send_at` property set at the personalizations level.
	SendAt *int32 `json:"send_at,omitempty"`
	// An ID representing a batch of emails to be sent at the same time. Including a `batch_id` in your request allows you to include this email in that batch. It also enables you to cancel or pause the delivery of that batch. See the [Scheduled Sends API](https://sendgrid.com/docs/api-reference/) for more information about scheduling your email.
	BatchId *string             `json:"batch_id,omitempty"`
	Asm     *SendMailRequestAsm `json:"asm,omitempty"`
	// The IP Pool that you would like to send this email from. IP Pools allow you to group your dedicated Twilio SendGrid IP addresses in order to have more control over your deliverability. See [**IP Pools**](https://docs.sendgrid.com/ui/account-and-settings/ip-pools) for more information.
	IpPoolName       *string                          `json:"ip_pool_name,omitempty"`
	MailSettings     *SendMailRequestMailSettings     `json:"mail_settings,omitempty"`
	TrackingSettings *SendMailRequestTrackingSettings `json:"tracking_settings,omitempty"`
}

SendMailRequest struct for SendMailRequest

type SendMailRequestAsm

type SendMailRequestAsm struct {
	// The unsubscribe group to associate with this email. See the [Suppressions API](https://docs.sendgrid.com/api-reference/suppressions/) to manage unsubscribe group IDs.
	GroupId int32 `json:"group_id"`
	// An array containing the unsubscribe groups that you would like to be displayed to a recipient on the unsubscribe preferences page. This page is displayed in the recipient's browser when they click the unsubscribe link in your message.
	GroupsToDisplay *[]int32 `json:"groups_to_display,omitempty"`
}

SendMailRequestAsm An object allowing you to specify how to handle unsubscribes. With SendGrid, an unsubscribe is the action an email recipient takes when they opt-out of receiving your messages. A suppression is the action you take as a sender to filter or suppress an unsubscribed address from your email send. From the perspective of the recipient, your suppression is the result of their unsubscribe. See [**Suppression Groups**](https://www.twilio.com/docs/sendgrid/api-reference/suppressions-unsubscribe-groups/create-a-new-suppression-group) for more information.

type SendMailRequestAttachmentsInner

type SendMailRequestAttachmentsInner struct {
	// The Base64 encoded content of the attachment.
	Content string `json:"content"`
	// The MIME type of the content you are attaching (e.g., `image/jpeg` or `application/pdf`).
	Type *string `json:"type,omitempty"`
	// The attachment's filename, including the file extension.
	Filename string `json:"filename"`
	// The attachment's content-disposition specifies how you would like the attachment to be displayed. For example, `inline` results in the attached file being displayed automatically within the message while `attachment` results in the attached file requiring some action to be taken before it is displayed such as opening or downloading the file.
	Disposition *Disposition `json:"disposition,omitempty"`
	// The attachment's content ID. The `content_id` is used when the `disposition` is set to `inline` and the attachment is an image, allowing the file to be displayed within the body of the email.
	ContentId *string `json:"content_id,omitempty"`
}

SendMailRequestAttachmentsInner struct for SendMailRequestAttachmentsInner

type SendMailRequestContentInner

type SendMailRequestContentInner struct {
	// The MIME type of the content assigned in the `value` property of this object (e.g., `text/plain` or `text/html`).
	Type string `json:"type"`
	// The content of your message in the specified MIME type assigned in the `type` property of this object.
	Value string `json:"value"`
}

SendMailRequestContentInner struct for SendMailRequestContentInner

type SendMailRequestMailSettings

type SendMailRequestMailSettings struct {
	BypassListManagement        *SendMailRequestMailSettingsBypassListManagement        `json:"bypass_list_management,omitempty"`
	BypassSpamManagement        *SendMailRequestMailSettingsBypassSpamManagement        `json:"bypass_spam_management,omitempty"`
	BypassBounceManagement      *SendMailRequestMailSettingsBypassBounceManagement      `json:"bypass_bounce_management,omitempty"`
	BypassUnsubscribeManagement *SendMailRequestMailSettingsBypassUnsubscribeManagement `json:"bypass_unsubscribe_management,omitempty"`
	Footer                      *SendMailRequestMailSettingsFooter                      `json:"footer,omitempty"`
	SandboxMode                 *SendMailRequestMailSettingsSandboxMode                 `json:"sandbox_mode,omitempty"`
}

SendMailRequestMailSettings A collection of different mail settings that you can use to specify how you would like this email to be handled. Mail settings provide extra functionality to your mail send. See [**Mail Settings**](https://docs.sendgrid.com/ui/account-and-settings/mail) for more information.

type SendMailRequestMailSettingsBypassBounceManagement

type SendMailRequestMailSettingsBypassBounceManagement struct {
	// Indicates if this setting is enabled.
	Enable *bool `json:"enable,omitempty"`
}

SendMailRequestMailSettingsBypassBounceManagement Allows you to bypass the bounce list to ensure that the email is delivered to recipients. Spam report and unsubscribe lists will still be checked; addresses on these other lists will not receive the message. This filter cannot be combined with the `bypass_list_management` filter. See the [the \"Bypass suppressions\" section of our **Suppressions Overview**](https://sendgrid.com/docs/ui/sending-email/index-suppressions/#bypass-suppressions) for more about bypass filters.

type SendMailRequestMailSettingsBypassListManagement

type SendMailRequestMailSettingsBypassListManagement struct {
	// Indicates if this setting is enabled.
	Enable *bool `json:"enable,omitempty"`
}

SendMailRequestMailSettingsBypassListManagement Allows you to bypass all unsubscribe groups and suppressions to ensure that the email is delivered to every single recipient. This should only be used in emergencies when it is absolutely necessary that every recipient receives your email. This filter cannot be combined with any other bypass filters. See the [the \"Bypass suppressions\" section of our **Suppressions Overview**](https://sendgrid.com/docs/ui/sending-email/index-suppressions/#bypass-suppressions) for more about bypass filters.

type SendMailRequestMailSettingsBypassSpamManagement

type SendMailRequestMailSettingsBypassSpamManagement struct {
	// Indicates if this setting is enabled.
	Enable *bool `json:"enable,omitempty"`
}

SendMailRequestMailSettingsBypassSpamManagement Allows you to bypass the spam report list to ensure that the email is delivered to recipients. Bounce and unsubscribe lists will still be checked; addresses on these other lists will not receive the message. This filter cannot be combined with the `bypass_list_management` filter. See the [the \"Bypass suppressions\" section of our **Suppressions Overview**](https://sendgrid.com/docs/ui/sending-email/index-suppressions/#bypass-suppressions) for more about bypass filters.

type SendMailRequestMailSettingsBypassUnsubscribeManagement

type SendMailRequestMailSettingsBypassUnsubscribeManagement struct {
	// Indicates if this setting is enabled.
	Enable *bool `json:"enable,omitempty"`
}

SendMailRequestMailSettingsBypassUnsubscribeManagement Allows you to bypass the global unsubscribe list to ensure that the email is delivered to recipients. Bounce and spam report lists will still be checked; addresses on these other lists will not receive the message. This filter applies only to global unsubscribes and will not bypass group unsubscribes. This filter cannot be combined with the `bypass_list_management` filter. See the [the \"Bypass suppressions\" section of our **Suppressions Overview**](https://sendgrid.com/docs/ui/sending-email/index-suppressions/#bypass-suppressions) for more about bypass filters.

type SendMailRequestMailSettingsFooter

type SendMailRequestMailSettingsFooter struct {
	// Indicates if this setting is enabled.
	Enable *bool `json:"enable,omitempty"`
	// The plain text content of your footer.
	Text *string `json:"text,omitempty"`
	// The HTML content of your footer.
	Html *string `json:"html,omitempty"`
}

SendMailRequestMailSettingsFooter Inserts a custom footer at the bottom of the text and HTML bodies of your messages. Use the `html` and `text` properties to include the content of the footers to be inserted.

type SendMailRequestMailSettingsSandboxMode

type SendMailRequestMailSettingsSandboxMode struct {
	// Indicates if this setting is enabled.
	Enable *bool `json:"enable,omitempty"`
}

SendMailRequestMailSettingsSandboxMode Sandbox Mode allows you to send a test email to ensure that your request body is valid and formatted correctly.

type SendMailRequestPersonalizationsInner

type SendMailRequestPersonalizationsInner struct {
	From *MailFrom `json:"from,omitempty"`
	// An array of recipients to whom the email will be sent. Each object in this array must contain a recipient's email address. Each object in the array may optionally contain a recipient's name.
	To []MailTo `json:"to"`
	// An array of recipients to whom a copy of the email will be sent. Each object in this array must contain a recipient's email address. Each object in the array may optionally contain a recipient's name.
	Cc *[]MailTo `json:"cc,omitempty"`
	// An array of recipients to whom a blind carbon copy of your email will be sent. Each object in this array must contain a recipient's email address. Each object in the array may optionally contain a recipient's name.
	Bcc *[]MailTo `json:"bcc,omitempty"`
	// The subject of your email. See line length limits specified in [RFC 2822](https://www.rfc-editor.org/rfc/rfc2822#section-2.1.1) for guidance on subject line character limits.
	Subject *string `json:"subject,omitempty"`
	// A collection of JSON property name and property value pairs allowing you to specify handling instructions for your email. You may not override the following headers: `x-sg-id`, `x-sg-eid`, `received`, `dkim-signature`, `Content-Type`, `Content-Transfer-Encoding`, `To`, `From`, `Subject`, `Reply-To`, `CC`, `BCC`.
	Headers *map[string]interface{} `json:"headers,omitempty"`
	// A collection property names that will be substituted by their corresponding property values in the `subject`, `reply-to` and `content` portions of your message. Name and value pairs follow the pattern `\"substitution_tag\":\"value to substitute\"`. The total collective size of your substitutions may not exceed 10,000 bytes per personalization object. Substitutions allow you to insert data without using SendGrid's Dynamic Templates. This property should not be used in combination with a Dynamic Template, which can be identified by a `template_id` starting with `d-`. See [**Substitution Tags**](https://docs.sendgrid.com/for-developers/sending-email/substitution-tags) for more information.
	Substitutions *map[string]string `json:"substitutions,omitempty"`
	// A collection property names that will be substituted by their corresponding property values in the `subject`, `reply-to` and `content` portions of a SendGrid Dynamic Template. Dynamic template data is available in a template using [Handlebars](https://docs.sendgrid.com/for-developers/sending-email/using-handlebars) syntax. This property should be used in combination with a Dynamic Template, which can be identified by a `template_id` starting with `d-`. See [**How to Send an Email with Dynamic Templates**](https://docs.sendgrid.com/ui/sending-email/how-to-send-an-email-with-dynamic-templates) for more information.
	DynamicTemplateData *map[string]interface{} `json:"dynamic_template_data,omitempty"`
	// Values that are specific to this personalization that will be carried along with the email and its activity data. Substitutions will not be made on custom arguments, so any string that is assigned to this property will be assumed to be the custom argument that you would like to be used. This field may not exceed 10,000 bytes.
	CustomArgs *map[string]interface{} `json:"custom_args,omitempty"`
	// A [unix timestamp](https://en.wikipedia.org/wiki/Unix_time) allowing you to specify when your email should be sent. A send cannot be scheduled more than 72 hours in advance.
	SendAt *int32 `json:"send_at,omitempty"`
}

SendMailRequestPersonalizationsInner struct for SendMailRequestPersonalizationsInner

type SendMailRequestTrackingSettings

type SendMailRequestTrackingSettings struct {
	ClickTracking        *SendMailRequestTrackingSettingsClickTracking        `json:"click_tracking,omitempty"`
	OpenTracking         *SendMailRequestTrackingSettingsOpenTracking         `json:"open_tracking,omitempty"`
	SubscriptionTracking *SendMailRequestTrackingSettingsSubscriptionTracking `json:"subscription_tracking,omitempty"`
	Ganalytics           *SendMailRequestTrackingSettingsGanalytics           `json:"ganalytics,omitempty"`
}

SendMailRequestTrackingSettings Settings to determine how you would like to track the metrics of how your recipients interact with your email. See [**Tracking Settings**](https://docs.sendgrid.com/ui/account-and-settings/tracking) for more information.

type SendMailRequestTrackingSettingsClickTracking

type SendMailRequestTrackingSettingsClickTracking struct {
	// Indicates if this setting is enabled.
	Enable *bool `json:"enable,omitempty"`
	// Indicates if this setting should be included in the `text/plain` portion of your email.
	EnableText *bool `json:"enable_text,omitempty"`
}

SendMailRequestTrackingSettingsClickTracking Allows you to track if a recipient clicked a link in your email.

type SendMailRequestTrackingSettingsGanalytics

type SendMailRequestTrackingSettingsGanalytics struct {
	// Indicates if this setting is enabled.
	Enable *bool `json:"enable,omitempty"`
	// Name of the referrer source. (e.g., Google, SomeDomain.com, or Marketing Email)
	UtmSource *string `json:"utm_source,omitempty"`
	// Name of the marketing medium. (e.g., Email)
	UtmMedium *string `json:"utm_medium,omitempty"`
	// Used to identify any paid keywords.
	UtmTerm *string `json:"utm_term,omitempty"`
	// Used to differentiate your campaign from advertisements.
	UtmContent *string `json:"utm_content,omitempty"`
	// The name of the campaign.
	UtmCampaign *string `json:"utm_campaign,omitempty"`
}

SendMailRequestTrackingSettingsGanalytics Allows you to enable tracking provided by Google Analytics. See [**Google Analytics and SendGrid Statistics**](https://docs.sendgrid.com/ui/analytics-and-reporting/google-analytics) for more information about this property.

type SendMailRequestTrackingSettingsOpenTracking

type SendMailRequestTrackingSettingsOpenTracking struct {
	// Indicates if this setting is enabled.
	Enable *bool `json:"enable,omitempty"`
	// Allows you to specify a substitution tag that you can insert in the body of your email at a location that you desire. This tag will be replaced by the open tracking pixel.
	SubstitutionTag *string `json:"substitution_tag,omitempty"`
}

SendMailRequestTrackingSettingsOpenTracking Allows you to track if the email was opened by including a single transparent pixel image in the body of the message content. When the message is opened, a request for the pixel is sent. That request indicates to Twilio SendGrid that the message was opened.

type SendMailRequestTrackingSettingsSubscriptionTracking

type SendMailRequestTrackingSettingsSubscriptionTracking struct {
	// Indicates if this setting is enabled.
	Enable *bool `json:"enable,omitempty"`
	// Text to be appended to the email with the subscription tracking link.
	Text *string `json:"text,omitempty"`
	// HTML to be appended to the email with the subscription tracking link.
	Html *string `json:"html,omitempty"`
	// A tag that will be replaced with the unsubscribe URL. If this property is used, it will override both the `text` and `html` properties. The URL of the link will be placed at the substitution tag's location in the message body with no additional formatting.
	SubstitutionTag *string `json:"substitution_tag,omitempty"`
}

SendMailRequestTrackingSettingsSubscriptionTracking Allows you to insert a subscription management link at the bottom of the text and HTML bodies of your email. If you would like to specify the location of the link within your email, you may use the `substitution_tag` property.

Jump to

Keyboard shortcuts

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