A modern, lightweight SaaS application for scheduling and automating personalized email reminders.
This app uses external cron services for automated email sending (100% FREE!).
📖 See CRON_SETUP.md for complete setup instructions.
- 🔐 Google OAuth Authentication - Secure sign-in with Google
- 👥 Subscriber Management - Add and manage recipients with service details
- 📧 Smart Templates - Create reusable email templates with dynamic variables
- 📅 Flexible Scheduling - Set up monthly or custom interval automations
- 🎨 Modern UI - Mobile-first, responsive design with smooth animations
- 🔒 Secure - User data isolation and input validation
- Framework: Next.js 14 (App Router)
- Language: TypeScript
- Database: MongoDB with Mongoose
- Authentication: NextAuth.js v5
- Styling: Tailwind CSS
- Email: Resend API
- Deployment: Vercel-ready
- Node.js 18+
- MongoDB database (local or MongoDB Atlas)
- Google OAuth credentials
- Resend API key
- Clone the repository and install dependencies:
npm install- Create a
.env.localfile in the root directory:
# MongoDB
MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/mailuto?retryWrites=true&w=majority
# NextAuth
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your-secret-key-here-generate-with-openssl
# Google OAuth
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
# Resend Email API
RESEND_API_KEY=your-resend-api-key
FROM_EMAIL=noreply@yourdomain.com- Go to Google Cloud Console
- Create a new project or select an existing one
- Enable the Google+ API
- Create OAuth 2.0 credentials
- Add authorized redirect URI:
http://localhost:3000/api/auth/callback/google - Copy the Client ID and Client Secret to your
.env.localfile
- Sign up at Resend
- Get your API key from the dashboard
- Add your API key to
.env.local - Verify your domain or use the provided test email for development
openssl rand -base64 32Add the output to NEXTAUTH_SECRET in .env.local
npm run devOpen http://localhost:3000 in your browser.
mailuto/
├── app/
│ ├── api/ # API routes
│ │ ├── auth/ # NextAuth routes
│ │ ├── subscribers/ # Subscriber CRUD
│ │ ├── templates/ # Template CRUD
│ │ └── schedules/ # Schedule CRUD
│ ├── dashboard/ # Protected dashboard pages
│ │ ├── subscribers/
│ │ ├── templates/
│ │ └── schedules/
│ ├── layout.tsx
│ ├── page.tsx # Landing page
│ └── globals.css
├── components/
│ ├── dashboard/ # Dashboard components
│ ├── subscribers/ # Subscriber components
│ ├── templates/ # Template components
│ ├── schedules/ # Schedule components
│ └── providers/ # Context providers
├── lib/
│ ├── db.ts # MongoDB connection
│ └── email.ts # Email service
├── models/ # Mongoose models
│ ├── User.ts
│ ├── Subscriber.ts
│ ├── Template.ts
│ └── Schedule.ts
├── scripts/
│ └── send-scheduled-emails.js # Cron job script
├── types/
│ └── next-auth.d.ts # Type definitions
├── auth.ts # NextAuth configuration
├── middleware.ts # Route protection
└── package.json
The following variables can be used in email templates:
{{name}}- Subscriber's name{{email}}- Subscriber's email{{service}}- Service name{{nextDate}}- Next scheduled send date
Example template:
Subject: Your {{service}} renewal is coming up
Hi {{name}},
This is a friendly reminder that your {{service}} subscription is due for renewal on {{nextDate}}.
Best regards
To run scheduled emails automatically, set up a cron job:
# Run every hour
0 * * * * cd /path/to/mailuto && npm run cronOr use a service like:
- Vercel Cron Jobs (recommended for Vercel deployments)
- GitHub Actions
- Cron-job.org
- Push your code to GitHub
- Import the project in Vercel
- Add environment variables in Vercel dashboard
- Deploy!
Add to vercel.json:
{
"crons": [{
"path": "/api/cron/send-emails",
"schedule": "0 * * * *"
}]
}- ✅ Google OAuth only (no password management)
- ✅ User data isolation (users can only access their own data)
- ✅ Input validation with Zod
- ✅ Template variable whitelisting
- ✅ Protected API routes
- ✅ Middleware-based route protection
- Email analytics and tracking
- Rich text editor for templates
- Bulk subscriber import (CSV)
- Custom variables
- Team collaboration
- Webhook integrations
MIT
For issues and questions, please open an issue on GitHub.
Built with ❤️ using Next.js and MongoDB
