mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-05 21:29:11 +00:00
Render scheduled task response as html to improve readability in email
This commit is contained in:
@@ -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(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user