Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/resend/resend-go

Resend's Official Go SDK
https://github.com/resend/resend-go

Last synced: 6 days ago
JSON representation

Resend's Official Go SDK

Awesome Lists containing this project

README

        

# Resend Go SDK

[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
![Build](https://github.com/resend/resend-go/actions/workflows/go.yml/badge.svg)
![Release](https://img.shields.io/github/release/resend/resend-go.svg?style=flat-square)
---

## 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](https://resend.com).

## Example

```go
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](https://github.com/resend/resend-go/tree/main/examples)