•Email headers: dark #1a1a1a background with gold #c9a55c title text
•Always use branded HTML emails — never plain text
•Monthly newsletters, event invitations, bulk outreach, and blog highlights must use the REALPRO Foundation logo header, branded footer, and working unsubscribe/disclaimer language
💰 Financial Rules
•Artist sales split: 80% to artist, 20% to REALPRO Foundation
•Partner event sponsorship split: 80% to partner org, 20% to REALPRO Foundation (configurable per event)
•Always create a PartnerPayout record when a partner event receives a sponsorship
•Always create order/transaction records before sending confirmation emails
📧 Email Rules
•All emails sent from name: "REALPRO Foundation"
•Always send confirmation email to the buyer/sponsor first
•Always notify admin (GallerySettings.contact_email) of any payment or significant action
•Use Gmail connector (OAuth) when available; fall back to Core.SendEmail
•Every non-transactional email must include visible unsubscribe links for event emails, newsletters, and unsubscribe-all options
•Unsubscribe links must route to https://www.realprofoundation.org/UnsubscribePreferences and update UserPreference records
🔒 Security Rules
•Never expose Stripe secret keys or webhook secrets in frontend code
•Always validate Stripe webhooks with constructEventAsync (Deno async crypto)
•Admin-only backend functions must check user.role === 'admin' and return 403 if not
•Public-facing pages (ticket claim, tax docs, event detail) do NOT require login
🗂️ Code Architecture
•Keep component files under ~100 lines — break into focused sub-components
•All new pages MUST be added as explicit <Route> elements in App.jsx
•Use find_replace tool for all edits — never rewrite entire files unless necessary
•Never build new functionality into already-large files without refactoring first
Note: These rules are stored in PROJECT_RULES.md at the root of the codebase and should be referenced before building any new feature.