mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-09 13:25: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",
|
"django-phonenumber-field == 7.3.0",
|
||||||
"phonenumbers == 8.13.27",
|
"phonenumbers == 8.13.27",
|
||||||
"markdownify ~= 0.11.6",
|
"markdownify ~= 0.11.6",
|
||||||
|
"markdown-it-py ~= 3.0.0",
|
||||||
"websockets == 12.0",
|
"websockets == 12.0",
|
||||||
"psutil >= 5.8.0",
|
"psutil >= 5.8.0",
|
||||||
"huggingface-hub >= 0.22.2",
|
"huggingface-hub >= 0.22.2",
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ try:
|
|||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
import markdown_it
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from jinja2 import Environment, FileSystemLoader
|
from jinja2 import Environment, FileSystemLoader
|
||||||
|
|
||||||
@@ -56,7 +57,8 @@ def send_task_email(name, email, query, result):
|
|||||||
|
|
||||||
template = env.get_template("task.html")
|
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(
|
resend.Emails.send(
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user