mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-23 15:38:55 +01:00
Render scheduled task response as html to improve readability in email
This commit is contained in:
parent
c17dbbeb92
commit
3ce06a938c
2 changed files with 4 additions and 1 deletions
|
@ -76,6 +76,7 @@ dependencies = [
|
|||
"django-phonenumber-field == 7.3.0",
|
||||
"phonenumbers == 8.13.27",
|
||||
"markdownify ~= 0.11.6",
|
||||
"markdown-it-py ~= 3.0.0",
|
||||
"websockets == 12.0",
|
||||
"psutil >= 5.8.0",
|
||||
"huggingface-hub >= 0.22.2",
|
||||
|
|
|
@ -6,6 +6,7 @@ try:
|
|||
except ImportError:
|
||||
pass
|
||||
|
||||
import markdown_it
|
||||
from django.conf import settings
|
||||
from jinja2 import Environment, FileSystemLoader
|
||||
|
||||
|
@ -56,7 +57,8 @@ def send_task_email(name, email, query, result):
|
|||
|
||||
template = env.get_template("task.html")
|
||||
|
||||
html_content = template.render(name=name, query=query, result=result)
|
||||
html_result = markdown_it.MarkdownIt().render(result)
|
||||
html_content = template.render(name=name, query=query, result=html_result)
|
||||
|
||||
resend.Emails.send(
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue