Markdown

Groundmail with Strapi

Use strapi-provider-email-groundmail as the email provider for Strapi 5 or Strapi 4. Password resets, account confirmations and every strapi.plugin('email') send then go out through Groundmail.

Updated Oct 16, 20261 min read

Install

Terminal
npm install strapi-provider-email-groundmail
Terminal
GROUNDMAIL_API_KEY=gm_your_key_here

Configure the email plugin

TypeScript
// config/plugins.ts
export default ({ env }) => ({
  email: {
    config: {
      provider: 'strapi-provider-email-groundmail',
      providerOptions: {
        apiKey: env('GROUNDMAIL_API_KEY'),
      },
      settings: {
        defaultFrom: 'Acme <noreply@yourdomain.com>',
        defaultReplyTo: 'support@yourdomain.com',
      },
    },
  },
})

defaultFrom must be on a domain you have verified in Groundmail. Restart Strapi, then send a test from Settings → Email in the admin panel.

Send from your code

TypeScript
await strapi.plugin('email').service('email').send({
  to: 'user@example.com',
  subject: 'Welcome to Acme',
  html: '<p>Thanks for signing up.</p>',
  text: 'Thanks for signing up.',
})

Besides Strapi's from, to, cc, bcc, replyTo, subject, text and html, a send can pass:

Field Purpose
attachments [{ filename, content, contentType }], content as a string or Buffer (set encoding: 'base64' for base64 strings)
template { id, variables } to send a Groundmail template instead of html/text
tags { name: value } tags for filtering and webhooks
headers Extra email headers
idempotencyKey Send once, even when your code retries
scheduledAt ISO 8601 time to send later

Provider options

Option Purpose
apiKey Groundmail API key. Falls back to GROUNDMAIL_API_KEY
baseUrl Override the API base URL

Source

Groundmail/strapi-provider-email-groundmail

Was this page helpful?