fix: link student emails to batch

This commit is contained in:
Jannat Patel
2023-10-23 19:11:36 +05:30
parent affd2b47bd
commit a707095fae
2 changed files with 25 additions and 14 deletions
-11
View File
@@ -381,14 +381,3 @@ def get_timetable_details(timetable):
timetable = sorted(timetable, key=lambda k: k["date"])
return timetable
@frappe.whitelist()
def send_email_to_students(batch, subject, message):
frappe.only_for("Moderator")
students = frappe.get_all("Batch Student", {"parent": batch}, pluck="student")
frappe.sendmail(
recipients=students,
subject=subject,
message=message,
)