dinaf2026-web/awesome-web-skills/web-email-capture

Claude Code and agent skill by dinaf2026-web/awesome-web-skills

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Email capture and newsletter integration patterns — opt-in forms, Resend transactional email, Beehiiv/Mailchimp newsletter sync, drip sequence wiring, and conversion-optimized signup flows.

Install

npx vskill@latest install dinaf2026-web/awesome-web-skills/web-email-capture

SKILL.md

The same SKILL.md was published earlier as dinaf2026-web/awesome-web-skills/web-email-capture.

web-email-capture

Email capture and newsletter integration for Next.js 14 App Router. Covers Resend transactional email, Beehiiv/Mailchimp sync, double opt-in, drip sequences, popup capture, and conversion analytics.


1. When to Use Which

NeedToolWhy
Transactional email (welcome, receipts, password reset)ResendDeveloper-first, React Email templates, reliable delivery
Newsletter + paid subscriptionsBeehiivBuilt-in monetization, referral program, analytics
Marketing automation + CRMMailchimpAudience segmentation, A/B testing, large ecosystem
Creator-focused sequences + commerceConvertKitTag-based automation, creator tools, Stripe integration
Simple drip with code controlResend BroadcastsNo extra vendor, full control, cheap

Decision rule:

  • Start with Resend for all transactional.
  • Add Beehiiv if you want a hosted newsletter with growth tools.
  • Add Mailchimp only if you need heavy segmentation or existing list.
  • Use ConvertKit if you sell digital products to your list.
  • Never use two newsletter platforms simultaneously — sync is fragile.

2. Resend Setup

bash
npm install resend
ts
// lib/resend.ts
import { Resend } from 'resend'
if (!process.env.RESEND_API_KEY) {
throw new Error('RESEND_API_KEY is required')
}
export const resend = new Resend(process.env.RESEND_API_KEY)
ts
// .env.local
RESEND_API_KEY=re_xxxxxxxxxxxxxxxxxxxx
RESEND_FROM_EMAIL=hello@yourdomain.com
RESEND_FROM_NAME=Your Brand

Domain verification — add these DNS records in your registrar:

Type Name Value
TXT resend._domainkey.yourdomain (Resend provides this in dashboard)
MX send.yourdomain feedback-smtp.us-east-1.amazonses.com
TXT @ v=spf1 include:amazonses.com ~all

Verify ownership via the Resend dashboard under Domains. Transactional email requires a verified domain — never send from a free Gmail/Yahoo address.


3. Welcome Email Template

bash
npm install @react-email/components @react-email/render
tsx
// emails/WelcomeEmail.tsx
import {
Body,
Button,
Container,
Head,
Heading,
Hr,
Html,
Img,
Link,
Preview,
Section,
Text,
} from '@react-email/components'
interface WelcomeEmailProps {
firstName: string
confirmUrl?: string
unsubscribeUrl: string
}
export function WelcomeEmail({
firstName,
confirmUrl,
unsubscribeUrl,
}: WelcomeEmailProps) {
return (
<Html lang="en" dir="ltr">
<Head />
<Preview>Welcome — confirm your email to get started</Preview>
<Body style={body}>
<Container style={container}>
<Section style={logoSection}>
<Img
src="https://yourdomain.com/logo.png"
width="120"
height="40"
alt="Your Brand"
/>
</Section>
<Heading style={h1}>Welcome, {firstName}</Heading>
<Text style={text}>
Thanks for joining. You are one step away — confirm your email
address so we can send you the good stuff.
</Text>
{confirmUrl && (
<Section style={buttonSection}>
<Button style={button} href={confirmUrl}>
Confirm my email
</Button>
</Section>
)}
<Text style={mutedText}>
Button not working?{' '}
<Link href={confirmUrl} style={link}>
Copy this link
</Link>
</Text>
<Hr style={hr} />
<Text style={footer}>
You received this because you signed up at yourdomain.com.{' '}
<Link href={unsubscribeUrl} style={link}>
Unsubscribe
</Link>
</Text>
</Container>
</Body>
</Html>
)
}
// Inline styles — required for email clients. No Tailwind here.
const body: React.CSSProperties = {
backgroundColor: '#f6f9fc',
fontFamily:
'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
margin: 0,
padding: 0,
}
const container: React.CSSProperties = {
backgroundColor: '#ffffff',
border: '1px solid #e6ebf1',
borderRadius: '8px',
margin: '40px auto',
maxWidth: '560px',
padding: '40px',
}
const logoSection: React.CSSProperties = {
marginBottom: '32px',
}
const h1: React.CSSProperties = {
color: '#1a1a1a',
fontSize: '24px',
fontWeight: '700',
lineHeight: '1.3',
margin: '0 0 16px',
}
const text: React.CSSProperties = {
color: '#374151',
fontSize: '16px',
lineHeight: '1.6',
margin: '0 0 24px',
}
const mutedText: React.CSSProperties = {
...text,
color: '#6b7280',
fontSize: '14px',
}
const buttonSection: React.CSSProperties = {
margin: '0 0 24px',
textAlign: 'center',
}
const button: React.CSSProperties = {
backgroundColor: '#2563eb',
borderRadius: '6px',
color: '#ffffff',
display: 'inline-block',
fontSize: '16px',
fontWeight: '600',
padding: '12px 28px',
textDecoration: 'none',
}
const hr: React.CSSProperties = {
borderColor: '#e6ebf1',
margin: '32px 0',
}
const footer: React.CSSProperties = {
color: '#9ca3af',
fontSize: '12px',
lineHeight: '1.5',
}
const link: React.CSSProperties = {
color: '#2563eb',
}
ts
// lib/send-welcome.ts
import { render } from '@react-email/render'
import { resend } from './resend'
import { WelcomeEmail } from '@/emails/WelcomeEmail'
export async function sendWelcomeEmail({
to,
firstName,
confirmToken,
}: {
to: string
firstName: string
confirmToken: string
}) {
const confirmUrl = `${process.env.NEXT_PUBLIC_BASE_URL}/confirm?token=${confirmToken}`
const unsubscribeUrl = `${process.env.NEXT_PUBLIC_BASE_URL}/unsubscribe?email=${encodeURIComponent(to)}`
const html = await render(
WelcomeEmail({ firstName, confirmUrl, unsubscribeUrl }) as React.ReactElement
)
const { data, error } = await resend.emails.send({
from: `${process.env.RESEND_FROM_NAME} <${process.env.RESEND_FROM_EMAIL}>`,
to,
subject: 'Confirm your email',
html,
headers: {
'List-Unsubscribe': `<${unsubscribeUrl}>`,
'List-Unsubscribe-Post': 'List-Unsubscribe=One-Click',
},
})
if (error) {
throw new Error(`Resend error: ${error.message}`)
}
return data
}

4. Opt-In Form (Server Action + Double Opt-In)

ts
// lib/db/subscribers.ts
// Assumes Prisma — adapt to your ORM/DB
import { prisma } from '@/lib/prisma'
import crypto from 'crypto'
export async function createPendingSubscriber({
email,
firstName,
source,
}: {
email: string
firstName: string
source: string
}) {
const token = crypto.randomBytes(32).toString('hex')
const expiresAt = new Date(Date.now() + 24 * 60 * 60 * 1000) // 24h
const subscriber = await prisma.subscriber.upsert({
where: { email },
update: {
confirmToken: token,
confirmTokenExpiresAt: expiresAt,
status: 'PENDING',
firstName,
},
create: {
email,
firstName,
confirmToken: token,
confirmTokenExpiresAt: expiresAt,
status: 'PENDING',
source,
},
})
return { subscriber, token }
}
export async function confirmSubscriber(token: string) {
const subscriber = await prisma.subscriber.findFirst({
where: {
confirmToken: token,
confirmTokenExpiresAt: { gt: new Date() },
status: 'PENDING',
},
})
if (!subscriber) {
return null
}
return prisma.subscriber.update({
where: { id: subscriber.id },
data: {
status: 'ACTIVE',
confirmedAt: new Date(),
confirmToken: null,
confirmTokenExpiresAt: null,
},
})
}
ts
// app/actions/subscribe.ts
'use server'
import { z } from 'zod'
import { createPendingSubscriber } from '@/lib/db/subscribers'
import { sendWelcomeEmail } from '@/lib/send-welcome'
const schema = z.object({
email: z.string().email('Enter a valid email address'),
firstName: z.string().min(1, 'First name is required').max(50),
source: z.string().optional().default('unknown'),
})
type SubscribeState = {
success: boolean
error?: string
fieldErrors?: Record<string, string[]>
}
export async function subscribeAction(
_prev: SubscribeState,
formData: FormData
): Promise<SubscribeState> {
const raw = {
email: formData.get('email'),
firstName: formData.get('firstName'),
source: formData.get('source'),
}
const parsed = schema.safeParse(raw)
if (!parsed.success) {
return {
success: false,
fieldErrors: parsed.error.flatten().fieldErrors,
}
}
const { email, firstName, source } = parsed.data
try {
const { token } = await createPendingSubscriber({ email, firstName, source })
await sendWelcomeEmail({ to: email, firstName, confirmToken: token })
return { success: true }
} catch (err) {
console.error('Subscribe error:', err)
return { success: false, error: 'Something went wrong. Please try again.' }
}
}
tsx
// components/SubscribeForm.tsx
'use client'
import { useActionState } from 'react'
import { subscribeAction } from '@/app/actions/subscribe'
const initialState = { success: false }
interface SubscribeFormProps {
source?: string
className?: string
}
export function SubscribeForm({ source = 'inline', className }: SubscribeFormProps) {
const [state, action, isPending] = useActionState(subscribeAction, initialState)
if (state.success) {
return (
<div className={className} role="status">
<p className="text-green-700 font-medium">
Check your inbox — confirm your email to complete signup.
</p>
</div>
)
}
return (
<form action={action} className={className} noValidate>
<input type="hidden" name="source" value={source} />
<div className="space-y-3">
<div>
<label htmlFor="firstName" className="block text-sm font-medium text-gray-700 mb-1">
First name
</label>
<input
id="firstName"
name="firstName"
type="text"
autoComplete="given-name"
required
disabled={isPending}
className="w-full rounded-md border border-gray-300 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 disabled:opacity-50"
/>
{state.fieldErrors?.firstName && (
<p className="mt-1 text-xs text-red-600" role="alert">
{state.fieldErrors.firstName[0]}
</p>
)}
</div>
<div>
<label htmlFor="email" className="block text-sm font-medium text-gray-700 mb-1">
Email address
</label>
<input
id="email"
name="email"
type="email"
autoComplete="email"
required
disabled={isPending}
className="w-full rounded-md border border-gray-300 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 disabled:opacity-50"
/>
{state.fieldErrors?.email && (
<p className="mt-1 text-xs text-red-600" role="alert">
{state.fieldErrors.email[0]}
</p>
)}
</div>
{state.error && (
<p className="text-sm text-red-600" role="alert">
{state.error}
</p>
)}
<button
type="submit"
disabled={isPending}
className="w-full rounded-md bg-blue-600 px-4 py-2 text-sm font-semibold text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed"
>
{isPending ? 'Subscribing…' : 'Get free access'}
</button>

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/dinaf2026-web/awesome-web-skills/web-email-capture/badge)](https://verified-skill.com/skills/dinaf2026-web/awesome-web-skills/web-email-capture)

Something wrong with this skill or its page? Tell us.