You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

17 lines
557 B

"""Command for sending the newsletter"""
from datetime import date
from django.core.management.base import NoArgsCommand
from emencia.django.newsletter.models import MailingList
class Command(NoArgsCommand):
"""
This command run every day.
Check date and creates newsletter the day before announces need to send
"""
help = 'create the announce every week.'
def handle(self, *args, **options):
announce_list = MailingList.objects.get(id=1)
day = date.today()
announce_list.generate_announce_newsletter(day)