snapshot: modularize workflow helper and task orchestration layers
This commit is contained in:
29
backend/workflows/notification_dispatch.py
Normal file
29
backend/workflows/notification_dispatch.py
Normal file
@@ -0,0 +1,29 @@
|
||||
from django.utils.translation import gettext as _
|
||||
|
||||
from .notifications import notify_user_by_email
|
||||
|
||||
|
||||
def notify_request_result(*, recipient_email: str, title: str, body: str, level: str, event_key: str) -> None:
|
||||
notify_user_by_email(
|
||||
email=recipient_email,
|
||||
title=title,
|
||||
body=body,
|
||||
level=level,
|
||||
link_url='/requests/',
|
||||
event_key=event_key,
|
||||
)
|
||||
|
||||
|
||||
def notify_welcome_email_result(*, recipient_email: str, full_name: str, body: str, level: str, event_key: str) -> None:
|
||||
notify_user_by_email(
|
||||
email=recipient_email,
|
||||
title=(
|
||||
_('Welcome E-Mail gesendet: %(name)s') % {'name': full_name}
|
||||
if event_key == 'welcome_email_success'
|
||||
else _('Welcome E-Mail fehlgeschlagen: %(name)s') % {'name': full_name}
|
||||
),
|
||||
body=body,
|
||||
level=level,
|
||||
link_url='/admin-tools/welcome-emails/',
|
||||
event_key=event_key,
|
||||
)
|
||||
Reference in New Issue
Block a user