List of email addresses probably overkill, but a count of subscribers to each list would allow basic tracking of engagement and growth
I worked on this a bit today, and I can work on submitting a patch as long as ~sircmpwn wants to include this feature. I need some help with the last bit though. What I've done would:
- Add a new integer column in the list table called
subscriber_count
- Add the new "subscriber_count" field to the mailing list API response
- Add "__ subscribers." to the sidebar beneath the etiquette notice and buttons.
- Update the subscriber count each time the _subscribe() or _unsubscribe() functions are run with something like:
dest.subscriber_count = dest.subscribers.count()
or
dest.subscriber_count = select([func.count()]).select_from(dest.subscribers)
or
dest.subscriber_count = List.query.filter(List.id == dest.id).one_or_none().subscribers.count()
I'm not experienced with SQLAlchemy, so I will probably need some advice on how to get that line to work. What's the best way to run something like func.count() on dest.subscribers within process.py?
dest
is defined withdest = List.query.filter(List.id == list_id).one_or_none()
. And _forward() uses it likefor sub in dest.subscribers:
.
A subscriber count is not desirable. Tracking "engagement and growth" is not desirable. Sorry I missed this before, but I'm not interested in a patch.