---
title: Gin
description: Learn how to integrate Reloop with Gin to send emails.
icon: siGin
---
> For the complete documentation index, see [llms-docs.txt](/llms-docs.txt) or the site index [llms.txt](/llms.txt). Full docs corpus: [llms-full-docs.txt](/llms-full-docs.txt). Prefer markdown URLs (append `.md`) for agent consumption. Product skill: [skill.md](/skill.md).


# Gin Integration

Integrate Reloop into your Go web application using the Gin framework.

## Installation

Install the official Go SDK:

```bash
go get github.com/reloop-labs/reloop-go
```

## Sending an Email

```go
package main

import (
	"context"
	"net/http"
	"os"

	"github.com/gin-gonic/gin"
	"github.com/reloop-labs/reloop-go"
)

func main() {
	r := gin.Default()
	client := reloop.NewClient(os.Getenv("RELOOP_API_KEY"))

	r.POST("/send-email", func(c *gin.Context) {
		params := &reloop.SendEmailParams{
			From:    "onboarding@reloop.sh",
			To:      []string{"delivered@resend.dev"},
			Subject: "Hello from Gin",
			HTML:    "<p>Congrats on sending your first email via Reloop from Go Gin!</p>",
		}

		res, err := client.Emails.Send(context.Background(), params)
		if err != nil {
			c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
			return
		}

		c.JSON(http.StatusOK, res)
	})

	r.Run(":8080")
}
```
