Skip to content

Commit b863bc9

Browse files
committed
update demos urls
1 parent 6f959cc commit b863bc9

File tree

1 file changed

+21
-7
lines changed

1 file changed

+21
-7
lines changed

reflex_ui/blocks/demo_form.py

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
CAL_REQUEST_DEMO_URL = os.getenv(
2929
"CAL_REQUEST_DEMO_URL", "https://cal.com/team/reflex/reflex-intro-call"
3030
)
31+
JH_CAL_URL = os.getenv(
32+
"JH_CAL_URL", "https://cal.com/team/reflex/reflex-demo-with-jh-tevis"
33+
)
34+
INTRO_CAL_URL = os.getenv("INTRO_CAL_URL", "https://cal.com/team/reflex/reflex-intro")
3135
CAL_ENTERPRISE_FOLLOW_UP_URL = os.getenv(
3236
"CAL_ENTERPRISE_FOLLOW_UP_URL",
3337
"https://cal.com/team/reflex/reflex-intro",
@@ -230,10 +234,12 @@ async def on_submit(self, form_data: dict[str, Any]):
230234
if not check_if_company_email(form_data.get("email", "")):
231235
yield rx.set_focus("email")
232236
yield rx.toast.error(
233-
"Please enter a valid company email",
237+
"Please enter a valid company email - gmails, aol, me, etc are not allowed",
234238
position="top-center",
235239
)
236-
yield demo_form_error_message.push("Please enter a valid company email")
240+
yield demo_form_error_message.push(
241+
"Please enter a valid company email - gmails, aol, me, etc are not allowed"
242+
)
237243
return
238244
# Check if the has selected a number of employees
239245
if not check_if_default_value_is_selected(
@@ -286,12 +292,20 @@ async def on_submit(self, form_data: dict[str, Any]):
286292
}
287293

288294
query_string = urllib.parse.urlencode(params)
289-
if is_small_company(form_data.get("number_of_employees", "")):
290-
yield rx.redirect(f"{CAL_REQUEST_DEMO_URL}?{query_string}")
291-
return
292-
293-
cal_url_with_params = f"{CAL_ENTERPRISE_FOLLOW_UP_URL}?{query_string}"
295+
technical_level = form_data.get("technical_level", "")
294296

297+
# Route based on company size and technical level
298+
if is_small_company(form_data.get("number_of_employees", "")):
299+
# Small companies (≤10 employees) always go to JH_CAL_URL
300+
cal_url = JH_CAL_URL
301+
else:
302+
# Large companies (>10 employees)
303+
if technical_level == "Non-technical":
304+
cal_url = JH_CAL_URL
305+
else: # Neutral or Technical
306+
cal_url = INTRO_CAL_URL
307+
308+
cal_url_with_params = f"{cal_url}?{query_string}"
295309
yield [is_sending_demo_form.push(False), rx.redirect(cal_url_with_params)]
296310

297311
@rx.event(background=True)

0 commit comments

Comments
 (0)