forked from erp-dev/erp
feat: added 'follow_url into pre sales order created message'
This commit is contained in:
@@ -24,6 +24,21 @@ def render_pre_sales_order_created_markdown(
|
||||
kind: str,
|
||||
items_count: int,
|
||||
) -> str:
|
||||
followup_url_template = getattr(
|
||||
settings,
|
||||
"PRE_SALES_ORDER_CREATED_FOLLOWUP_URL_TEMPLATE",
|
||||
"",
|
||||
)
|
||||
followup_url = ""
|
||||
if followup_url_template:
|
||||
try:
|
||||
followup_url = str(followup_url_template).format(
|
||||
pre_sales_order_id=str(pre_sales_order_id or "")
|
||||
)
|
||||
except Exception:
|
||||
followup_url = ""
|
||||
followup_line = f"- **跟进**:[点击跟进]({followup_url})\n" if followup_url else ""
|
||||
|
||||
template = getattr(
|
||||
settings,
|
||||
"PRE_SALES_ORDER_CREATED_WECOM_MARKDOWN_TEMPLATE",
|
||||
@@ -38,6 +53,7 @@ def render_pre_sales_order_created_markdown(
|
||||
"- **仓库**:{warehouse_name}\n"
|
||||
"- **类型**:{kind}\n"
|
||||
"- **明细条数**:`{items_count}`\n"
|
||||
"{followup_line}"
|
||||
),
|
||||
)
|
||||
|
||||
@@ -54,6 +70,7 @@ def render_pre_sales_order_created_markdown(
|
||||
warehouse_name=str(warehouse_name or "-"),
|
||||
kind=str(kind or "-"),
|
||||
items_count=int(items_count) if items_count is not None else 0,
|
||||
followup_line=str(followup_line),
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user