Skip to content
This repository was archived by the owner on Oct 17, 2026. It is now read-only.
GroundmailPublic archive

About

Not maintained: use the Groundmail Go client, github.com/Groundmail/groundmail-sdks/go

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Groundmail

Groundmail for PocketBase

Send PocketBase email through the Groundmail transactional email API instead of SMTP.
Verification emails, password resets, OTPs and your own sends all go through Groundmail.

Go reference License: MIT

Docs · Get a free account · groundmail.dev


For PocketBase used as a Go framework (v0.23 and later).

Install

go get github.com/Groundmail/groundmail-pocketbase
GROUNDMAIL_API_KEY=gm_your_key_here

Usage

package main

import (
	"log"

	groundmailpb "github.com/Groundmail/groundmail-pocketbase"
	"github.com/pocketbase/pocketbase"
)

func main() {
	app := pocketbase.New()

	// Reads GROUNDMAIL_API_KEY; or pass groundmailpb.Options{APIKey: "gm_…"}.
	if err := groundmailpb.Register(app, groundmailpb.Options{}); err != nil {
		log.Fatal(err)
	}

	if err := app.Start(); err != nil {
		log.Fatal(err)
	}
}

Register hooks OnMailerSend, so every email the app sends goes through Groundmail and PocketBase's SMTP settings are not used. Set the sender under Settings → Mail settings in the dashboard, on a domain you have verified in Groundmail.

Use the mailer directly

groundmailpb.Mailer implements PocketBase's mailer.Mailer interface:

m, err := groundmailpb.New(groundmailpb.Options{})
if err != nil {
	return err
}
return m.Send(&mailer.Message{
	From:    mail.Address{Name: "Acme", Address: "noreply@yourdomain.com"},
	To:      []mail.Address{{Address: "user@example.com"}},
	Subject: "Your receipt",
	HTML:    "<p>Thanks for your purchase.</p>",
})

Attachments and inline attachments are sent with the message; inline files are referenced by name (cid:logo.png).

Contributing

Found a bug or want something added? Open an issue. This code is published here on each release, so we port fixes rather than merging pull requests directly.

Why Groundmail

  • Our own mail servers and IP space. Your password resets and receipts don't share a pool with bulk marketing senders.
  • Transactional email only. No newsletters or cold outreach on the platform, which keeps the sending reputation clean.
  • Start free. 3,000 emails a month on the Free plan; Pro is 50,000 emails for $20/month. Dedicated IPs on Scale.
  • Built for code and for agents. REST API, SMTP, SDKs for Node, Python, Go, PHP and Ruby, a CLI, and an MCP server for Claude, ChatGPT and Cursor.

All Groundmail libraries

Use Package
Node.js / TypeScript groundmail on npm
Python, Go, Ruby Groundmail/groundmail-sdks
PHP Groundmail/groundmail-php
Laravel Groundmail/groundmail-laravel
Symfony Mailer Groundmail/groundmail-symfony-mailer
Nodemailer Groundmail/groundmail-nodemailer
NestJS Groundmail/nestjs-groundmail
Strapi Groundmail/strapi-provider-email-groundmail
Medusa Groundmail/medusa-notification-groundmail
AdonisJS Groundmail/adonisjs-groundmail
Rails (Action Mailer) Groundmail/groundmail-rails
Phoenix (Swoosh) Groundmail/swoosh_groundmail
PocketBase Groundmail/groundmail-pocketbase
CLI groundmail-cli on npm
MCP server (Claude, ChatGPT, Cursor) Groundmail/groundmail-mcp
Agent skills and Claude Code plugin Groundmail/groundmail-skills

Website · Docs · Pricing · Sign up free

About

Not maintained: use the Groundmail Go client, github.com/Groundmail/groundmail-sdks/go

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages