Skip to content
Mail the inactive users of your Mastodon server
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE.txt
README.md
db-setup.py
mailing.py
requirements.txt
setup.py

README.md

mailing

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.

Dependencies

  • Python 3
  • Postgresql server
  • Mastodon server (admin)
  • Everything else at the top of mailing.py!

Usage:

Within Python Virtual Environment:

  1. Run 'db-setup.py' to set database parameters and create needed database and table. All collected data of inactive users (see point 3) will be written there.

  2. Run 'setup.py' to set your SMTP parameters and desired email subject. They will be saved to 'secrets/secrets.txt' for further use.

  3. Run 'mailing.py' to start emailing your inactive users ('last_sign_in_at' 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.

  4. 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.

Note: install all needed packages with 'pip install -r requirements.txt'

You can’t perform that action at this time.