Skip to content
This repository has been archived by the owner on May 17, 2023. It is now read-only.

Latest commit

 

History

History
executable file
·
44 lines (39 loc) · 947 Bytes

USAGE.md

File metadata and controls

executable file
·
44 lines (39 loc) · 947 Bytes
package main

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

func main() {
    s := resend.New(resend.WithSecurity(
        shared.Security{
            BearerAuth: "Bearer YOUR_BEARER_TOKEN_HERE",
        },
    ))
    
    req := operations.SendEmailRequest{
        Request: shared.Email{
            Bcc: "unde",
            Cc: "deserunt",
            From: "porro",
            HTML: "nulla",
            ReplyTo: "id",
            Subject: "vero",
            Text: "perspiciatis",
            To: "nulla",
        },
    }

    ctx := context.Background()
    res, err := s.Email.SendEmail(ctx, req)
    if err != nil {
        log.Fatal(err)
    }

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