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 Test Email API allows you to test a marketing email by first sending it to a list of up to 10 email addresses before pushing to a contact list or segment. With this feature, you can test the layout and content of your message in multiple email clients and with multiple recipients to see how it will function in a real-world scenario.

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:02.229382+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
SendTestMarketingEmail SendTestMarketingEmail Post /v3/marketing/test/send_email Send a Test Marketing Email

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) SendTestMarketingEmail

func (c *ApiService) SendTestMarketingEmail(params *SendTestMarketingEmailParam) (interface{}, error)

**This endpoint allows you to send a test marketing email to a list of email addresses**. Before sending a marketing message, you can test it using this endpoint. You may specify up to **10 contacts** in the `emails` request body field. You must also specify a `template_id` and include either a `from_address` or `sender_id`. You can manage your templates with the [Twilio SendGrid App](https://mc.sendgrid.com/dynamic-templates) or the [Transactional Templates API](https://docs.sendgrid.com/api-reference/transactional-templates). > Please note that this endpoint works with Dynamic Transactional Templates only. Legacy Transactional Templates will not be delivered. For more information about managing Dynamic Transactional Templates, see [How to Send Email with Dynamic Transactional Templates](https://sendgrid.com/docs/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/). You can also test your Single Sends in the [Twilio SendGrid Marketing Campaigns UI](https://mc.sendgrid.com/single-sends).

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 SendTestMarketingEmailParam

type SendTestMarketingEmailParam struct {
	//
	SendTestMarketingEmailRequest *SendTestMarketingEmailRequest `json:"SendTestMarketingEmailRequest,omitempty"`
}

func (*SendTestMarketingEmailParam) SetSendTestMarketingEmailRequest

func (params *SendTestMarketingEmailParam) SetSendTestMarketingEmailRequest(SendTestMarketingEmailRequest SendTestMarketingEmailRequest) *SendTestMarketingEmailParam

type SendTestMarketingEmailRequest

type SendTestMarketingEmailRequest struct {
	// The ID of the template that you would like to use. If you use a template that contains a subject and content (either text or HTML), then those values specified at the personalizations or message level will not be used.
	TemplateId string `json:"template_id"`
	//  You can override the active template with an alternative template version by passing the version ID in this field. If this field is blank, the active template version will be used.
	VersionIdOverride *string `json:"version_id_override,omitempty"`
	// This ID must belong to a verified sender. Alternatively, you may supply a `from_address` email.
	SenderId *int32 `json:"sender_id,omitempty"`
	// A custom unsubscribe URL.
	CustomUnsubscribeUrl *string `json:"custom_unsubscribe_url,omitempty"`
	SuppressionGroupId   *int32  `json:"suppression_group_id,omitempty"`
	// An array of email addresses you want to send the test message to.
	Emails []string `json:"emails"`
	// You can either specify this address or specify a verified sender ID.
	FromAddress *string `json:"from_address,omitempty"`
}

SendTestMarketingEmailRequest struct for SendTestMarketingEmailRequest

Jump to

Keyboard shortcuts

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