Mailerlite Email Marketing

Set up email marketing and newsletters with Mailerlite for your AI SaaS landing page.

What is Mailerlite?

Mailerlite is an email marketing platform that helps you:

  • Collect email subscribers
  • Send newsletters and campaigns
  • Create automated email sequences
  • Track engagement and analytics
  • Build your audience

Why Mailerlite?

  • šŸ“§ Easy to Use - Intuitive interface and email builder
  • šŸ†“ Free Tier - Up to 1,000 subscribers free
  • šŸ“Š Analytics - Track opens, clicks, and conversions
  • šŸ¤– Automation - Set up email sequences
  • šŸŽØ Beautiful Templates - Pre-designed email templates

Setup Guide

1. Create Mailerlite Account

  1. Go to mailerlite.com and sign up
  2. Verify your email address
  3. Complete your profile setup

2. Get API Key

  1. Click your profile icon → Integrations
  2. Go to Mailerlite API
  3. Click Generate new token
  4. Copy the API key

Add to .env.local:

MAILERLITE_API_KEY=eyJ...

3. Create a Group

Groups organize your subscribers:

  1. Go to Subscribers → Groups
  2. Click Create Group
  3. Name it: Newsletter Subscribers or Landing Page Leads
  4. Copy the Group ID (you'll need this)

Landing Page Integration

Your landing page includes an email signup form. Here's how it works:

Email Signup Form

Located in your homepage (page.tsx):

const handleSubscribe = async (e: React.FormEvent) => {
  e.preventDefault();
  setIsSubscribing(true);
  
  try {
    const response = await fetch('/api/subscribe', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({ email }),
    });
    
    if (response.ok) {
      setSubscribeMessage('Thanks for subscribing!');
      setEmail('');
    }
  } catch (error) {
    setSubscribeMessage('Something went wrong. Try again.');
  }
  
  setIsSubscribing(false);
};

API Route

Create /api/subscribe/route.ts:

import { NextResponse } from 'next/server';

const MAILERLITE_API_KEY = process.env.MAILERLITE_API_KEY;
const MAILERLITE_GROUP_ID = process.env.MAILERLITE_GROUP_ID;

export async function POST(req: Request) {
  const { email } = await req.json();
  
  if (!email) {
    return NextResponse.json(
      { error: 'Email required' },
      { status: 400 }
    );
  }
  
  try {
    const response = await fetch(
      'https://connect.mailerlite.com/api/subscribers',
      {
        method: 'POST',
        headers: {
          'Content-Type': 'application/json',
          'Authorization': `Bearer ${MAILERLITE_API_KEY}`,
        },
        body: JSON.stringify({
          email,
          groups: [MAILERLITE_GROUP_ID],
        }),
      }
    );
    
    if (!response.ok) {
      throw new Error('Failed to subscribe');
    }
    
    return NextResponse.json({ success: true });
  } catch (error) {
    return NextResponse.json(
      { error: 'Failed to subscribe' },
      { status: 500 }
    );
  }
}

Environment Variables

Add to .env.local:

MAILERLITE_API_KEY=eyJ...
MAILERLITE_GROUP_ID=123456789

Email Campaigns

Welcome Email Sequence

Set up an automated welcome sequence:

  1. Go to Automation → Create Workflow
  2. Trigger: Subscriber joins a group
  3. Add emails:
    • Email 1: Welcome + introduce your product (send immediately)
    • Email 2: Share a success story (send after 2 days)
    • Email 3: Special offer or call-to-action (send after 5 days)

Newsletter Campaign

Send one-time campaigns:

  1. Go to Campaigns → Create Campaign
  2. Choose Regular Campaign
  3. Design your email
  4. Select your subscriber group
  5. Schedule or send immediately

Email Templates

Welcome Email Example

Subject: Welcome to ArchitectGBT! šŸš€

Hi there!

Thanks for joining our community. ArchitectGBT helps you find the perfect AI model for your project in seconds.

Here's what you can do:
āœ“ Get instant AI model recommendations
āœ“ Compare costs across 20+ models
āœ“ Download production-ready code templates

Ready to get started?
[Get Started Now]

Best,
The ArchitectGBT Team

Product Update Email

Subject: New AI Models Added! GPT-5 & Claude Opus 4.5

Hi,

Big news! We've just added the latest AI models:

šŸ¤– GPT-5.1 - OpenAI's smartest model yet
🧠 Claude Opus 4.5 - Best for coding
⚔ Gemini 2.5 Flash - Fastest & cheapest

Check them out on your dashboard:
[View New Models]

Happy building!

Tracking & Analytics

Monitor your email performance:

  1. Go to Campaigns → Select campaign
  2. View metrics:
    • Open Rate - How many opened your email
    • Click Rate - How many clicked links
    • Unsubscribe Rate - Who opted out
    • Bounce Rate - Invalid emails

Aim for:

  • Open rate: 20%+
  • Click rate: 2-5%
  • Unsubscribe rate: less than 0.5%

Best Practices

Growing Your List

  • Add signup form to your landing page āœ…
  • Offer incentive (free template, guide, etc.)
  • Share preview of what subscribers get
  • Make unsubscribing easy

Email Content

  • Write compelling subject lines (keep under 50 chars)
  • Personalize with first name
  • Include clear call-to-action
  • Mobile-friendly design
  • Test before sending

Compliance

  • Include unsubscribe link (Mailerlite adds automatically)
  • Add your physical address
  • Only email people who opted in
  • Follow GDPR/CAN-SPAM laws

Segmentation

Create targeted segments:

  1. New Subscribers - Welcome sequence
  2. Active Users - Product updates
  3. Inactive Users - Re-engagement campaign
  4. Pro Users - Advanced features

A/B Testing

Test what works:

  1. Go to campaign → A/B Test
  2. Test variables:
    • Subject lines
    • Send times
    • Email content
    • Call-to-action buttons
  3. Send to 20% of list
  4. Winner goes to remaining 80%

Production Checklist

  • [ ] API key added to environment variables
  • [ ] Group ID configured
  • [ ] Welcome email sequence created
  • [ ] Unsubscribe link working
  • [ ] Mobile-responsive templates
  • [ ] Email verified with Mailerlite
  • [ ] GDPR compliance checked

Common Issues

Emails Going to Spam

  • Verify your domain with Mailerlite
  • Avoid spam trigger words ("free", "buy now")
  • Don't use all caps in subject
  • Include text version (not just HTML)

Low Open Rates

  • Improve subject lines
  • Send at optimal times (Tue-Thu, 10am)
  • Clean your list (remove inactive subscribers)
  • Segment your audience

API Errors

  • Verify API key is correct
  • Check group ID exists
  • Ensure email format is valid
  • Check API rate limits

Resources


Next: Deploy to Vercel →