A simple web application for managing and distributing promo codes for upcoming bioinformatics workshops. Users can select an event, provide their affiliation and email, and receive a personalized promo code via email.
- Event Selection: Dropdown menu of upcoming workshops
- Affiliation Validation: Predefined categories for user affiliation
- Email Integration: Automated email delivery of promo codes
- Google Sheets Integration: Dynamic event loading and request logging
- Responsive Design: Works on desktop and mobile devices
-
Create a Google Sheet with the following structure:
- Events Tab: Columns for Event ID, Title, Date, Promo Code, Registration URL
- Logs Tab: Columns for Timestamp, Email, Affiliation, Event ID, Event Title, Promo Code
-
Enable Google Sheets API:
- Go to Google Cloud Console
- Create a new project or select existing
- Enable Google Sheets API
- Create credentials (API Key)
The application uses EmailJS for email delivery. To set up:
- Sign up at EmailJS
- Create an email service (Gmail, Outlook, etc.)
- Create an email template
- Update the
EMAIL_CONFIGinscript.js
Update the configuration in script.js:
const GOOGLE_SHEETS_CONFIG = {
spreadsheetId: 'YOUR_GOOGLE_SHEET_ID',
apiKey: 'YOUR_GOOGLE_API_KEY'
};
const EMAIL_CONFIG = {
serviceId: 'YOUR_EMAILJS_SERVICE_ID',
templateId: 'YOUR_EMAILJS_TEMPLATE_ID',
userId: 'YOUR_EMAILJS_USER_ID'
};- Clone the repository
- Open
index.htmlin a web browser - For Google Sheets integration, you'll need to set up CORS or use a proxy
Enable debug logging by setting the DEBUG environment variable:
DEBUG=promocodesThe site is configured for GitHub Pages deployment. Simply push to the main branch and the site will be automatically deployed.
├── index.html # Main HTML file
├── styles.css # CSS styling
├── script.js # JavaScript functionality
├── config.js # Configuration file
├── test.html # Test page
├── .github/workflows/ # GitHub Actions deployment
├── README.md # This file
└── docs/ # Documentation
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
MIT License - see LICENSE file for details