-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a way to derive email addresses associated with active collections #1096
Comments
I think something like the following would work. (I tested below in the management console on my dev environment.)
Would there be other metadata about the collections we would like to include, in addition to the collection names? |
Collection URLs would be useful, as we can include them in the emails. I
can't recall if this is in the data model, or if it would need to be
constructed from the collection number.
…On Tue, Nov 30, 2021 at 12:39 PM Dolsy Smith ***@***.***> wrote:
I think something like the following would work. (I tested below in the
management console on my dev environment.)
from ui.models import User, Collection
users = User.objects.all()
users_to_notify = []
for user in users:
if not user.email:
continue
for collection in Collection.objects.filter(collection_set__group__in=user.groups.all(), is_active=True)]:
row = {'email': user.email, 'collection': collection.name}
users_to_notify.append(row)
# Then export users_to_notify as a CSV
Would there be other metadata about the collections we would like to
include, in addition to the collection names?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1096 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA2KSJYCXO73LDLM2COCO63UOUD4FANCNFSM5JCEZMFA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
--
*Dan Kerchner*
*Senior Software Developer, Scholarly Technology GroupThe George Washington
University LibrariesGelman Library2130 H Street, NWWashington, DC
***@***.*** ***@***.***>*
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Via management command (or admin view?)
This would be useful so that we can notify all users with active collections that we will be purging collections.
The text was updated successfully, but these errors were encountered: