Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

1.0 KB
Raw Blame
"""Celery adapter that delivers workflow comment mention notifications by email."""

from collections.abc import Sequence
from typing import override

from services.app.workflow_comment_service import (
    WorkflowCommentMentionNotification,
    WorkflowCommentMentionNotifier,
)
from tasks.mail_workflow_comment_task import send_workflow_comment_mention_email_task


class CeleryWorkflowCommentMentionNotifier(WorkflowCommentMentionNotifier):
    @override
    def notify(self, notifications: Sequence[WorkflowCommentMentionNotification]) -> None:
        for notification in notifications:
            send_workflow_comment_mention_email_task.delay(
                language=notification.language,
                to=notification.to,
                mentioned_name=notification.mentioned_name,
                commenter_name=notification.commenter_name,
                app_name=notification.app_name,
                comment_content=notification.comment_content,
                app_url=notification.app_url,
            )