From 697e81df10cd20368fe4244aeb3dbc8c943f7976 Mon Sep 17 00:00:00 2001 From: Hussain Nagaria Date: Tue, 17 Oct 2023 22:01:04 +0530 Subject: [PATCH] feat: add reply_to in email students --- lms/lms/doctype/lms_batch/lms_batch.py | 5 +++-- lms/www/batches/batch.js | 7 +++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lms/lms/doctype/lms_batch/lms_batch.py b/lms/lms/doctype/lms_batch/lms_batch.py index 68ac25a7..33942505 100644 --- a/lms/lms/doctype/lms_batch/lms_batch.py +++ b/lms/lms/doctype/lms_batch/lms_batch.py @@ -384,11 +384,12 @@ def get_timetable_details(timetable): @frappe.whitelist() -def send_email_to_students(batch, subject, message): +def send_email_to_students(batch, subject, reply_to, message): frappe.only_for("Moderator") students = frappe.get_all("Batch Student", {"parent": batch}, pluck="student") frappe.sendmail( recipients=students, subject=subject, - message=message, + reply_to=reply_to, + message=message ) diff --git a/lms/www/batches/batch.js b/lms/www/batches/batch.js index 9614a924..7eb1e7fb 100644 --- a/lms/www/batches/batch.js +++ b/lms/www/batches/batch.js @@ -784,6 +784,12 @@ const email_to_students = () => { label: __("Subject"), reqd: 1, }, + { + fieldtype: "Data", + fieldname: "reply_to", + label: __("Reply To"), + reqd: 0, + }, { fieldtype: "Text Editor", fieldname: "message", @@ -806,6 +812,7 @@ const send_email = (values) => { args: { batch: $(".class-details").data("batch"), subject: values.subject, + reply_to: values.reply_to, message: values.message, }, callback: (r) => {