This project automates birthday greetings and reminders using Notion, Slack, and email notifications. It features scheduled tasks to send birthday wishes and reminders to specified contacts.
- Birthday Automation: Automatically sends birthday greetings via email and Slack.
- Reminder Notifications: Sends reminders for upcoming birthdays.
- Integration:
- Notion API for retrieving birthday data.
- Gmail SMTP for sending email notifications.
- Slack API for team notifications.
- Customizable Templates: Use styled HTML emails for greetings.
- Scheduler: Daily execution of tasks at a defined time.
- Languages: Python
- APIs:
- Notion API
- Slack API
- SMTP for email
- Libraries:
smtplibemail.mimerequestsschedulepytz
-
Clone the repository:
git clone https://github.com/DmitriDerevjanko/birthdayscript.git cd birthdayscript -
Create a
.envfile in the root directory and configure the environment variables (see Configuration).
Create a .env file in the root directory with the following variables:
NOTION_API_TOKEN=your_notion_api_token
NOTION_DATABASE_ID=your_notion_database_id
SMTP_SERVER=smtp.zone.eu
SMTP_PORT=587
EMAIL_ADDRESS=email@example.com
EMAIL_PASSWORD=your_email_password
SLACK_TOKEN=your_slack_token
SLACK_CHANNEL=#üldine
REMINDER_EMAILS=email1@example.com,email2@example.comThe application loads sensitive information from the .env file using the os module. Ensure the .env file is correctly set up before running the application.
-
Start the scheduler:
python main.py
-
The scheduler runs tasks daily at 08:00 AM Tallinn time. Adjust the schedule in
scheduler.pyif needed. -
Test email notifications:
python test_email_sender.py
-
Test Slack notifications:
python test_slack_sender.py
birthday-reminder-system/
├── config.py # Environment variable loader
├── email_sender.py # Email notification logic
├── notion.py # Fetches birthday data from Notion
├── scheduler.py # Scheduler for running tasks
├── slack_sender.py # Slack notification logic
├── test_email_sender.py # Email sender testing script
├── test_slack_sender.py # Slack sender testing script
├── .env # Environment variables (not included in version control)
└── README.md # Project documentation