11import logging
2+ import os
23from datetime import date , datetime , timedelta , timezone
34from typing import List , Optional
45from uuid import UUID
@@ -106,7 +107,7 @@ async def create_matches(self, req: MatchCreateRequest) -> MatchCreateResponse:
106107 language = volunteer .language .value if volunteer .language else "en"
107108
108109 first_name = volunteer .first_name if volunteer .first_name else None
109- matches_url = " http://localhost:3000/volunteer/dashboard"
110+ matches_url = f" { os . getenv ( 'FRONTEND_URL' , ' http://localhost:3000' ) } /volunteer/dashboard"
110111
111112 ses_service .send_matches_available_email (
112113 to_email = volunteer .email ,
@@ -342,7 +343,7 @@ async def schedule_match(
342343 time = participant_time_str ,
343344 timezone = participant_tz_abbr ,
344345 first_name = participant .first_name ,
345- scheduled_calls_url = " http://localhost:3000/participant/dashboard" ,
346+ scheduled_calls_url = f" { os . getenv ( 'FRONTEND_URL' , ' http://localhost:3000' ) } /participant/dashboard" ,
346347 language = participant_language ,
347348 )
348349
@@ -357,7 +358,7 @@ async def schedule_match(
357358 time = volunteer_time_str ,
358359 timezone = volunteer_tz_abbr ,
359360 first_name = volunteer .first_name ,
360- scheduled_calls_url = " http://localhost:3000/volunteer/dashboard" ,
361+ scheduled_calls_url = f" { os . getenv ( 'FRONTEND_URL' , ' http://localhost:3000' ) } /volunteer/dashboard" ,
361362 language = volunteer_language ,
362363 )
363364
@@ -446,7 +447,7 @@ async def request_new_times(
446447 to_email = volunteer .email ,
447448 participant_name = participant_name ,
448449 first_name = volunteer .first_name ,
449- matches_url = " http://localhost:3000/volunteer/dashboard" ,
450+ matches_url = f" { os . getenv ( 'FRONTEND_URL' , ' http://localhost:3000' ) } /volunteer/dashboard" ,
450451 language = volunteer_language ,
451452 )
452453 except Exception as e :
@@ -532,7 +533,7 @@ async def cancel_match_by_participant(
532533 time = volunteer_time_str ,
533534 timezone = volunteer_tz_abbr ,
534535 first_name = volunteer .first_name ,
535- dashboard_url = " http://localhost:3000/volunteer/dashboard" ,
536+ dashboard_url = f" { os . getenv ( 'FRONTEND_URL' , ' http://localhost:3000' ) } /volunteer/dashboard" ,
536537 language = volunteer_language ,
537538 )
538539 except Exception as e :
@@ -623,7 +624,7 @@ async def cancel_match_by_volunteer(
623624 time = participant_time_str ,
624625 timezone = participant_tz_abbr ,
625626 first_name = participant .first_name ,
626- request_matches_url = " http://localhost:3000/participant/dashboard" ,
627+ request_matches_url = f" { os . getenv ( 'FRONTEND_URL' , ' http://localhost:3000' ) } /participant/dashboard" ,
627628 language = participant_language ,
628629 )
629630 except Exception as e :
@@ -829,7 +830,7 @@ async def volunteer_accept_match(
829830 language = participant .language .value if participant .language else "en"
830831
831832 first_name = participant .first_name if participant .first_name else None
832- matches_url = " http://localhost:3000/participant/dashboard"
833+ matches_url = f" { os . getenv ( 'FRONTEND_URL' , ' http://localhost:3000' ) } /participant/dashboard"
833834
834835 ses_service = SESEmailService ()
835836 ses_service .send_matches_available_email (
0 commit comments