Skip to content
Snippets Groups Projects
Commit cab40bd2 authored by Jonas Braathen's avatar Jonas Braathen
Browse files

Log role end notifications emails being sent

parent f8418572
No related branches found
No related tags found
1 merge request!404Role end notifier insight
import logging
from django.template.context import Context from django.template.context import Context
from django_q.tasks import async_task from django_q.tasks import async_task
from gregui.mailutils.protocol import prepare_arguments from gregui.mailutils.protocol import prepare_arguments
from gregui.models import EmailTemplate from gregui.models import EmailTemplate
logger = logging.getLogger(__name__)
class RolesEnding: class RolesEnding:
def __init__(self): def __init__(self):
pass pass
def queue_mail(self, mail_to: str, num_roles: int) -> str: def queue_mail(self, mail_to: str, num_roles: int) -> str:
logger.info(
"Queuing a role end notification email to %s about %d roles",
mail_to,
num_roles,
)
arguments = prepare_arguments( arguments = prepare_arguments(
template=EmailTemplate.objects.get( template=EmailTemplate.objects.get(
template_key=EmailTemplate.EmailType.ROLE_END_REMINDER template_key=EmailTemplate.EmailType.ROLE_END_REMINDER
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment