A Next.js application for the Invasion Day campaign, featuring donation functionality with Stripe integration and comprehensive custom receipt system.
Invasion Day is a campaign coordinated by Common Threads. This application provides:
- Donation processing with Stripe integration
- Custom email receipts with substantial content
- Admin interface for receipt management
- Professional branding and user experience
First, install dependencies:
npm install
# or
yarn installSet up your environment variables:
cp .env.example .env.localAdd your Stripe keys and other configuration:
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_...
STRIPE_SECRET_KEY=sk_test_...Run the development server:
npm run dev
# or
yarn devOpen http://localhost:3000 with your browser to see the result.
The application includes a comprehensive custom receipt system with:
- Substantial text content explaining campaign impact
- Personal greeting with donor's first name
- Professional formatting and branding
- Custom message functionality for personal touches
- Dynamic templates based on donation type and amount
- ✅ Complete DGR information with ABN: 76 158 172 484
- ✅ Tax deductibility details for donations over $2
- ✅ Campaign context about Invasion negotiations
- ✅ Impact descriptions of how donations are used
- ✅ Contact information for questions and support
- Receipt System Guide - Complete documentation for the custom receipt system
- Email Customization - Guide for customizing email content and templates
pages/api/create-payment-intent.ts- Create one-off donationspages/api/create-subscription.ts- Create recurring donationspages/api/send-custom-receipt.ts- Send custom receipts with substantial content
Access the receipt management interface at /admin/receipts to:
- View recent payments
- Send custom receipts
- Add personal messages
- Manage receipt templates
Use Stripe's sandbox test cards for testing:
- Success:
4242 4242 4242 4242 - Declined:
4000 0000 0000 0002 - Insufficient funds:
4000 0000 0000 9995
- Make a test donation
- Access
/admin/receipts - Send a custom receipt
- Check the generated HTML
src/
├── components/
│ ├── CustomReceiptManager.tsx # Receipt management UI
│ ├── form/
│ │ └── DonateForm.tsx # Donation form
│ └── ui/ # UI components
├── lib/
│ └── receipt-templates.ts # Receipt template configuration
├── pages/
│ ├── admin/
│ │ └── receipts.tsx # Admin interface
│ ├── api/ # API routes
│ └── donate.tsx # Donation page
└── styles/
└── globals.css # Global styles
Edit receipt content in src/lib/receipt-templates.ts:
export const defaultReceiptTemplate: ReceiptTemplate = {
subject: 'Thank you for your donation to Invasion Day',
// Customize impact descriptions, tax info, and more
};Update colors and styling in the template configuration:
branding: {
primaryColor: '#1a1a1a',
secondaryColor: '#2d5a27',
}The easiest way to deploy is using Vercel.
Check out the Next.js deployment documentation for more details.
For questions about the receipt system or customization needs, please contact the development team.