This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from usuarios.models import * | |
| from django.conf import settings | |
| from django.core.mail import EmailMessage | |
| estado = 'BA' | |
| destinatarios = ['[email protected]', '[email protected]'] | |
| emails = User.objects.filter(userprofile__localidade__estado__sigla=estado, userprofile__ativo_para_o_site=True).values_list('email', flat=True) | |
| message = EmailMessage('Emails do estado %s' % estado, 'em anexo', settings.EMAIL_HOST_USER, destinatarios) |
NewerOlder