mirror of
https://github.com/langgenius/dify.git
synced 2025-07-14 20:49:56 +00: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
|
||
|
)
|