Skip to content

Commit

Permalink
fix: Use Contact Name instead of Supplier in RFQ Email
Browse files Browse the repository at this point in the history
(cherry picked from commit 88ac519)
  • Loading branch information
marination authored and mergify[bot] committed Jul 11, 2022
1 parent 6d04baf commit b0e17de
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,19 @@ def supplier_rfq_mail(self, data, update_password_link, rfq_link, preview=False)
doc_args = self.as_dict()
doc_args.update({"supplier": data.get("supplier"), "supplier_name": data.get("supplier_name")})

# Get Contact Full Name
if data.get("contact"):
contact_name = frappe.db.get_value(
"Contact", data.get("contact"), ["first_name", "middle_name", "last_name"]
)
supplier_name = (" ").join(x for x in contact_name if x) # remove any blank values

args = {
"update_password_link": update_password_link,
"message": frappe.render_template(self.message_for_supplier, doc_args),
"rfq_link": rfq_link,
"user_fullname": full_name,
"supplier_name": data.get("supplier_name"),
"supplier_name": supplier_name or data.get("supplier_name"),
"supplier_salutation": self.salutation or "Dear Mx.",
}

Expand Down

0 comments on commit b0e17de

Please sign in to comment.