Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: update to go mod #418

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
45 changes: 27 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![BuildStatus](https://travis-ci.org/sendgrid/sendgrid-go.svg?branch=main)](https://travis-ci.org/sendgrid/sendgrid-go)
[![Email Notifications Badge](https://dx.sendgrid.com/badge/go)](https://dx.sendgrid.com/newsletter/go)
[![GoDoc](https://godoc.org/github.com/sendgrid/sendgrid-go?status.svg)](https://godoc.org/github.com/sendgrid/sendgrid-go)
[![GoDoc](https://godoc.org/github.com/sendgrid/sendgrid-go?status.svg)](https://pkg.go.dev/github.com/sendgrid/sendgrid-go/v3)
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
[![Twitter Follow](https://img.shields.io/twitter/follow/sendgrid.svg?style=social&label=Follow)](https://twitter.com/sendgrid)
[![GitHub contributors](https://img.shields.io/github/contributors/sendgrid/sendgrid-go.svg)](https://github.com/sendgrid/sendgrid-go/graphs/contributors)
Expand All @@ -24,23 +24,24 @@ We appreciate your continued support, thank you!

# Table of Contents

* [Installation](#installation)
* [Quick Start](#quick-start)
* [Processing Inbound Email](#inbound)
* [Usage](#usage)
* [Use Cases](#use-cases)
* [Announcements](#announcements)
* [How to Contribute](#contribute)
* [Troubleshooting](#troubleshooting)
* [About](#about)
* [License](#license)
- [Installation](#installation)
- [Quick Start](#quick-start)
- [Processing Inbound Email](#inbound)
- [Usage](#usage)
- [Use Cases](#use-cases)
- [Announcements](#announcements)
- [How to Contribute](#contribute)
- [Troubleshooting](#troubleshooting)
- [About](#about)
- [License](#license)

<a name="installation"></a>

# Installation

## Prerequisites

- Go version 1.7
- Go version 1.12
- The Twilio SendGrid service, starting at the [free level](https://sendgrid.com/free?source=sendgrid-go), to send up to 40,000 emails for the first 30 days, then send 100 emails/day free forever or check out [our pricing](https://sendgrid.com/pricing?source=sendgrid-go).

## Setup Environment Variables
Expand All @@ -55,7 +56,7 @@ source ./sendgrid.env

## Install Package

`go get github.com/sendgrid/sendgrid-go`
`go get github.com/sendgrid/sendgrid-go/v3`

## Dependencies

Expand All @@ -80,6 +81,7 @@ source ./sendgrid.env
```

<a name="quick-start"></a>

# Quick Start

## Hello Email
Expand All @@ -96,8 +98,8 @@ import (
"log"
"os"

"github.com/sendgrid/sendgrid-go"
"github.com/sendgrid/sendgrid-go/helpers/mail"
"github.com/sendgrid/sendgrid-go/v3"
"github.com/sendgrid/sendgrid-go/v3/helpers/mail"
)

func main() {
Expand Down Expand Up @@ -130,7 +132,7 @@ package main

import (
"fmt"
"github.com/sendgrid/sendgrid-go"
"github.com/sendgrid/sendgrid-go/v3"
"log"
"os"
)
Expand Down Expand Up @@ -177,7 +179,7 @@ package main

import (
"fmt"
"github.com/sendgrid/sendgrid-go"
"github.com/sendgrid/sendgrid-go/v3"
"log"
"os"
)
Expand All @@ -197,13 +199,14 @@ func main() {
}
```


<a name="inbound"></a>

# Processing Inbound Email

Please see [our helper](helpers/inbound) for utilizing our Inbound Parse webhook.

<a name="usage"></a>

# Usage

- [Twilio SendGrid Docs](https://sendgrid.com/docs/API_Reference/index.html)
Expand All @@ -213,18 +216,21 @@ Please see [our helper](helpers/inbound) for utilizing our Inbound Parse webhook
- [v3 Web API Mail Send Helper](helpers/mail/README.md)

<a name="use-cases"></a>

# Use Cases

[Examples of common API use cases](use-cases/README.md), such as how to send an email with a transactional template.

<a name="announcements"></a>

# Announcements

Please see our announcement regarding [breaking changes](https://github.com/sendgrid/sendgrid-go/issues/81). Your support is appreciated!

All updates to this library are documented in our [CHANGELOG](CHANGELOG.md) and [releases](https://github.com/sendgrid/sendgrid-go/releases). You may also subscribe to email [release notifications](https://dx.sendgrid.com/newsletter/go) for releases and breaking changes.

<a name="contribute"></a>

# How to Contribute

We encourage contribution to our libraries (you might even score some nifty swag), please see our [CONTRIBUTING](CONTRIBUTING.md) guide for details.
Expand All @@ -237,11 +243,13 @@ Quick links:
- [Review Pull Requests](CONTRIBUTING.md#code-reviews)

<a name="troubleshooting"></a>

# Troubleshooting

Please see our [troubleshooting guide](TROUBLESHOOTING.md) for common library issues.

<a name="about"></a>

# About

sendgrid-go is maintained and funded by Twilio SendGrid, Inc. The names and logos for sendgrid-go are trademarks of Twilio SendGrid, Inc.
Expand All @@ -251,4 +259,5 @@ If you need help installing or using the library, please check the [Twilio SendG
If you've instead found a bug in the library or would like new features added, go ahead and open issues or pull requests against this repo!

# License

[The MIT License (MIT)](LICENSE)
2 changes: 1 addition & 1 deletion USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package main

import (
"fmt"
"github.com/sendgrid/sendgrid-go"
"github.com/sendgrid/sendgrid-go/v3"
"log"
"os"
)
Expand Down
2 changes: 1 addition & 1 deletion base_interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"time"

"github.com/sendgrid/rest"
"github.com/sendgrid/sendgrid-go/helpers/mail"
"github.com/sendgrid/sendgrid-go/v3/helpers/mail"
)

// Version is this client library's current version
Expand Down
2 changes: 1 addition & 1 deletion examples/accesssettings/accesssettings.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"log"
"os"

sendgrid "github.com/sendgrid/sendgrid-go"
sendgrid "github.com/sendgrid/sendgrid-go/v3"
)

// Retrieveallrecentaccessattempts : Retrieve all recent access attempts
Expand Down
2 changes: 1 addition & 1 deletion examples/alerts/alerts.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"log"
"os"

"github.com/sendgrid/sendgrid-go"
"github.com/sendgrid/sendgrid-go/v3"
)

// CreateanewAlert : Create a new Alert
Expand Down
2 changes: 1 addition & 1 deletion examples/apikeys/apikeys.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"log"
"os"

sendgrid "github.com/sendgrid/sendgrid-go"
sendgrid "github.com/sendgrid/sendgrid-go/v3"
)

// CreateAPIkeys : Create API keys
Expand Down
2 changes: 1 addition & 1 deletion examples/asm/asm.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"log"
"os"

"github.com/sendgrid/sendgrid-go"
"github.com/sendgrid/sendgrid-go/v3"
)

// Createanewsuppressiongroup : Create a new suppression group
Expand Down
2 changes: 1 addition & 1 deletion examples/browsers/browsers.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"log"
"os"

sendgrid "github.com/sendgrid/sendgrid-go"
sendgrid "github.com/sendgrid/sendgrid-go/v3"
)

// Retrieveemailstatisticsbybrowser : Retrieve email statistics by browser.
Expand Down
2 changes: 1 addition & 1 deletion examples/campaigns/campaigns.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"log"
"os"

sendgrid "github.com/sendgrid/sendgrid-go"
sendgrid "github.com/sendgrid/sendgrid-go/v3"
)

// CreateaCampaign : Create a Campaign
Expand Down
2 changes: 1 addition & 1 deletion examples/categories/categories.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"log"
"os"

"github.com/sendgrid/sendgrid-go"
"github.com/sendgrid/sendgrid-go/v3"
)

// Retrieveallcategories : Retrieve all categories
Expand Down
2 changes: 1 addition & 1 deletion examples/clients/clients.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"log"
"os"

"github.com/sendgrid/sendgrid-go"
"github.com/sendgrid/sendgrid-go/v3"
)

// Retrieveemailstatisticsbyclienttype : Retrieve email statistics by client type.
Expand Down
2 changes: 1 addition & 1 deletion examples/contactdb/contactdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"log"
"os"

"github.com/sendgrid/sendgrid-go"
"github.com/sendgrid/sendgrid-go/v3"
)

// CreateaCustomField : Create a Custom Field
Expand Down
2 changes: 1 addition & 1 deletion examples/devices/devices.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"log"
"os"

"github.com/sendgrid/sendgrid-go"
"github.com/sendgrid/sendgrid-go/v3"
)

// Retrieveemailstatisticsbydevicetype : Retrieve email statistics by device type.
Expand Down
4 changes: 2 additions & 2 deletions examples/eventwebhook/eventwebhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"os"

"github.com/sendgrid/rest"
"github.com/sendgrid/sendgrid-go"
"github.com/sendgrid/sendgrid-go/helpers/eventwebhook"
"github.com/sendgrid/sendgrid-go/v3"
"github.com/sendgrid/sendgrid-go/v3/helpers/eventwebhook"
)

// EnableSignedWebhook : Enables Signed Event Webhook.
Expand Down
2 changes: 1 addition & 1 deletion examples/geo/geo.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"log"
"os"

"github.com/sendgrid/sendgrid-go"
"github.com/sendgrid/sendgrid-go/v3"
)

// Retrieveemailstatisticsbycountryandstateprovince : Retrieve email statistics by country and state/province.
Expand Down
4 changes: 2 additions & 2 deletions examples/helpers/mail/example.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"fmt"
"os"

"github.com/sendgrid/sendgrid-go"
"github.com/sendgrid/sendgrid-go/helpers/mail"
"github.com/sendgrid/sendgrid-go/v3"
"github.com/sendgrid/sendgrid-go/v3/helpers/mail"
)

// Minimum required to send an email
Expand Down
2 changes: 1 addition & 1 deletion examples/ips/ips.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"log"
"os"

"github.com/sendgrid/sendgrid-go"
"github.com/sendgrid/sendgrid-go/v3"
)

// RetrieveallIPaddresses : Retrieve all IP addresses
Expand Down
2 changes: 1 addition & 1 deletion examples/mail/mail.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"log"
"os"

"github.com/sendgrid/sendgrid-go"
"github.com/sendgrid/sendgrid-go/v3"
)

// CreateabatchID : Create a batch ID
Expand Down
2 changes: 1 addition & 1 deletion examples/mailboxproviders/mailboxproviders.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"log"
"os"

"github.com/sendgrid/sendgrid-go"
"github.com/sendgrid/sendgrid-go/v3"
)

// Retrieveemailstatisticsbymailboxprovider : Retrieve email statistics by mailbox provider.
Expand Down
2 changes: 1 addition & 1 deletion examples/mailsettings/mailsettings.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"log"
"os"

"github.com/sendgrid/sendgrid-go"
"github.com/sendgrid/sendgrid-go/v3"
)

// Retrieveallmailsettings : Retrieve all mail settings
Expand Down
2 changes: 1 addition & 1 deletion examples/partnersettings/partnersettings.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"log"
"os"

"github.com/sendgrid/sendgrid-go"
"github.com/sendgrid/sendgrid-go/v3"
)

// Returnsalistofallpartnersettings : Returns a list of all partner settings.
Expand Down
2 changes: 1 addition & 1 deletion examples/scopes/scopes.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"log"
"os"

"github.com/sendgrid/sendgrid-go"
"github.com/sendgrid/sendgrid-go/v3"
)

// Retrievealistofscopesforwhichthisuserhasaccess : Retrieve a list of scopes for which this user has access.
Expand Down
2 changes: 1 addition & 1 deletion examples/senderauthentication/senderauthentication.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"log"
"os"

"github.com/sendgrid/sendgrid-go"
"github.com/sendgrid/sendgrid-go/v3"
)

// Createadomainauthentication : Create a domain authentication.
Expand Down
2 changes: 1 addition & 1 deletion examples/senders/senders.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"log"
"os"

"github.com/sendgrid/sendgrid-go"
"github.com/sendgrid/sendgrid-go/v3"
)

// CreateaSenderIdentity : Create a Sender Identity
Expand Down
2 changes: 1 addition & 1 deletion examples/stats/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"log"
"os"

"github.com/sendgrid/sendgrid-go"
"github.com/sendgrid/sendgrid-go/v3"
)

// Retrieveglobalemailstatistics : Retrieve global email statistics
Expand Down
2 changes: 1 addition & 1 deletion examples/subusers/subusers.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"log"
"os"

"github.com/sendgrid/sendgrid-go"
"github.com/sendgrid/sendgrid-go/v3"
)

// CreateSubuser : Creates a Subuser
Expand Down
2 changes: 1 addition & 1 deletion examples/suppression/suppression.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"log"
"os"

"github.com/sendgrid/sendgrid-go"
"github.com/sendgrid/sendgrid-go/v3"
)

// Retrieveallblocks : Retrieve all blocks
Expand Down
2 changes: 1 addition & 1 deletion examples/templates/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"log"
"os"

sendgrid "github.com/sendgrid/sendgrid-go"
sendgrid "github.com/sendgrid/sendgrid-go/v3"
)

// Createatransactionaltemplate : Create a transactional template.
Expand Down