A comprehensive email notification system with API endpoints for integration, supporting reminders, alerts, newsletters, and transactional emails.
POST /api/recipients - Add new recipientGET /api/recipients - List all recipientsPUT /api/recipients/:id - Update recipientDELETE /api/recipients/:id - Remove recipientPOST /api/templates - Create email templateGET /api/templates - List all templatesPUT /api/templates/:id - Update templateDELETE /api/templates/:id - Delete templatePOST /api/notifications/send - Send immediate notificationPOST /api/webhooks/notification - Webhook endpoint for triggering notificationsPOST /api/forms/submit - Form submission endpointGET /api/notifications/history - Get notification historyGET /api/notifications/stats - Get sending statistics├── backend/
│ ├── database/
│ │ ├── migrations.ts # Database schema setup
│ │ └── queries.ts # Database query functions
│ ├── routes/
│ │ ├── recipients.ts # Recipient management
│ │ ├── templates.ts # Template management
│ │ ├── notifications.ts # Notification sending
│ │ ├── webhooks.ts # Webhook handling
│ │ └── forms.ts # Form submission handling
│ ├── services/
│ │ ├── emailService.ts # Email sending logic
│ │ ├── recipientService.ts # Recipient filtering
│ │ └── templateService.ts # Template processing
│ └── index.ts # Main API server
├── shared/
│ └── types.ts # Shared TypeScript types
└── README.md
curl -X POST /api/recipients \ -H "Content-Type: application/json" \ -d '{ "email": "user@example.com", "name": "John Doe", "tags": ["premium", "newsletter"], "preferences": { "notifications": true, "newsletters": true } }'
curl -X POST /api/templates \ -H "Content-Type: application/json" \ -d '{ "name": "welcome_email", "type": "transactional", "subject": "Welcome {{name}}!", "html": "<h1>Welcome {{name}}</h1><p>Thanks for joining!</p>", "text": "Welcome {{name}}! Thanks for joining!" }'
curl -X POST /api/notifications/send \ -H "Content-Type: application/json" \ -d '{ "type": "alert", "template": "system_alert", "criteria": { "tags": ["admin"], "preferences.notifications": true }, "data": { "message": "System maintenance scheduled", "time": "2024-01-15T10:00:00Z" } }'
No API keys required - uses Val Town's built-in email service.