2021-08-20 00:45:33 +02:00
|
|
|
from background_task import background
|
|
|
|
|
|
|
|
from .models import Election
|
|
|
|
from .utils import send_mail
|
|
|
|
|
|
|
|
|
2021-08-20 16:47:30 +02:00
|
|
|
@background
|
2024-07-10 13:51:24 +02:00
|
|
|
def send_election_mail(election_pk: int, subject: str, body: str, reply_to: str):
|
2021-08-20 00:45:33 +02:00
|
|
|
election = Election.objects.get(pk=election_pk)
|
|
|
|
send_mail(election, subject, body, reply_to)
|
|
|
|
election.sent_mail = True
|
|
|
|
election.save(update_fields=["sent_mail"])
|