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.
14 lines
553 B
14 lines
553 B
"""Command for sending the newsletter"""
|
|
from datetime import date, timedelta
|
|
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) |