# README
Go API client for
The Twilio SendGrid Mail Settings API allows you to retrieve and configure the various Mail Settings available. Mail Settings instruct SendGrid to apply specific settings to every email that you send over SendGrid’s Web API or SMTP relay. These settings include how to embed a custom footer, how to manage blocks, spam, and bounces, and more.
For a full list of Twilio SendGrid's Mail Settings, and what each one does, see Mail Settings.
You can also manage your Mail Settings in the Twilio SendGrid application user interface.
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: 2025-08-18T08:58:25.192839Z[Etc/UTC]
- 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 |
---|---|---|---|
ListAddressWhitelist | ListAddressWhitelist | Get /v3/mail_settings/address_whitelist | Retrieve address whitelist mail settings |
ListBouncePurge | ListBouncePurge | Get /v3/mail_settings/bounce_purge | Retrieve Bounce Purge Mail Settings |
ListFooter | ListFooter | Get /v3/mail_settings/footer | Retrieve footer mail settings |
ListForwardBounce | ListForwardBounce | Get /v3/mail_settings/forward_bounce | Retrieve forward bounce mail settings |
ListForwardSpam | ListForwardSpam | Get /v3/mail_settings/forward_spam | Retrieve forward spam mail settings |
ListMailSetting | ListMailSetting | Get /v3/mail_settings | Retrieve all mail settings |
ListTemplate | ListTemplate | Get /v3/mail_settings/template | Retrieve legacy template mail settings |
UpdateAddressWhitelist | UpdateAddressWhitelist | Patch /v3/mail_settings/address_whitelist | Update address whitelist mail settings |
UpdateBouncePurge | UpdateBouncePurge | Patch /v3/mail_settings/bounce_purge | Update Bounce Purge Mail Settings |
UpdateFooter | UpdateFooter | Patch /v3/mail_settings/footer | Update footer mail settings |
UpdateForwardBounce | UpdateForwardBounce | Patch /v3/mail_settings/forward_bounce | Update forward bounce mail settings |
UpdateForwardSpam | UpdateForwardSpam | Patch /v3/mail_settings/forward_spam | Update forward spam mail settings |
UpdateTemplate | UpdateTemplate | Patch /v3/mail_settings/template | Update template mail settings |
Documentation For Models
- ListMailSetting200Response
- ListMailSetting200ResponseResultInner
- MailSettingsAddressWhitelabel200
- MailSettingsBouncePurge
- MailSettingsFooter
- MailSettingsForwardBounce
- MailSettingsForwardSpam
- MailSettingsTemplate200
- UpdateAddressWhitelistRequest
- UpdateTemplate200Response
- UpdateTemplateRequest
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)