55based on company size.
66"""
77
8+ import asyncio
89import os
910import urllib .parse
1011import uuid
@@ -319,13 +320,12 @@ async def send_demo_event(self, form_data: dict[str, Any]):
319320 )
320321
321322 # Send data to PostHog, Common Room, and Slack
322- yield [
323- DemoFormStateUI .send_data_to_posthog (demo_event ),
324- DemoFormStateUI .send_data_to_common_room (demo_event ),
325- DemoFormStateUI .send_data_to_slack (demo_event ),
326- ]
323+ await asyncio . gather (
324+ self .send_data_to_posthog (demo_event ),
325+ self .send_data_to_common_room (demo_event ),
326+ self .send_data_to_slack (demo_event ),
327+ )
327328
328- @rx .event (background = True )
329329 async def send_data_to_posthog (self , event_instance : PosthogEvent ):
330330 """Send data to PostHog using class introspection.
331331
@@ -349,7 +349,6 @@ async def send_data_to_posthog(self, event_instance: PosthogEvent):
349349 except Exception :
350350 log ("Error sending data to PostHog" )
351351
352- @rx .event (background = True )
353352 async def send_data_to_common_room (self , event_instance : DemoEvent ):
354353 """Update CommonRoom with user login information."""
355354 tags : Sequence [str ] = [
@@ -385,14 +384,14 @@ async def send_data_to_common_room(self, event_instance: DemoEvent):
385384 f"CommonRoom: Failed to identify user with email { event_instance .company_email } , err: { ex } "
386385 )
387386
388- @rx .event (background = True )
389387 async def send_data_to_slack (self , event_instance : DemoEvent ):
390388 """Send demo form data to Slack webhook.
391389
392390 Args:
393391 event_instance: An instance of DemoEvent with form data.
394392 """
395393 slack_payload = {
394+ "technicalLevel" : event_instance .technical_level ,
396395 "lookingToBuild" : event_instance .internal_tools ,
397396 "businessEmail" : event_instance .company_email ,
398397 "howDidYouHear" : event_instance .referral_source ,
0 commit comments