A Python script that sends email notifications to users when they are assigned a new card in Nextcloud Deck.
- Python 3.x
- MySQL Server
- An SMTP server (e.g., Mailtrap for testing)
-
Clone the Repository
git clone https://github.com/yourusername/nextcloud-deck-assignment-notifications.git cd nextcloud-deck-assignment-notifications
-
Setup a Virtual Environment
python3 -m venv venv source venv/bin/activate
-
Install the Required Packages
pip install -r requirements.txt
-
Create a .env File Copy the .env.example file to .env and fill in the required settings.
cp .env.example .env
-
set up a cron job (i used cpanel)
- Go to cron jobs in cpanel
- Add a new cron job
- Set the command to
python /path/to/main.py
(could also bepython3
depending on your system) - Set the frequency to every 5 minutes
alternatively, you could use crontab on your server
crontab -e
then add the following line to the file
*/5 * * * * /path/to/python /path/to/main.py
-
Run the setup script
python setup.py
-
Run the script
python main.py
assign a card to a user in nextcloud deck and wait for the email notification
Here's what the email looks like
Feel free to modify any element of this. I realize that not everyone uses mysql for instance(though, i believe it's fully compatible with mariadb?) In a future version i might make a 'email_template' file that can be modified to change the email template instead of hardcoding it in the script. if you'd like to do that, please do. I hope it's helpful to you!
none! do whatever you want with it. I'd appreciate a mention if you use it in a project though.