Skip to content

Commit

Permalink
fix: check for recipients only while sending mail
Browse files Browse the repository at this point in the history
  • Loading branch information
krantheman committed Nov 22, 2024
1 parent af217d0 commit eaf8946
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
"fieldtype": "Table",
"label": "Recipients",
"options": "Mail Recipient",
"reqd": 1,
"search_index": 1
},
{
Expand Down Expand Up @@ -473,7 +472,7 @@
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2024-11-20 10:47:08.592108",
"modified": "2024-11-22 14:34:10.362892",
"modified_by": "Administrator",
"module": "Mail Client",
"name": "Outgoing Mail",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ def validate(self) -> None:
self.validate_max_message_size()

def on_submit(self) -> None:
if not self.recipients:
frappe.throw(
_("Please add at least one recipient before sending the mail."), frappe.MandatoryError
)

self.create_mail_contacts()

status = "Pending"
Expand Down

0 comments on commit eaf8946

Please sign in to comment.