mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-04 05:20:40 +08:00
27 lines
520 B
Python
27 lines
520 B
Python
|
|
from typing import Dict, List
|
|
|
|
from pydantic import BaseModel
|
|
|
|
from tasks.mail_enterprise_task import send_enterprise_email_task
|
|
|
|
|
|
class DifyMail(BaseModel):
|
|
to: List[str]
|
|
subject: str
|
|
body: str
|
|
substitutions: Dict[str, str] = {}
|
|
|
|
|
|
class EnterpriseMailService:
|
|
|
|
@classmethod
|
|
def send_mail(cls, mail: DifyMail):
|
|
|
|
send_enterprise_email_task.delay(
|
|
to=mail.to,
|
|
subject=mail.subject,
|
|
body=mail.body,
|
|
substitutions=mail.substitutions
|
|
)
|