|ee98759278||3 years ago|
|LICENSE.txt||3 years ago|
|README.md||3 years ago|
|db-setup.py||3 years ago|
|delete_inactives.py||3 years ago|
|edit_status.py||3 years ago|
|mailing.py||3 years ago|
|requirements.txt||3 years ago|
|setup.py||3 years ago|
Mail your Mastodon server inactive users and track their feedback.
This code written in Python get all more than a year inactive users from Mastodon's database and email them with the subject and message of your choice. Then, inactive users data is stored into new created Postgresql database to track feedback and status. Run mailing.py periodically to catch 'new' inactive users and update the elapsed days of the already emailed ones.
- Python 3
- Postgresql server
- Mastodon server (admin)
- Everything else at the top of
Within Python Virtual Environment:
python db-setup.pyto set database parameters and create needed database and table. All collected data of inactive users (see point 3) will be written there.
python setup.pyto set your SMTP parameters and desired email subject. Also set your Mastodon's full path. They will be saved to
secrets/secrets.txtfor further use.
python mailing.pyto start emailing your inactive users (
last_sign_in_atcolumn older than a year). Their username, account_id, email, delivery status (True if successful) and delivery date will be written to Postgresql database. There is another column,
deleted, False by default. Will be useful to track deleted/not deleted inactive users if you choose to do so.
Use your favourite scheduling method to set mailing.py to run regularly. Column 'elapsed_days' of mailing's database will be updated so you can decide actions after some time.
python delete_inactives.pyto delete all inactive users after 30 days period from the warning email.
python edit_status.pyto set True or False any of following
Note: install all needed packages with
pip install -r requirements.txt