So I'm familiar with sending emails using django, but I'd want to send an email to all those that subscribed to my newsletter if I were to use the admin panel instead of the one I have on the site itself. How would I go about doing this? For my current view on the user site version, it is something like:
def form_valid(self, form):
message = 'A new article has been released...'
subject = 'New Article!'
to = Email.objects.values_list('email', flat=True).distinct()
from_email = settings.EMAIL_HOST_USER
send_mail(subject, message, from_email, to, fail_silently=True)
return super().form_valid(form)