Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ frappe.ui.form.on("Zoom Webinar", {
frm.call({
method: "sync_attendance_in_background",
doc: frm.doc,
freeze: true,
freeze_message: __("Starting attendance sync..."),
}).then(() => {
frappe.show_alert({
message: __("Attendance sync has been started in the background..."),
Expand All @@ -18,8 +20,10 @@ frappe.ui.form.on("Zoom Webinar", {
});
frm.add_custom_button(__("Sync Registrations"), () => {
frm.call({
method: "sync_registration_in_background",
method: "sync_registrations_in_background",
doc: frm.doc,
freeze: true,
freeze_message: __("Starting registrations sync..."),
}).then(() => {
frappe.show_alert({
message: __("Registration sync has been started in the background..."),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,9 @@
{
"link_doctype": "Zoom Webinar Attendance Record",
"link_fieldname": "webinar"
},
{
"link_doctype": "Zoom Webinar Registrant Record",
"link_fieldname": "webinar"
}
],
"modified": "2025-11-16 18:31:16.335445",
"modified": "2025-12-09 13:30:38.107775",
"modified_by": "Administrator",
"module": "Zoom Integration",
"name": "Zoom Webinar",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def sync_attendance(self):

for attendance in batch:
registration = frappe.db.get_value(
"Zoom Webinar Registration", {"user": attendance.get("user_email", "N/A")}, "name"
"Zoom Webinar Registration", {"email": attendance.get("user_email", "N/A")}, "name"
)

try:
Expand Down Expand Up @@ -253,7 +253,7 @@ def sync_attendance(self):
frappe.throw(_(f"Failed to sync attendance: {e!s}"))

@frappe.whitelist()
def get_registrants(self):
def sync_registrations_from_zoom(self):
try:
details = get_webinar_registrant_details(self.name)

Expand All @@ -278,27 +278,37 @@ def get_registrants(self):
try:
doc = frappe.get_doc(
{
"doctype": "Zoom Webinar Registrant Record",
"doctype": "Zoom Webinar Registration",
"registrant_id": registrant.get("id"),
"join_url": registrant.get("join_url"),
"webinar": self.name,
"email": registrant.get("email"),
"first_name": registrant.get("first_name"),
"last_name": registrant.get("last_name"),
"phone": registrant.get("phone"),
"docstatus": 1,
"synced_from_zoom": 1,
}
)
for question in registrant.get("custom_questions"):
if question.get("title"):
doc.append(
"custom_question",
"additional_params",
{
"key": question.get("title", "N/A"),
"value": question.get("value", "N/A"),
},
)
doc.insert(ignore_permissions=True, ignore_if_duplicate=True)

if registrant.get("phone"):
doc.append(
"additional_params",
{
"key": "Phone",
"value": registrant.get("phone"),
},
)

doc.insert(ignore_permissions=True, ignore_if_duplicate=True)
processed_count += 1
except Exception as e:
frappe.log_error(
Expand Down Expand Up @@ -351,19 +361,13 @@ def sync_attendance_in_background(self):
"sync_attendance",
queue="long",
)
frappe.enqueue_doc(
self.doctype,
self.name,
"get_registrants",
queue="long",
)

@frappe.whitelist()
def sync_registration_in_background(self):
def sync_registrations_in_background(self):
frappe.enqueue_doc(
self.doctype,
self.name,
"get_registrants",
"sync_registrations_from_zoom",
queue="long",
)

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
"webinar",
"column_break_baez",
"user",
"synced_from_zoom",
"attendee_details_section",
"email",
"column_break_tmmm",
"first_name",
"last_name",
"section_break_rdgw",
"additional_params",
"zoom_information_section",
Expand Down Expand Up @@ -73,7 +79,8 @@
"fieldname": "registrant_id",
"fieldtype": "Data",
"label": "Registrant ID",
"read_only": 1
"read_only": 1,
"unique": 1
},
{
"fieldname": "column_break_hzel",
Expand All @@ -88,13 +95,53 @@
"fieldtype": "Table",
"label": "Additional Params",
"options": "Zoom Webinar Additional Param"
},
{
"fetch_from": "user.email",
"fetch_if_empty": 1,
"fieldname": "email",
"fieldtype": "Data",
"label": "Email",
"options": "Email",
"read_only_depends_on": "eval:doc.user"
},
{
"fieldname": "attendee_details_section",
"fieldtype": "Section Break",
"label": "Attendee Details"
},
{
"fieldname": "column_break_tmmm",
"fieldtype": "Column Break"
},
{
"fetch_from": "user.first_name",
"fetch_if_empty": 1,
"fieldname": "first_name",
"fieldtype": "Data",
"label": "First Name",
"read_only_depends_on": "eval:doc.user"
},
{
"fetch_from": "user.last_name",
"fetch_if_empty": 1,
"fieldname": "last_name",
"fieldtype": "Data",
"label": "Last Name",
"read_only_depends_on": "eval:doc.user"
},
{
"default": "0",
"fieldname": "synced_from_zoom",
"fieldtype": "Check",
"label": "Synced from Zoom?"
}
],
"grid_page_length": 50,
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2025-10-31 12:45:50.275215",
"modified": "2025-12-09 13:13:19.795660",
"modified_by": "Administrator",
"module": "Zoom Integration",
"name": "Zoom Webinar Registration",
Expand Down
Loading
Loading