|
28 | 28 | CAL_REQUEST_DEMO_URL = os.getenv( |
29 | 29 | "CAL_REQUEST_DEMO_URL", "https://cal.com/team/reflex/reflex-intro-call" |
30 | 30 | ) |
| 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") |
31 | 35 | CAL_ENTERPRISE_FOLLOW_UP_URL = os.getenv( |
32 | 36 | "CAL_ENTERPRISE_FOLLOW_UP_URL", |
33 | 37 | "https://cal.com/team/reflex/reflex-intro", |
@@ -230,10 +234,12 @@ async def on_submit(self, form_data: dict[str, Any]): |
230 | 234 | if not check_if_company_email(form_data.get("email", "")): |
231 | 235 | yield rx.set_focus("email") |
232 | 236 | 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", |
234 | 238 | position="top-center", |
235 | 239 | ) |
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 | + ) |
237 | 243 | return |
238 | 244 | # Check if the has selected a number of employees |
239 | 245 | if not check_if_default_value_is_selected( |
@@ -286,12 +292,20 @@ async def on_submit(self, form_data: dict[str, Any]): |
286 | 292 | } |
287 | 293 |
|
288 | 294 | 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", "") |
294 | 296 |
|
| 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}" |
295 | 309 | yield [is_sending_demo_form.push(False), rx.redirect(cal_url_with_params)] |
296 | 310 |
|
297 | 311 | @rx.event(background=True) |
|
0 commit comments