Skip to content

Commit

Permalink
fix(Project): re-phrase welcome email (#45175)
Browse files Browse the repository at this point in the history
(cherry picked from commit 8d66142)
  • Loading branch information
PatrickDEissler authored and mergify[bot] committed Jan 17, 2025
1 parent c789171 commit c94430a
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions erpnext/projects/doctype/project/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 = """
<p>{0}.</p>
<p><a href="{1}">{2}</a></p>
"""
content = "<p>{}</p>".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

Expand Down

0 comments on commit c94430a

Please sign in to comment.