Email Management System - Complete Integration Guide

Everything you need to send professional, personalized emails at scale

Quick Start - 3 Steps
1

Go to Email Management

Click "Email Management" in the admin sidebar

2

Click "Load Sample Templates"

Get started with 5 professionally designed email templates

3

Edit, Preview & Activate

Customize templates with merge tags and test with real data

✅ Implemented Features (Phase 1)

Email Template Editor

✓ 8 template types (sponsorship, artwork, donation, artist, events)

✓ Merge tag insertion with autocomplete

✓ HTML + plain text support

✓ Brand customization (from_name, colors)

✓ Template versioning & audit trail

✓ Active/inactive status toggle

Go to Templates →
Template Preview System

✓ Live preview with test data

✓ Merge tag replacement simulation

✓ HTML & code view

✓ Logo from GallerySettings

✓ Mobile-responsive preview

✓ Sample data for each template type

Click "Eye" icon on any template to preview

Sponsor Ticket Claiming

✓ Claim token-based access control

✓ Multi-ticket assignment UI

✓ Email validation & error handling

✓ QR code generation for each ticket

✓ Printable ticket design

✓ Email preview before sending

View Ticket Claiming →
Merge Tags System

✓ Sponsor data: name, email, tier, amount

✓ Event data: name, date, location

✓ Ticket data: count, claim link

✓ Artwork data: title, artist, price

✓ Dynamic content with conditions

✓ Custom merge tag definitions per type

Syntax: {{merge_tag}}

📧 Email Type Specifications

💳 Sponsorship Confirmation
Priority

When: After sponsor completes Stripe payment

Merge Tags: {{sponsor_name}}, {{amount}}, {{tier_name}}, {{ticket_count}}, {{claim_link}}, {{event_name}}

Content: Thank you message, benefits list, ticket claiming instructions, tax information

Action: Provides "Claim Your Tickets" button with unique token

📋 Sponsorship Pre-Payment

When: Before sponsor completes checkout (preview email)

Merge Tags: {{sponsor_name}}, {{amount}}, {{tier_name}}, {{benefits_list}}, {{event_name}}

Content: Package summary, benefits breakdown, call to action

Purpose: Confirm sponsor understands what they're purchasing

🎨 Artwork Purchase & Donation Emails

Artwork Purchase: Order confirmation with artist info and tracking

Donation: Tax-deductible confirmation with impact message

Artist Onboarding: Welcome series with setup instructions

Artist Exhibition: Notification when artist work is featured

🔗 Integration Points

Stripe Webhook Flow

Stripe → stripe-webhook function → sendSponsorshipConfirmation → EmailTemplate lookup → Merge tag replacement → Email send

Ticket Claiming Flow

Claim link (with token) → SponsorTicketClaim page → claimSponsorshipTickets function → Email preview → Guest assignment → Ticket email sent

Admin Management

AdminEmailManagement → Templates tab → Load sample templates → Edit/preview → Save changes → Template activated for use

📊 Database Entities

EmailTemplate

template_type

subject

body

from_name

is_active

EmailCampaign

name

campaign_type

trigger_event

status

is_active

SponsorshipTicket

claim_token

ticket_code

recipient_name

status

sent_at

🎯 Next Phase - Coming Soon

Email Campaign Engine: Automated sequences triggered by user events (signup, purchase, etc.)

Email Delivery Service: Integration with SendGrid/Mailgun for reliable delivery

Analytics Dashboard: Track opens, clicks, bounces, and engagement metrics

GDPR Compliance: Consent management, unsubscribe handling, data retention

See Roadmap page for complete implementation timeline