# README
Resend Go SDK
Installation
To install the Go SDK, simply execute the following command on a terminal:
go get github.com/resend/resend-go/v2
Setup
First, you need to get an API key, which is available in the Resend Dashboard.
Example
import (
"fmt"
"github.com/resend/resend-go/v2"
)
func main() {
apiKey := "re_123"
client := resend.NewClient(apiKey)
params := &resend.SendEmailRequest{
To: []string{"to@example", "[email protected]"},
From: "[email protected]",
Text: "hello world",
Subject: "Hello from Golang",
Cc: []string{"[email protected]"},
Bcc: []string{"[email protected]"},
ReplyTo: "[email protected]",
}
sent, err := client.Emails.Send(params)
if err != nil {
panic(err)
}
fmt.Println(sent.Id)
}
You can view all the examples in the examples folder
# Packages
No description provided by the author
# Functions
BytesToIntArray converts a byte array to rune array ie: []byte(`hello`) becomes []int{104,101,108,108,111} which will then be properly marshalled into JSON in the way Resend supports.
NewClient is the default client constructor.
NewCustomClient builds a new Resend API client, using a provided Http client.
# Variables
ApiKeySvc errors.
ApiKeySvc errors.
ApiKeySvc errors.
EmailsSvc errors.
EmailsSvc errors.
EmailsSvc errors.
# Structs
No description provided by the author
No description provided by the author
Attachment is the public struct used for adding attachments to emails.
No description provided by the author
No description provided by the author
BatchEmailResponse is the response from the BatchSendEmail call.
No description provided by the author
CancelScheduledEmailResponse is the response from the Cancel call.
Client handles communication with Resend API.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Email provides the structure for the response from the Get call.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
SendEmailRequest is the request object for the Send call.
SendEmailResponse is the response from the Send call.
Tags are used to define custom metadata for emails.
No description provided by the author
No description provided by the author
No description provided by the author
UpdateEmailRequest is the request object for the Update call.
UpdateEmailResponse is the type that represents the response from the Update call.
# Interfaces
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Type aliases
No description provided by the author