From d2f88583a70e7dae36885bd89e15b5fc0af35868 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) --- 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 336c1ae535..2ffc6294c5 100644 --- a/erpnext/projects/doctype/project/project.py +++ b/erpnext/projects/doctype/project/project.py @@ -9,7 +9,7 @@ from frappe.desk.reportview import get_match_cond 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 @@ -356,24 +356,19 @@ class Project(Document): 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 -- GitLab