Skip to content

GetTestMail/go-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-sdk

Go client for interacting with the GetTestMail API, which provides a simple way to create temporary email addresses and receive emails sent to them.

Usage

To create a new GetTestMail API client, you need to instantiate the GetTestMail class with your API key. To get an API key, sign up for a free account.

package main

import (
	"context"
	"log"

	"github.com/GetTestMail/go-sdk/client"
)

func main() {
	c := client.NewGetTestMailClient("YOUR_API_KEY")

	// Create a new GetTestMail
	getTestMail, err := c.CreateNew(context.Background())
	if err != nil {
		panic(err)
	}

	// Wait for a message to arrive
	getTestMail, err = c.WaitForMessage(context.Background(), getTestMail.ID)
	if err != nil {
		panic(err)
	}

	log.Print(getTestMail.Message.Text)
}

License

This project is licensed under the MIT License - see the LICENSE file for details

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages