File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -6,17 +6,21 @@ class NotificationManager:
66 # This class is responsible for sending notifications with the deal flight details.
77
88 def __init__ (self , target_phone_number : str ):
9- self .phone_number = target_phone_number
9+ self .target_phone_number = target_phone_number
1010
11- def send_mail (self ) -> None :
11+ def send_mail (self , flight_detail : dict ) -> None :
1212 account_sid = os .environ ['TWILIO_ACCOUNT_SID' ]
1313 auth_token = os .environ ['TWILIO_AUTH_TOKEN' ]
1414 number_twilio = os .environ ['TWILIO_PHONE_NUMBER' ]
1515 client = Client (account_sid , auth_token )
16+ body_message = self .__build_message (flight_detail )
1617
1718 message = client .messages \
1819 .create (
19- body = "Test" ,
20+ body = body_message ,
2021 from_ = f'{ number_twilio } ' ,
21- to = f'{ self .phone_number } '
22+ to = f'{ self .target_phone_number } '
2223 )
24+
25+ def __build_message (self , flight_detail : dict ) -> str :
26+ return f"Your flight from XXX will be { flight_detail } "
You can’t perform that action at this time.
0 commit comments