mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-01 05:32:01 +08:00
19 lines
450 B
Python
19 lines
450 B
Python
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
|
|
)
|