Using Django Admin Actions to send bulk emails
问题 I'm looking for a way to send bulk emails to users from a Django Admin Action. This is what I have thus far: class MyUserAdmin(UserAdmin): list_display = ['username', 'email', 'first_name', 'last_name', 'is_active', staff] list_filter = ['groups', 'is_staff', 'is_superuser', 'is_active'] actions = ['send_EMAIL'] def send_EMAIL(self, request, queryset): from django.core.mail import send_mail for i in queryset: if i.email: send_mail('Subject here', 'Here is the message.', 'from@example.com',[i