MyApp

Getting Started

IntroductionInstallationPull Updates
Architecture

Setup

IDEAI AgentsMCP ServersEnvironment Variables

Workflow

Git WorkflowBuild & DeployTroubleshooting

Authentication

OverviewSetup & ConfigurationUsage & IntegrationTroubleshooting

Payments

OverviewSetup & ConfigurationUsage & IntegrationTroubleshooting

Supabase

OverviewSetup & ConfigurationTroubleshooting

Database

Database SetupPrisma ORMUsage & IntegrationMigrationsTroubleshooting

Storage

OverviewSetup & ConfigurationUsage & IntegrationTroubleshooting

Emails

OverviewSetup and ConfigurationUsage and IntegrationTroubleshooting

SEO

OverviewConfiguration & Best PracticesCustomization & Optimization

UI

OverviewSetup and ConfigurationThemingTroubleshooting
MyApp

Setup and Configuration

Configure Resend and Mailchimp for transactional emails and newsletter management

Configure both Resend (transactional emails) and Mailchimp (newsletters) by setting up API keys, DNS records, and environment variables.

Resend Setup

Create Resend Account

Sign up at Resend and access the dashboard.

Get API Key

Navigate to API Keys and generate a new key.

Configure DNS

Add your domain in Resend dashboard and copy the DNS records (DKIM, SPF, DMARC). Add these to your domain registrar and verify in Resend.

Add Environment Variable

Env VariableTypeDefault
RESEND_API_KEY
string
re_xxxx

Mailchimp Setup

Create Mailchimp Account

Sign up at Mailchimp and access the dashboard.

Create Audience

Navigate to Audience → Create Audience and set up your newsletter list. Copy the Audience ID from Audience settings.

Get API Key

Go to Account → Extras → API Keys and create a new key. Note the server prefix (e.g., us6, us19) from the key.

Add Environment Variables

Env VariableTypeDefault
MAILCHIMP_API_KEY
string
-
MAILCHIMP_API_SERVER
string
-
MAILCHIMP_AUDIENCE_ID
string
-

Environment Variables

Add all email-related variables to .env:

.env
# Resend
RESEND_API_KEY="re_xxxx"

# Mailchimp
MAILCHIMP_API_KEY="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-us19"
MAILCHIMP_API_SERVER="us6"
MAILCHIMP_AUDIENCE_ID="xxxxxxxxxx"

Ensure .env is in .gitignore to protect API keys.

Verify Configuration

Run the development server to validate environment variables:

Terminal
npm run dev

If validation fails, check your API keys in the respective dashboards.

Client Initialization

Resend client is initialized in lib/resend/resend.ts:

lib/resend/resend.ts
import { env } from '@/env';
import { Resend } from 'resend';

export const resend = new Resend(env.RESEND_API_KEY);

Mailchimp is accessed via API in app/api/resend/newsletter/route.ts using environment variables.

Next Steps

  • Usage and Integration - Send emails and manage subscribers
  • Troubleshooting - Common issues

How is this guide ?

Last updated on

Overview

Learn about Plainform's email system using Resend for transactional emails and Mailchimp for newsletter management

Usage and Integration

Send transactional emails with Resend and manage newsletter subscriptions with Mailchimp

On this page

Resend Setup
Create Resend Account
Get API Key
Configure DNS
Add Environment Variable
Mailchimp Setup
Create Mailchimp Account
Create Audience
Get API Key
Add Environment Variables
Environment Variables
Verify Configuration
Client Initialization
Next Steps