Skip to content

Latest commit

 

History

History
94 lines (73 loc) · 3.03 KB

README.md

File metadata and controls

94 lines (73 loc) · 3.03 KB

Resend Go SDK

Resend is the email platform for developers.

go-github release (latest SemVer)

SDK Installation

go get github.com/resendlabs/resend-go

SDK Example Usage

package main

import (
    "log"
    "github.com/resendlabs/resend-go"
    "github.com/resendlabs/resend-go/pkg/models/shared"
    "github.com/resendlabs/resend-go/pkg/models/operations"
)

func main() {
    opts := []resend.SDKOption{
        resend.WithSecurity(
            shared.Security{
                BearerAuth: shared.SchemeBearerAuth{
                    Authorization: "Bearer YOUR_BEARER_TOKEN_HERE",
                },
            }
        ),
    }

    s := resend.New(opts...)
    
    req := operations.SendEmailRequest{
        Request: shared.Email{
            Bcc: "unde",
            Cc: "deserunt",
            From: "porro",
            HTML: "nulla",
            ReplyTo: "id",
            Subject: "vero",
            Text: "perspiciatis",
            To: "nulla",
        },
    }
    
    res, err := s.Email.SendEmail(ctx, req)
    if err != nil {
        log.Fatal(err)
    }

    if res.SendEmailResponse != nil {
        // handle response
    }

Authentication

To authenticate you need to add an Authorization header with the contents of the header being Bearer re_123456789 where re_123456789 is your API Key. First, you need to get an API key, which is available in the Resend Dashboard.

Authorization: Bearer re_123

SDK Available Operations

Email

  • SendEmail - Send an email

Contributions

While we value open-source contributions to this SDK, this library is generated programmatically. Feel free to open a PR or a Github issue as a proof of concept and we'll do our best to include it in a future release !

SDK Generated by Speakeasy