Ranla with Go

Use the Go SDK in HTTP handlers, workers, cron jobs, or any server-side Go service where your API key can stay private.

1. Install the SDK

go get github.com/Super-Send/supersendtx-sdks/go/[email protected]

2. Configure your API key

export RANLA_API_KEY=rnl_your_key_here

3. Send an email

package main

import (
	"fmt"
	"log"
	"os"

	ranla "github.com/Super-Send/supersendtx-sdks/go/ranla"
)

func main() {
	client, err := ranla.New(os.Getenv("RANLA_API_KEY"))
	if err != nil {
		log.Fatal(err)
	}

	result, err := client.Emails.Send(map[string]any{
		"from":    "[email protected]",
		"to":      "[email protected]",
		"subject": "Your receipt",
		"html":    "<p>Thanks for your purchase.</p>",
	})
	if err != nil {
		log.Fatal(err)
	}

	fmt.Println(result["id"], result["status"])
}

Resources

The client includes thin wrappers for common API resources:

  • client.Emails — send, batch, list, cancel, resend, test webhooks, deliverability insights
  • client.Domains — create, verify, apply DNS, update, delete
  • client.Webhooks — CRUD for webhook endpoints
  • client.Templates — CRUD plus publish
  • client.Suppressions — list, create, remove

See the API reference for request fields. The Go SDK accepts the same JSON shapes as the REST API.

Source

Package source lives in go/ranla/ in the public supersendtx-sdks repository.