From c94430a4722e99b9ab4530872408b5261eda36e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Ei=C3=9Fler?= <77415730+PatrickDEissler@users.noreply.github.com> Date: Fri, 17 Jan 2025 12:17:32 +0100 Subject: [PATCH] fix(Project): re-phrase welcome email (#45175) (cherry picked from commit 8d661428651fa1ce47f5f3b217cfadad47e060a6) --- erpnext/projects/doctype/project/project.py | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/erpnext/projects/doctype/project/project.py b/erpnext/projects/doctype/project/project.py index f1512501e76f..ffef99379fd7 100644 --- a/erpnext/projects/doctype/project/project.py +++ b/erpnext/projects/doctype/project/project.py @@ -9,7 +9,7 @@ from frappe.model.document import Document from frappe.query_builder import Interval from frappe.query_builder.functions import Count, CurDate, Date, Sum, UnixTimestamp -from frappe.utils import add_days, flt, get_datetime, get_time, get_url, nowtime, today +from frappe.utils import add_days, flt, get_datetime, get_link_to_form, get_time, get_url, nowtime, today from frappe.utils.user import is_website_user from erpnext import get_default_company @@ -341,24 +341,19 @@ def after_rename(self, old_name, new_name, merge=False): frappe.db.set_value("Project", new_name, "copied_from", new_name) def send_welcome_email(self): - url = get_url(f"/project/?name={self.name}") - messages = ( - _("You have been invited to collaborate on the project: {0}").format(self.name), - url, - _("Join"), - ) + label = f"{self.project_name} ({self.name})" + url = get_link_to_form(self.doctype, self.name, label) - content = """ -

{0}.

-

{2}

- """ + content = "

{}

".format( + _("You have been invited to collaborate on the project {0}.").format(url) + ) for user in self.users: if user.welcome_email_sent == 0: frappe.sendmail( user.user, subject=_("Project Collaboration Invitation"), - content=content.format(*messages), + content=content, ) user.welcome_email_sent = 1