Automatically filter Final Year Project survey emails from IIT students, keeping your inbox clean and organized!
This Google Apps Script automatically:
- ✅ Detects survey emails from IIT students (emails like
firstname.20######@iit.ac.lk) - ✅ Moves them to a dedicated "FYP Surveys" label
- ✅ Archives them from your inbox
- ❌ Ignores emails from lecturers and staff
- ❌ Ignores coursework, lectures, and official communications
- A Google account with IIT email access
- 5 minutes of setup time
-
Go to Google Apps Script
- Visit script.google.com
- Click "New Project"
-
Copy the Code
- Delete any placeholder code
- Copy the entire content from
code.gsin this repo - Paste it into the script editor
-
Save the Project
- Click "Untitled project" at the top
- Name it:
IIT FYP Filter - Press
Ctrl + S(orCmd + Son Mac)
-
Test the Script
- Select
filterFYPEmailsfrom the dropdown - Click the Run button (
▶️ ) - First run only: Authorize the script
- Click "Review Permissions"
- Select your IIT account
- Click "Advanced" → "Go to IIT FYP Filter (unsafe)" → "Allow"
- Check Gmail - survey emails should be in "FYP Surveys" label!
- Select
-
Set Up Automatic Running
- Click the clock icon (⏰) "Triggers" in the left sidebar
- Click "+ Add Trigger"
- Configure:
- Function:
filterFYPEmails - Event source:
Time-driven - Type:
Minutes timer - Interval:
Every 5 minutes(recommended) orEvery hour
- Function:
- Click "Save"
Done! 🎉 The script will now run automatically and keep filtering survey emails!
- Survey emails from students (
firstname.20######@iit.ac.lk) - Research project participation requests
- FYP questionnaires and feedback forms
- Academic research surveys
- Emails from lecturers/staff (
firstname.x@iit.ac.lk) - Course materials and lectures
- Submissions and coursework
- Official academic communications
- Administrative emails
The script uses two filtering methods:
Searches for common survey-related phrases:
- "survey", "your feedback", "research project"
- "participation", "help us", "your input"
- "quick survey", "take a few minutes", "fill it out"
- "help shape", "spare a minute", "would appreciate"
- "your responses", "complete the survey", "usability study"
- "academic survey", "research survey", "invitation to"
- "request for participation", "opinion matters", "make a difference"
- "your valuable", "short survey", "brief survey"
Uses regex pattern matching to identify student emails:
- Pattern:
\.20\d{6}@iit\.ac\.lk - Matches:
alex.20210279@iit.ac.lk✅ - Ignores:
john.d@iit.ac.lk❌
Only emails matching BOTH criteria get filtered.
Edit line 13 in code.gs:
var labelName = "FYP Surveys"; // Change to whatever you wantEdit the searchQueries array (line 19) to add more detection patterns:
'from:@iit.ac.lk (survey OR "your new keyword" OR "another phrase")';In the Triggers settings, adjust the timer interval:
- Every 5 minutes (most responsive)
- Every 10 minutes (balanced)
- Every hour (lightest on resources)
- ✅ No data collection: Script runs entirely in your Google account
- ✅ Open source: All code is visible and auditable
- ✅ No external servers: No data leaves Google's infrastructure
- ✅ Reversible: Emails are archived, not deleted - easily recoverable
- ✅ Revocable: Remove permissions anytime from Google Account settings
- Gmail access: To read email metadata and apply labels
- Trigger management: To run automatically on schedule
- Check if the trigger is active (clock icon in Apps Script)
- View execution logs: Click "Executions" in the left sidebar
- Verify your test email matches the student pattern (
firstname.20######@iit.ac.lk)
- Go to myaccount.google.com/permissions
- Remove "IIT FYP Filter"
- Re-run the script and re-authorize
- Go to Apps Script → Triggers (clock icon)
- Click the three dots next to your trigger
- Select "Delete trigger"
- The script checks every 5 minutes (or your chosen interval)
- It only processes up to 50 emails per run
- If you have a backlog, it may take a few runs to catch up
iit-fyp-survey-filter/
├── code.gs # Main script file
└── README.md # This file
Contributions welcome! If you find bugs or have suggestions:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Add support for other universities
- Create a web interface for configuration
- Add email templates for common survey responses
- Improve regex patterns for better accuracy
- Issues: Open an issue on GitHub
- Questions: Start a discussion in the Discussions tab
- Thanks to all IIT students who unknowingly inspired this project by flooding our inboxes! 😄
Note: This is an unofficial tool created by students for students. Not affiliated with IIT or University of Westminster.
Disclaimer: Use at your own discretion. While this script is designed to be safe and reversible, always review filtered emails periodically to ensure no important messages are missed.