๐ Daily Tech News Email Workflow
> **Automated GitHub Actions workflow that delivers the latest technology news directly to your inbox every day.**
๐ Daily Tech News Email Workflow
Automated GitHub Actions workflow that delivers the latest technology news directly to your inbox every day.
๐ Overview
Daily Tech News Email Workflow is a fully automated solution that keeps you updated with the latest technology news without lifting a finger. Using GitHub Actions, this workflow runs daily, fetches top technology headlines from NewsAPI.org, and delivers them to your email as a beautifully formatted HTML newsletter.
Perfect for developers, tech enthusiasts, and anyone who wants to stay informed about the latest tech trends without manually checking news sites.
โจ Features
- ๐ฐ Automated Daily Updates - Runs automatically every day at 8:00 AM UTC (1:30 PM IST)
- ๐ง Beautiful HTML Emails - Professional, responsive email design with modern styling
- ๐จ Rich Formatting - Includes article titles, descriptions, sources, and publication dates
- ๐ Clickable Links - Direct links to full articles for easy reading
- ๐ Secure - Uses GitHub Secrets for credential management
- ๐ Free - Uses free tier APIs (NewsAPI.org)
- โก Fast - Delivers news within seconds of scheduled run
- ๐ ๏ธ Customizable - Easy to modify schedule, news categories, and email design
- ๐ฑ Multi-Provider Support - Works with Gmail, Outlook, Yahoo, and other SMTP providers
- ๐ฏ Manual Trigger - Run on-demand anytime via GitHub Actions
๐ฏ How It Works
graph LR
A[GitHub Actions<br/>Scheduled Trigger] --> B[Fetch News<br/>from NewsAPI]
B --> C[Format HTML<br/>Email Template]
C --> D[Send via<br/>SMTP]
D --> E[๐ง Email Inbox]
style A fill:#2563eb
style E fill:#16a34a
- GitHub Actions triggers the workflow daily at a scheduled time
- Python script fetches the latest technology headlines from NewsAPI.org
- HTML template formats the news into a beautiful email newsletter
- SMTP client sends the email to your configured recipient address
- You receive the latest tech news in your inbox!
๐ Quick Start
Prerequisites
- GitHub account
- Email account (Gmail, Outlook, or Yahoo)
- NewsAPI.org account (free tier)
Installation
-
Fork or clone this repository
git clone https://github.com/Tharinda-Pamindu/news_updater.git cd news_updater -
Get your NewsAPI key
- Sign up at newsapi.org/register
- Copy your API key
-
Set up GitHub Secrets
Go to your repository โ Settings โ Secrets and variables โ Actions โ New repository secret
Add these 4 secrets:
Secret Name Description Example NEWS_API_KEYYour NewsAPI.org API key abc123def456...EMAIL_USERNAMEYour SMTP email address you@gmail.comEMAIL_PASSWORDEmail app password abcd efgh ijkl mnopRECIPIENT_EMAILWhere to receive news you@gmail.com -
Enable GitHub Actions
- Go to Actions tab in your repository
- Enable workflows if prompted
-
Test the workflow
- Go to Actions โ Daily Tech News Email
- Click "Run workflow" โ "Run workflow"
- Check your email inbox!
๐ง Email Preview
The newsletter includes:
- ๐ฐ Top 10 Technology Headlines - Latest and most relevant tech news
- ๐ Direct Article Links - Click to read full articles
- ๐ Publication Dates - Know when news was published
- ๐ข Source Attribution - See which publication reported the news
- ๐จ Modern Design - Clean, professional layout with brand colors
โ๏ธ Configuration
Change Schedule
Edit .github/workflows/daily-tech-news.yml line 6:
schedule:
- cron: '0 8 * * *' # 8:00 AM UTC daily
Popular schedules:
'0 0 * * *'- Midnight UTC (5:30 AM IST)'0 12 * * *'- Noon UTC (5:30 PM IST)'0 8 * * 1-5'- 8 AM UTC, weekdays only'0 0 * * 1'- Monday mornings only
Use crontab.guru to create custom schedules.
Change News Category
Edit fetch_news.py line 24:
params = {
"category": "technology", # Options: business, science, health, entertainment, sports
"language": "en",
"pageSize": 10,
"apiKey": api_key
}
Change Number of Articles
Modify pageSize (max 100 for free tier):
"pageSize": 15, # Get 15 articles instead of 10
๐ง Local Testing
Test the workflow locally before deploying:
-
Create
.envfilecp .env.example .env -
Add your credentials to
.envNEWS_API_KEY=your_newsapi_key EMAIL_USERNAME=your_email@gmail.com EMAIL_PASSWORD=your_app_password RECIPIENT_EMAIL=your_email@gmail.com -
Install dependencies
pip install -r requirements.txt -
Run the script
python fetch_news.py -
Check your email!
๐ Gmail App Password Setup
If using Gmail, you must use an App Password:
- Enable 2-Factor Authentication on your Google account
- Go to myaccount.google.com/apppasswords
- Select Mail and Other (Custom name)
- Enter "GitHub Actions" as the name
- Click Generate
- Copy the 16-character password (remove spaces)
- Use this as your
EMAIL_PASSWORDsecret
๐ Project Structure
news_updater/
โโโ .github/
โ โโโ workflows/
โ โโโ daily-tech-news.yml # GitHub Actions workflow
โโโ fetch_news.py # Main Python script
โโโ requirements.txt # Python dependencies
โโโ .env.example # Environment variables template
โโโ .gitignore # Git ignore rules
โโโ README.md # This file
๐ ๏ธ Technologies Used
- GitHub Actions - Workflow automation and scheduling
- Python 3.11+ - Script execution
- NewsAPI.org - News aggregation API
- SMTP - Email delivery protocol
- HTML/CSS - Email template design
๐ API Usage
NewsAPI.org Free Tier:
- โ 100 requests per day
- โ Top headlines access
- โ Multiple categories
- โ 30 days of historical data
Email Sending:
- โ Unlimited emails via SMTP
- โ No API limits
- โ Works with any SMTP provider
๐ Troubleshooting
Workflow Not Running
- โ Check GitHub Actions is enabled in repository settings
- โ Verify workflow file is in
.github/workflows/directory - โ Check Actions tab for error messages
Email Not Received
- โ Verify all 4 GitHub secrets are set correctly
- โ Check spam/junk folder
- โ For Gmail: Ensure you're using App Password, not regular password
- โ Review workflow logs for SMTP errors
API Errors
- โ Verify NewsAPI key is valid at newsapi.org/account
- โ Check you haven't exceeded 100 requests/day limit
- โ Ensure
NEWS_API_KEYsecret is set correctly
SMTP Authentication Failed
- โ Gmail: Must use App Password with 2FA enabled
- โ Outlook: Check "Less secure app access" settings
- โ Yahoo: Use app-specific password
- โ Verify
EMAIL_USERNAMEandEMAIL_PASSWORDare correct
๐จ Customization Ideas
- Multiple Recipients - Modify script to send to multiple emails
- Different Time Zones - Adjust cron schedule for your timezone
- Custom Categories - Mix business, science, and tech news
- Weekly Digest - Change schedule to run once per week
- Custom Styling - Modify HTML template colors and layout
- Add Images - Include article images in email (requires API upgrade)
๐ค Contributing
Contributions are welcome! Here's how you can help:
- 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
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- NewsAPI.org - For providing free news aggregation API
- GitHub Actions - For free workflow automation
- Python - For the amazing programming language
๐ Support
If you encounter any issues or have questions:
- Check the Troubleshooting section
- Review GitHub Actions logs
- Open an issue
๐ Show Your Support
If you find this project useful, please consider:
- โญ Starring the repository
- ๐ด Forking for your own use
- ๐ข Sharing with others
- ๐ Reporting bugs
- ๐ก Suggesting new features
<div align="center">
Made with โค๏ธ by Tharinda Pamindu
Stay informed. Stay ahead.
</div>โจ Features
- ๐ฐ Fetches top 10 technology headlines from NewsAPI.org
- ๐ง Sends formatted HTML email newsletter
- โฐ Runs automatically every day at 8:00 AM UTC
- ๐จ Beautiful, responsive email design
- ๐ง Easy to customize and configure
- ๐ Uses free tier APIs
๐ ๏ธ Setup Instructions
1. Get a NewsAPI Key
- Visit NewsAPI.org
- Sign up for a free account
- Copy your API key (free tier includes 100 requests/day)
2. Configure GitHub Secrets
Add the following secrets to your GitHub repository:
- Go to your repository on GitHub
- Click Settings โ Secrets and variables โ Actions
- Click New repository secret and add each of the following:
| Secret Name | Description | Example |
|---|---|---|
NEWS_API_KEY | Your NewsAPI.org API key | abc123def456... |
EMAIL_USERNAME | Your SMTP email address | yourname@gmail.com |
EMAIL_PASSWORD | Your email app password | abcd efgh ijkl mnop |
RECIPIENT_EMAIL | Email where you want to receive news | yourname@gmail.com |
3. Email Provider Setup
For Gmail Users (Recommended)
[!IMPORTANT] Gmail requires an App Password instead of your regular password.
- Enable 2-Factor Authentication on your Google account
- Go to Google App Passwords
- Select Mail and Other (Custom name)
- Enter "GitHub Actions" as the name
- Click Generate
- Copy the 16-character password (remove spaces)
- Use this as your
EMAIL_PASSWORDsecret
For Outlook/Hotmail Users
- Use your regular Outlook email and password
- Make sure "Less secure app access" is enabled if required
For Yahoo Users
- Generate an app password from Yahoo Account Security
- Use the app password as your
EMAIL_PASSWORD
4. Customize Schedule (Optional)
The workflow runs daily at 8:00 AM UTC by default. To change this:
- Open
.github/workflows/daily-tech-news.yml - Modify the cron expression:
schedule:
- cron: '0 8 * * *' # Format: minute hour day month day-of-week
Examples:
'0 12 * * *'- Noon UTC (12:00 PM)'30 6 * * *'- 6:30 AM UTC'0 0 * * 1'- Midnight UTC every Monday
[!TIP] Use crontab.guru to help create cron expressions.
5. Test the Workflow
Manual Trigger
- Go to your repository on GitHub
- Click Actions tab
- Select Daily Tech News Email workflow
- Click Run workflow โ Run workflow
- Wait for the workflow to complete
- Check your email inbox
View Logs
- Click on the workflow run
- Click on the send-tech-news job
- Expand each step to see detailed logs
๐งช Local Testing
To test the script locally before deploying:
- Clone the repository:
git clone <your-repo-url>
cd news_updates
- Create a
.envfile from the example:
cp .env.example .env
- Edit
.envand add your credentials:
NEWS_API_KEY=your_actual_api_key
EMAIL_USERNAME=your_email@gmail.com
EMAIL_PASSWORD=your_app_password
RECIPIENT_EMAIL=your_email@gmail.com
- Install dependencies:
pip install -r requirements.txt
- Run the script:
python fetch_news.py
๐ง Email Preview
The email newsletter includes:
- ๐ฐ Top 10 technology headlines
- ๐ Clickable article links
- ๐ Publication dates and times
- ๐ข News source attribution
- ๐จ Clean, modern design
๐ง Troubleshooting
Workflow Not Running
- Check that the workflow file is in
.github/workflows/directory - Verify GitHub Actions is enabled in repository settings
- Check the Actions tab for any error messages
Email Not Received
- Verify all GitHub secrets are set correctly
- Check spam/junk folder
- Review workflow logs for error messages
- For Gmail: Ensure you're using an App Password, not your regular password
- Test with manual workflow trigger first
API Errors
- Verify your NewsAPI key is valid
- Check you haven't exceeded the free tier limit (100 requests/day)
- Ensure the API key is correctly set in GitHub secrets
SMTP Authentication Failed
- Gmail: Must use App Password with 2FA enabled
- Outlook: Check if "Less secure app access" needs to be enabled
- Yahoo: Use app-specific password
- Verify
EMAIL_USERNAMEandEMAIL_PASSWORDare correct
๐จ Customization
Change News Category
Edit fetch_news.py and modify the API parameters:
params = {
"category": "technology", # Change to: business, science, health, etc.
"language": "en",
"pageSize": 10,
"apiKey": api_key
}
Change Number of Articles
Modify pageSize in the API parameters (max: 100 for free tier):
"pageSize": 15, # Get 15 articles instead of 10
Customize Email Design
Edit the HTML template in the create_html_email() function in fetch_news.py.
๐ License
This project is open source and available under the MIT License.
๐ค Contributing
Contributions, issues, and feature requests are welcome!
๐ฌ Support
If you encounter any issues, please check the troubleshooting section or open an issue on GitHub.
Powered by:
- NewsAPI.org - News aggregation
- GitHub Actions - Automation
- Python 3.11+ - Script execution
Related Documents
YoForex Platform - Technical Documentation
> **Last Updated:** November 2, 2025
Full-Stack Upgrade & File Storage Integration
- [x] Run webdev_add_feature to upgrade to web-db-user
Project Research Summary
**Project:** lucassenechal-website (AI-powered personalized newsletter + consulting platform)
CareLink AI Bootstrap Launch Plan
**Document Version:** 1.0