Welcome to the Email to WhatsApp Forwarder! This application is your personal assistant, automatically monitoring your Gmail account for important emails from specific people and instantly forwarding them to you on WhatsApp. It's perfect for staying on top of urgent messages, whether it's from your boss, your clients, or your mom!
- ✨・What is This?
- 🛠️・Getting Started
- ⚙️・Configuration
- 🗺️・How to Use
- 💖・Contributing
- 📜・License
- 👋・About Me!
The Email to WhatsApp Forwarder is a powerful Node.js application that connects to your Gmail account, watches for new emails from senders you specify, and forwards them directly to your WhatsApp number using the Green API. It handles text, HTML, and even attachments, so you never miss a beat!
Ready to get instant email notifications on WhatsApp? Here’s how to set it up:
-
Clone the magic! ✨
git clone https://github.com/afluz/EmailToWhatsappForwarder.git cd EmailToWhatsappForwarder -
Install the dependencies! 📦
npm install
-
Set up your environment! 🔑
Copy the example environment file:
cp .env.example .env.local
Now, open the
.env.localfile and fill in your details. See the Configuration section for more info.
To get the forwarder working, you need to provide some key pieces of information in the .env.local file.
GMAIL_USER: Your full Gmail address (e.g.,[email protected]).GMAIL_APP_PASSWORD: A 16-character App Password for your Gmail account. Do not use your regular password.- How to get an App Password:
- Go to your Google Account.
- Navigate to Security > 2-Step Verification (you must have this enabled).
- At the bottom, click on App passwords.
- Select "Mail" for the app and "Other (Custom name)" for the device, give it a name (e.g., "WhatsApp Forwarder"), and click Generate.
- Copy the 16-character password and paste it into your
.env.localfile.
- How to get an App Password:
GREEN_API_ID_INSTANCE: Your instance ID from Green API.GREEN_API_TOKEN: Your API token from Green API.- How to get Green API credentials:
- Sign up or log in at Green API.
- Create a new instance and connect your WhatsApp number by scanning the QR code.
- You'll find the
idInstanceandapiTokenInstanceon your instance dashboard.
- How to get Green API credentials:
SENDER_EMAIL_FILTER: The email address(es) you want to forward from. For multiple emails, separate them with a comma (e.g.,[email protected],[email protected]).WHATSAPP_TARGET_NUMBER: The WhatsApp number where you want to receive the forwarded emails (e.g.,6281234567890).
Once everything is configured, starting the forwarder is simple:
npm startOr, for development with automatic restarting when you make changes:
npm run devThe application will start, test its connections, and begin monitoring your inbox. When a new email arrives from one of your specified senders, it will be beautifully formatted and sent to your WhatsApp!
Have an idea to make this even better? Found a bug? We'd love your help! Check out our CONTRIBUTING.md file for guidelines on how to contribute.
This project is open-source and distributed under the MIT License. Feel free to use, modify, and share it! See the LICENSE file for more details.
Muhammad Zulfa Fauzan Nurhuda
A passionate developer who loves building cool and useful things. Let's connect!
