Export contacts with optout addresses.
[wolnelektury.git] / src / messaging / management / commands / messaging_send.py
index b85957f..2fa8176 100644 (file)
@@ -9,6 +9,6 @@ class Command(BaseCommand):
         parser.add_argument('--dry-run', action='store_true', help='Dry run')
 
     def handle(self, *args, **options):
         parser.add_argument('--dry-run', action='store_true', help='Dry run')
 
     def handle(self, *args, **options):
-        for et in EmailTemplate.objects.filter(is_active=True):
+        for et in EmailTemplate.get_current().order_by('min_days_since'):
             et.run(verbose=True, dry_run=options['dry_run'])
 
             et.run(verbose=True, dry_run=options['dry_run'])