Invitation email

I probably missed something but in the doc, I don't understand how the invitation email is actually sent.
We can read this:
await authClient.organization.inviteMember({
    email: "test@email.com",
    role: "admin", //this can also be an array for multiple roles (e.g. ["admin", "sale"])
})

No email is sent as obviously, better-auth doesn't know how to send an email.

My stack:
  • Sveltekit
  • Drizzle + Zod
  • Better-auth
Here is my config
{
  baseURL: "http://localhost:5173",
  secret: AUTH_SECRET || "your-secret-key-at-least-32-characters",
  database: drizzleAdapter(db, {
    provider: "pg",
    schema: schema,
  }),
  user: {
    additionalFields: {
      firstName: {
        type: "string",
        required: true,
        input: true
      },
      lastName: {
        type: "string",
        required: true,
        input: true
      },
      role: {
        type: "string",
        required: true,
        input: false
      }
    }
  },
  emailAndPassword: {
    enabled: true,
    fromEmail: "noreply@example.com"
  },
  socialProviders: {
    google: {
      clientId: GOOGLE_CLIENT_ID,
      clientSecret: GOOGLE_CLIENT_SECRET,
    },
  },
  plugins: [
    organization(),
    admin()
  ],
  
  debug: process.env.NODE_ENV !== 'production',
}

Can anyone point me in the right direction?
Was this page helpful?